Repository navigation
Add hermetic template recording and replay - #2114
Open
martelogan wants to merge 4 commits into
Open
martelogan wants to merge 4 commits into
martelogan wants to merge 4 commits into
Conversation
(cherry picked from commit 3befa56)
Keep recorder hooks inert for host contexts without Liquid registers, capture only bytes produced by the template, and exclude memory-limited renders from the corpus. Strict replay now stubs application-only inline and block tags from the recorded sources. Assisted-By: devx/948e6cb4-458b-480b-8d99-d726473b381b
martelogan
force-pushed
the
martelogan/liquid-hermetic-recording
branch
from
September 3, 2026 03:45
394edbf to
2578979
Compare
The hooks sit on the hottest paths a host has - every drop read, filter call, tag and variable - and a host that never records should not pay for them. Storefront's verifier measured the ungated hooks at +1.59% allocations per request with recording switched off, against a 0.2% gate. HOOKS_ENABLED is deliberately boot-time: a constant is what makes the disabled path free. Recording is generated offline, so the processes that need it set LIQUID_TEMPLATE_RECORDER_HOOKS at boot and nothing else pays. TemplateRecorder.record now raises when the hooks are off, so a misconfigured host fails loudly instead of silently recording nothing. Assisted-By: devx/948e6cb4-458b-480b-8d99-d726473b381b
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Carries forward the hermetic recording and deterministic replay work from #1975 while preserving commit authorship. Tobi’s recorder commit and the two Logan-authored integration/performance follow-ups remain unchanged in history. The new merge commit is authored by Logan Martel.
Branch ancestry
Refreshed by merging main at 4e39ae4, preserving existing commit identities. This head now includes Liquid 5.14.0, including the upstream strict2 and range-resource-limit changes. Consumers moving from the previous v5.13-based recording head must validate that runtime upgrade; this is no longer a recorder-only delta against stock 5.13.
The Template#render conflict preserves both recorder output/lifecycle handling and upstream error-mode register restoration. Added coverage for recording with strict2 and restoring the caller’s error mode.
Recording behavior
The boot-time gate was introduced after an earlier ungated Storefront verifier allocation regression. No claim is made that the old measurement establishes performance for this refreshed head.
Validation
Run locally on Ruby 4.0.7:
No new mandatory tooling or source-refresh requirement is introduced for downstream saved tests.
Hosted check blocker
At refreshed head 7eb9c7c, the CLA workflow fails while fetching commits because the Shopify organization IP allowlist rejects its GitHub-hosted runner. It does not reach contributor/signature validation. Local tests above pass; this PR is not being reported as CI-green.