Repository navigation
fix(benchmarks): match setText's journal read in the root contracts audit - #1943
Merged
Merged
Conversation
…udit #1915 renamed setText's text node to `target` and wrapped its journal call, so contracts.mjs's exact-string instrumentation found no match and the root-transactions audit threw before measuring anything. Match the call with a pattern that accepts any spelling of the staged-view read, so the pending ternary form in #1942 keeps matching too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm
marked this pull request as ready for review
October 9, 2026 16:58
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website | 62385a6 | Commit Preview URL Branch Preview URL |
Oct 09 2026, 05:44 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website-mcp | 62385a6 | Commit Preview URL Branch Preview URL |
Oct 09 2026, 05:46 PM |
Contributor
Benchmark report🟢 No byte growth, no added work, and no timing changes beyond ±3%. Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 60 measured values. Public-import reachability bundles (bytes)No changes across 111 measured values. |
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
root-transactionsaudit (benchmarks/root-transactions/contracts.mjs) throws onmainbefore it measures anything. Its instrumentation looks forsetText's journal call by exact text, and that text no longer exists./journalText\(target, \(STAGED_DOM.*\)\.nodeValue\);/. With the fix, the audit reports the same contract results it gave before the refactor that broke it.Why
setText's text node fromnodetotargetand wrapped the journal call onto two lines. The audit still searched forif (TRANSITION_JOURNAL !== null) journalText(node, (STAGED_DOM?.view(node) ?? node).nodeValue);.replaceOncefound 0 matches and its assertion failed (0 !== 1).(STAGED_DOM ? STAGED_DOM.view(target) : target).nodeValue, so the audit keeps working whichever PR merges first.setText, notupdateTextValue. Before fix(octane): keep updating an only text child after page translation #1915, the instrumented line wassetText's journal read, andupdateTextValue'sjournalText(node, previous)was never instrumented. The audit's compiledAppreachessetText; thelivevariant's hold reads (text: 1) confirm the substituted read runs. SubstitutingupdateTextValue'spreviouswould also change itsprevious !== valuecomparison.Changes
benchmarks/root-transactions/contracts.mjs: replaced the exact-string match for the text journal read with the pattern above, and updated the comment. ThejournalAttrreplacement is unchanged: onmainit matches exactly once, and perf(octane): let Vite's minifier drop unused optional drivers #1942 updates that string itself.Validation
node benchmarks/root-transactions/contracts.mjs: onmain(4f82777) it throwsExpected exactly one …(0 !== 1). With the fix it completes. Itsreads,results(18 rows: dev/prod × live/delayed-driver/binding-cache × scenarios) andtargetsare byte-identical to the same script run against the pre-fix(octane): keep updating an only text child after page translation #1915 checkout 1048eab. The reads are compiled128/0and descriptor128/128.livepreserves every scenario.delayed-driverfails its hold as intended (it showsreplacement).binding-cachepasses onlyfirst-raw-throw.origin/perf/foldable-driver-reads, which also carries its ownjournalAttrstring update) and ran the audit there. The results are also byte-identical to the baseline.node benchmarks/bench.mjs root-transactions --quick: all four scripts (retirement, inputs, reorders, contracts) completed.node benchmarks/bench.mjs root-transactions --quick --ratios: checked 10 guards,PASS — no ratio guards breached.pnpm format:files:check benchmarks/root-transactions/contracts.mjspnpm sync: no generated changes.pnpm format:check/pnpm typecheck/pnpm test: not run locally. This is a benchmark-script-only change; CI covers them.perf-review: not applicable (benchmark tooling only, no runtime, compiler or binding change).concise-code: src +0 −0 (runtime +0 −0); benchmark script +5 −4; no new files or exports. Alternatives considered: (1) updating the exact string tomain's two-line spelling, also about 4 lines, rejected because it breaks again as soon as perf(octane): let Vite's minifier drop unused optional drivers #1942 lands; (2) matching eithernodeortarget, which would also support full (non---reads-only) runs against pre-fix(octane): keep updating an only text child after page translation #1915 checkouts but needs a capture group, andreplaceOnce'ssplit-based count would then need a regex-specific branch. Bytes: not applicable.Risk / follow-ups
--reads-only) no longer instruments pre-fix(octane): keep updating an only text child after page translation #1915 baseline checkouts, because their call usesnode. The documented baseline command (contracts.mjs /path/to/baseline --reads-only) builds only the uninstrumented native artifact, so it is unaffected.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Benchmark-only instrumentation in
contracts.mjs; no runtime, compiler, or binding changes.Overview
The root-transactions contract audit (
contracts.mjs) was failing onmainbecause its instrumentation still searched for an exactjournalTextcall shape that #1915 removed whensetTextrenamed the text node totargetand reformatted the staged-view read.The audit now patches
setText's journal site with regex/journalText\(target, \(STAGED_DOM.*\)\.nodeValue\);/and substitutesglobalThis.__rootContractAudit.*Text(target), so it still instruments the right read across minor staged-DOM spellings (including pending refactors). Comments were updated to describesetTextrather than the old wording.Reviewed by Cursor Bugbot for commit 62385a6. Bugbot is set up for automated code reviews on this repo. Configure here.