Skip to content

perf(codegen): compare proven Symbols by identity - #8729

Closed
proggeramlug wants to merge 2 commits into
perf/method-name-prototype-guardfrom
perf/symbol-identity-equality
Closed

perf(codegen): compare proven Symbols by identity#8729
proggeramlug wants to merge 2 commits into
perf/method-name-prototype-guardfrom
perf/symbol-identity-equality

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

  • record runtime Symbol constructor provenance for stable locals and module globals
  • lower strict equality against a proven Symbol to raw NaN-boxed identity
  • keep loose equality, reassigned locals, and erased TypeScript annotation claims on semantic runtime helpers

This is stacked on #8672. It removes the two generic js_eq calls identified in the codehz/ecs accumulation profile; it contains no ECS-specific pattern or source-name check.

Correctness evidence

  • cargo test -p perry-codegen --lib: 1220 passed, 0 failed, 1 ignored
  • python3 scripts/local_binding_type_audit.py and --self-test: passed
  • python3 scripts/check_test_registration.py: passed
  • ./scripts/pre-tag-check.sh --quick: passed
  • focused Node/Perry fixture: byte-for-byte identical, including annotation lies and loose coercion
  • forced verified GC Symbol stress: B 0, 87 copying minors, 11470 objects copied
  • frozen codehz/ecs suite: 7/7 tests and checksum 50005000
  • generated LLVM: both readSimpleColumnValue bodies use icmp eq i64, with no js_eq

Mac mini performance

Apple M1, Node 26.5.1, repeat 256, 2 warmups, 6 measured batches, 11 alternating process pairs, taskpolicy fixed, 22/22 process oracles:

Direct Node comparison remains 0.086611 ms vs Perry 0.195961 ms, or 2.263x. This PR is a measured mechanism removal, not a claim that parity is complete.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 93385c5e-ae50-4215-8798-01926e86c986

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

proggeramlug added a commit that referenced this pull request Aug 24, 2026
…his-methods and proven Symbols (#8737)

Lands #8735, #8729 and #8731.

#8735 fixes a real data race in the dense-array subclass layout cache.
`cached_dense_layout` read two payload fields `Relaxed` and then rechecked
the sequence counter with an `Acquire` LOAD -- but an acquire load only
constrains what follows it, so on weakly ordered hardware the preceding
payload reads could sink past the recheck. A reader racing a colliding
publisher could then combine one field from the old layout with one from
the new and return a WRONG ELEMENT rather than faulting. A standalone
`fence(Acquire)` now sits between the payload reads and the recheck, which
is the canonical seqlock-reader form.

#8729 lowers strict equality against a proven Symbol to raw NaN-boxed
identity, keeping loose equality, reassigned locals and erased TypeScript
annotation claims on the semantic runtime helpers.

#8731 (fixes #8693) publishes producer-authoritative proven-`this` method
capabilities through imports, aliases and re-exports, emitting guarded
direct imported clone calls while retaining generic dispatch fallbacks.

A changelog fragment was added for #8735, which had neither one nor a
skip-changelog label.

No version bump.

Co-authored-by: Ralph Küpper <ralph@skelpo.com>
@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed on main via #8737 (squash c203c772c), with #8735.

Validated on the merged result: all 30 lint checkers, runtime 2669/0 at RUST_TEST_THREADS=1, codegen 1222/0 (+8), all codegen integration suites clean. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant