Skip to content

Revert #9326 — it breaks cc --help on main (defineProperty TypeError); fixes #9341 - #9345

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
proggeramlug:revert/9326-defineproperty-break
Sep 1, 2026
Merged

Revert #9326 — it breaks cc --help on main (defineProperty TypeError); fixes #9341#9345
proggeramlug merged 1 commit into
PerryTS:mainfrom
proggeramlug:revert/9326-defineproperty-break

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Reverts #9326 ("indexed writes honour a custom array prototype", the merge of #9297). Fixes #9341: claude --help on current main dies deterministically with

Uncaught (in promise) TypeError: Object.defineProperty called on non-object

rc=1, 5/5 runs — the campaign's primary parity workload is broken and every cc measurement against main is void (including the r6 numbers in /root/claude-arch/measure_r6.log, which recorded a binary that exits early).

Attribution — two independent chains, agreeing

  1. By elimination (cc --help parity gate down on main: defineProperty-on-non-object at startup — window pins #9326 (indexed writes with a recorded custom array prototype) #9341's report, three independent builds): 83754818e is verified green; the fix(runtime): no Rust frame is ever a longjmp target — cc --help segfault fixed, parity gate back online (#9305) #9323 merge point re-verified the parity gate; fix(release): prime the macOS x86_64 dependency cache (from #9327) #9328/fix: keep main green after #9329 #9336 are infra/lint-only. That leaves fix(runtime): indexed writes honour a custom array prototype (from #9297) #9326 as the only runtime change in the broken window. Known-good/known-bad binaries preserved at /root/claude-shapedesc/ on perrymaster.
  2. A direct build at the fix(runtime): no Rust frame is ever a longjmp target — cc --help segfault fixed, parity gate back online (#9305) #9323 merge commit (d1bef4c965, the parent side of the window) is running as confirmation and will be posted to cc --help parity gate down on main: defineProperty-on-non-object at startup — window pins #9326 (indexed writes with a recorded custom array prototype) #9341 when it completes.

And this PR is its own third proof: it is a clean git revert -m 1 of exactly the #9326 merge, nothing else — if cc --help passes on it, the attribution is settled by construction.

Why revert rather than fix-forward

I authored the reverted work, so this is not deflection — the calculus is that a broken primary workload on main costs every session more per hour than the fix is worth: it voids all cc measurements, manufactures false blame against any branch measured on top of it, and this is the third cc-breaking regression to reach main this week (the #9169 window, the #9305 setjmp crash, now this).

The change also failed in exactly the way its own verification warned about: its 88-fixture corpus and 64-check differential were all green — nothing in its verification ran the cc bundle, and the failing shape (esbuild __export/namespace machinery at module-graph scale, on the --help path specifically) is not reducible to the obvious mini-fixture (a direct __defProp/__export/__commonJS repro passes; I tried).

Re-landing conditions

#9220/#9221 remain real bugs and the reverted fix remains substantially correct. It should return once:

  1. The actual cli.js trigger is minimized and added as a fixture (the bundle-scale ingredient my mini-repro lacks),
  2. cc --help byte-parity is run pre-merge on the re-land branch — which this week has earned a place as a required gate for runtime PRs, not a post-hoc measurement.

The revert is conflict-free against current main (6bc775d9b9), cargo fmt clean, runtime typechecks clean.

Summary by CodeRabbit

  • Bug Fixes
    • Improved array indexing and assignment behavior when arrays use custom or inherited prototypes.
    • Corrected generic array methods, including map, forEach, join, and indexOf, when operating on arrays with prototype-provided values.
    • Improved handling of inherited setters, writable and non-writable properties, sparse arrays, and frozen arrays.
    • Ensured boxed array updates follow standard non-strict assignment behavior.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 76ebdcd8-e6b6-4c46-b6e3-e2489b94ee98

📥 Commits

Reviewing files that changed from the base of the PR and between 6bc775d and a744bad.

📒 Files selected for processing (11)
  • changelog.d/9220-array-prototype-index-paths.md
  • crates/perry-runtime/src/array/generic.rs
  • crates/perry-runtime/src/array/indexing.rs
  • crates/perry-runtime/src/array/indexing_proto_chain.rs
  • crates/perry-runtime/src/array/mod.rs
  • crates/perry-runtime/src/array/strict_store_tests.rs
  • crates/perry-runtime/src/typed_feedback.rs
  • crates/perry-runtime/src/typed_feedback/tests.rs
  • scripts/addr_class_allowlist.txt
  • scripts/addr_class_ratchet_baseline.txt
  • test-files/test_gap_9220_9221_array_proto_paths.ts
💤 Files with no reviewable changes (5)
  • changelog.d/9220-array-prototype-index-paths.md
  • test-files/test_gap_9220_9221_array_proto_paths.ts
  • crates/perry-runtime/src/array/strict_store_tests.rs
  • scripts/addr_class_allowlist.txt
  • crates/perry-runtime/src/array/indexing_proto_chain.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Changes

The PR consolidates array prototype-chain indexing into indexing.rs, updates recorded-prototype handling for indexed Get, HasProperty, and Set operations, removes prototype-aware routing from generic array-like access, and changes the boxed typed-feedback fallback to non-strict assignment.

Array indexing behavior

Layer / File(s) Summary
Prototype-aware indexed operations
crates/perry-runtime/src/array/indexing.rs, crates/perry-runtime/src/array/indexing_proto_chain.rs, crates/perry-runtime/src/array/mod.rs
Prototype-chain indexing is inlined into indexing.rs. Recorded prototypes are classified as null, arrays, or other objects. Indexed Get, HasProperty, and strict Set operations resolve inherited descriptors and accessors. The former prototype-chain module and re-export are removed.
Direct array access and strict stores
crates/perry-runtime/src/array/generic.rs, crates/perry-runtime/src/array/indexing.rs
Generic array-like Get and HasProperty operations use direct element slots for real arrays. The dense number-store path fills holes directly.
Boxed index-set fallback
crates/perry-runtime/src/typed_feedback.rs, crates/perry-runtime/src/typed_feedback/tests.rs, test-files/test_gap_9220_9221_array_proto_paths.ts
The boxed array fallback uses non-strict indexed assignment. The frozen-array test checks the returned receiver instead of a runtime throw. The array-prototype regression test file is deleted.

Estimated code review effort: 4 (Complex) | ~60 minutes

Merge Risk: 🟡 Moderate · up to a744b

This revert restores the command-line workload but also reintroduces indexed-array writes that can bypass inherited setters or non-writable properties on custom prototypes, causing incorrect runtime behavior for affected programs. Merge should wait for explicit owner acceptance of this bounded compatibility risk or a follow-up fix.

Suggested reviewers: thehypnoo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: reverting #9326 to fix the #9341 cc --help failure.
Description check ✅ Passed The description provides substantial context about the revert, failure, affected issue, rationale, validation, and re-landing conditions. It does not use the repository template headings or checklist,…
Linked Issues check ✅ Passed The changes directly revert the runtime behavior introduced by #9326, including the custom array-prototype paths implicated by #9341. This aligns with the issue objective to restore the cc --help pa…
Out of Scope Changes check ✅ Passed The code, tests, changelog, allowlist, and baseline changes are consistent with a complete revert of #9326. No unrelated implementation changes are evident.
Docstring Coverage ✅ Passed Docstring coverage is 88.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 5 files. (1 skipped: 1 …
Full details: Description check

Explanation

The description provides substantial context about the revert, failure, affected issue, rationale, validation, and re-landing conditions. It does not use the repository template headings or checklist, but the required information is mostly present.

Full details: Linked Issues check

Explanation

The changes directly revert the runtime behavior introduced by #9326, including the custom array-prototype paths implicated by #9341. This aligns with the issue objective to restore the cc --help parity gate.

Full details: Docstring Coverage

Explanation

Docstring coverage is 88.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 5 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
Contributor Author

The revert did not fix the break — #9326 was not the culprit. Measured on e539a6359 (contains this revert): cc --help still fails identically with Object.defineProperty called on non-object, rc=1, 5/5. Details and the corrected suspect window on #9341. This revert removed correct work; #9297's content should be re-landed once the true culprit is identified.

proggeramlug added a commit that referenced this pull request Sep 1, 2026
… (from #9297) (#9326)" (#9345) (#9370)

This reverts commit 14fcf6b.

Co-authored-by: Ralph Küpper <ralph@skelpo.com>
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