refactor(signals): tier-2 state consolidations from the architecture audit - #2905
Merged
Conversation
…audit Three behavior-preserving consolidations, each retiring a bug class: - single pending-source container: the _pendingSource/_pendingSources dual representation (singular slot + lazily-promoted Set) collapses to one lazily-created Set; the promotion invariant #2893's first bug broke no longer exists. -267 min / -110 gz. - optimistic brand as CONFIG_OPTIMISTIC bit: deletes OVERRIDE_UNDEFINED and 19 wrap/unwrap sites; the undefined-as-value / undefined-as-brand collision (#2898) is unrepresentable. -123 / -26. - ambient work is a transaction: the globalQueue's parallel batch fields and initTransition's four adoption/aliasing blocks collapse into one always-present batch shape; flush fast-path emptiness check preserved. -270 / -96. Combined: full 57,073->56,413 min / 21,229->21,008 gz; floor 18,551->18,013 / 7,527->7,357. 1,052 tests pass on the integrated branch; each patch was independently verified (byte-exact re-measurement, suite re-run via poison-probed alias configs, hunk-by-hunk behavior review) before integration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
🦋 Changeset detectedLatest commit: 1111969 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
Coverage Report for CI Build 29618128245Warning No base build found for commit Coverage: 74.74%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
…h mirror CodSpeed flagged updateSignals:update1to1 at -6.8% on #2905 (reproduced on rerun): queuePendingNode gained a property hop when the batch fields moved behind globalQueue._batch, and it runs once per staged write. A module-local mirror updated at the three _batch assignment sites restores the pristine load count on the write path and commit loop; the field stays authoritative for cross-module readers. The merge bench regression is not yet attributed — this push doubles as the bisection probe: if it persists, it belongs to the pending-container or config-brand change, not the batch consolidation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 17, 2026
CodSpeed attribution (zero-diff control #2906 clean; single-patch probes #2907/#2908/#2909): the config-brand change alone carries merge -7% plus sub-threshold -3..4% across update1to1/propagation — it drove both flagged regressions on this PR. The diff is load-neutral by inspection and byte-flat in an isolated merge harness; the diffuse cross-bench pattern indicates shared-process JIT/IC state redistribution from the hasOverride shape change. Pulled pending a shape-stable redesign (dedicated boolean in the node literal rather than a _config RMW). Remaining: pending-container + ambient-txn, both CodSpeed-clean in isolation. Full 57,073->56,550 min / 21,229->21,050 gz; floor 18,551->18,111 / 7,527->7,376. 1,052 tests pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
First landing from the architecture audit (the growth-forensics follow-up to #2883): three behavior-preserving state consolidations, each chosen because it makes a past bug class unrepresentable rather than just smaller.
_pendingSource/_pendingSourcesdual representation collapses to one lazily-created SetCONFIG_OPTIMISTICbit — deletesOVERRIDE_UNDEFINEDand its 19 wrap/unwrap sitesinitTransition's adoption/aliasing blocks collapse into one always-present batch shapeCombined: full 57,073 → 56,413 min / 21,229 → 21,008 gz; floor 18,551 → 18,013 / 7,527 → 7,357 — roughly six weeks of fix-growth reversed.
Verification
Each patch was built against a pristine copy, measured, and independently verified: byte-exact re-measurement, the full 1,052-test suite re-run through an alias config whose liveness was proven by poison-probe (inject a throw into the variant, observe 27 failures, revert), and a hunk-by-hunk review hunting for observable-behavior drift (error identity, notify ordering, companion snap timing). The pending-container change preserves
NotReadyErroridentity by construction — the verifier proved the old dual representation was oldest-first in every reachable state, so the Set-only pick selects the same node in every scenario. The integrated branch re-runs everything green and the combined delta equals the sum of the parts.Perf notes for review: the pending-container change allocates a Set on first pending source where the old code stored a bare reference (async-path only, never the sync hot loop); the ambient-batch change was reviewed for flush fast-path equivalence (
canUseSimpleSyncFlushbecomes an equivalent emptiness check on the batch object). CodSpeed on this PR is the arbiter — if it flags the flush path, the batch-object field access pattern is the first suspect.Three further audit items (STATUS_PENDING derivation, stageValue chokepoint, re-ask single-encoding) were built and verified but measured size-neutral (+48/−1/±0 min vs audit estimates of −500/−120/−180) and are deliberately not included — they're parked as patches for opportunistic folding when those files are next touched.
🤖 Generated with Claude Code