Skip to content

fix(bench): expose Text and Comment in the Strong compiler-checks DOM shim - #1499

Merged
trueadm merged 1 commit into
mainfrom
fix/strong-checks-bench-dom-globals
Oct 1, 2026
Merged

trueadm merged 1 commit into
mainfrom
fix/strong-checks-bench-dom-globals

Conversation

@trueadm

@trueadm trueadm commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

benchmarks/strong-compiler-checks/run.mjs executes compiled cache controls against a happy-dom Window and publishes a fixed list of DOM globals. The client runtime now references the Text constructor while binding signal text, so on current main every run fails before timing with ReferenceError: Text is not defined, for the baseline and the candidate alike. This publishes Text and Comment with the other node constructors.

Found while gathering compiler-throughput evidence for the Strong state purity checks (#1494 and its stack, part of #1027). The fix is independent of that stack.

Validation

  • targeted tests: node benchmarks/strong-compiler-checks/run.mjs --baseline . --smoke on main. Without this change it fails with ReferenceError: Text is not defined; with it, it passes, including the executed cache controls. Full paired runs also completed with the fix applied.
  • pnpm format:files:check benchmarks/strong-compiler-checks/run.mjs
  • pnpm format:check, pnpm typecheck, pnpm test: not run separately for this benchmark-only change; they ran on the Strong stack that includes it.

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


Note

Low Risk
Benchmark-only change to the DOM globals shim; no production runtime or compiler paths are modified.

Overview
Fixes the strong-compiler-checks benchmark harness so cached semantic validation can run against current client runtime code.

validateCachedSemantics already copies a fixed set of happy-dom globals onto globalThis before executing bundled cache controls. The list now includes Text and Comment alongside the other node constructors. Without Text, signal text binding paths that use instanceof Text (e.g. in writeDirectSignalText) throw ReferenceError: Text is not defined and the harness aborts before any timing.

No compiler or runtime behavior changes—only the benchmark DOM shim’s exposed globals.

Reviewed by Cursor Bugbot for commit 09a71a1. Bugbot is set up for automated code reviews on this repo. Configure here.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

… shim

The strong-compiler-checks harness executes compiled cache controls against a
happy-dom Window, publishing a fixed list of DOM globals. The client runtime
now references the Text constructor while binding signal text, so every run
failed before timing with `ReferenceError: Text is not defined`, for the
baseline and candidate alike. Publish Text and Comment with the other node
constructors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix labels Oct 1, 2026
@github-actions
github-actions Bot marked this pull request as draft October 1, 2026 08:48
@trueadm
trueadm marked this pull request as ready for review October 1, 2026 08:49
@trueadm
trueadm merged commit 7895950 into main Oct 1, 2026
32 of 57 checks passed
@trueadm
trueadm deleted the fix/strong-checks-bench-dom-globals branch October 1, 2026 09:26
trueadm added a commit that referenced this pull request Oct 1, 2026
main now contains #1494–#1497 and the benchmark fix (#1499). Resolve against
the updated #1496 branch so this PR carries the uncached useSyncExternalStore
snapshot check on top of the open review follow-ups.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant