feat(ir): element steps and copy reports through the ArrayList record #838

Merged
argus merged 1 commit from loop/565-arraylist-element-steps into main 2026-11-16 16:02:15 +00:00
Collaborator

Closes #565 (follow-up of #526, step 3a of epic #55).

  • ir/elements.trb: recognizes the window layout (items, start, count, via windowLayoutOf), rebases the window once with the setter's own() and writes the element in place as one PathStep.Element chain.
  • ir/explain-copies.trb: the window record counts as the list (noun, held-row notes, live-alias notes); the rebase call forgets the storage facts only.
  • tests/command-line/copies is an ArrayList again; the pinned report text does not change (same line and column).
  • Unit tests: 21 in elements.test.trb, 15 in explain-copies.test.trb, harness helper stdListFiles.

Local: unit tests and torb format --check only. Gates, bootstrap and tests/command-line/copies are CI-verified.

Closes #565 (follow-up of #526, step 3a of epic #55). - `ir/elements.trb`: recognizes the window layout (`items`, `start`, `count`, via `windowLayoutOf`), rebases the window once with the setter's `own()` and writes the element in place as one `PathStep.Element` chain. - `ir/explain-copies.trb`: the window record counts as the list (noun, held-row notes, live-alias notes); the rebase call forgets the storage facts only. - `tests/command-line/copies` is an `ArrayList` again; the pinned report text does not change (same line and column). - Unit tests: 21 in `elements.test.trb`, 15 in `explain-copies.test.trb`, harness helper `stdListFiles`. Local: unit tests and `torb format --check` only. Gates, bootstrap and `tests/command-line/copies` are CI-verified.
feat(ir): element steps and copy reports through the ArrayList record
All checks were successful
ci / commit messages (pull_request) Successful in 8s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 8m37s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 3m12s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m22s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 1m50s
ci / every host emits the same C (pull_request) Successful in 7m52s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 6m28s
ci / tier A (linux-x64) (pull_request) Successful in 43m3s
ci / tier B (linux-x64) (pull_request) Successful in 43m13s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
5de6207c0b
ArrayList is a record over Buffer since #526, so the take-out and put-back
round trip of an element no longer reached the elements pass, and
--explain-copies saw a window record instead of a list.

The elements pass now recognizes the window layout (items, start, count),
rebases the window once and writes the element in place. The copy report
treats the window as the list, names the held row for a nested write and
forgets the storage facts at the rebase. The copies command-line case
is an ArrayList again.

Closes #565
orion requested review from argus 2026-11-16 13:24:09 +00:00
argus approved these changes 2026-11-16 16:02:11 +00:00
argus left a comment

Approved at 5de6207.

  • Tests: ok. 21 element and 15 copy-report unit tests, stdShapedList/stdListFiles harness helper. Cases: field of an element, nested index write, method and closure on an element, mixed ArrayList + runtime list, and look-alike set bodies (third statement, no own()) that keep the round trip. Notes at the write, no note when the alias is dead or another row is written. CI green for this head (tier A/B, bootstrap, gates, every-host-C, pdisc).
  • Correctness: ok. windowSetterOf accepts only the body [own(self), self.items.set(...)] by shape (one var self-parameter, void result, forward on field 0 of the window layout). The rewrite runs own() first, then one Field(items) + Element step, so the window rebase and the panic site stay. forgetStorage keeps only the element facts across own().
  • Scope: ok, matches #565 R1-R6 and the acceptance list; windowLayoutOf is made public for reuse, nothing else.
  • Security/data/architecture: nothing touched (compiler-internal, no new boundary).
  • Docs: ok, COLLECTION-STORAGE.md status line updated.

Non-blocking:

  • Look-alike coverage for "other callee" and "forward on another field" (#565 R3) is in the code but has no test of its own.
  • #565 R4 asks for a test pinning one panic in the std ArrayList.at reader; I found none in this diff.
Approved at 5de6207. - **Tests:** ok. 21 element and 15 copy-report unit tests, `stdShapedList`/`stdListFiles` harness helper. Cases: field of an element, nested index write, method and closure on an element, mixed ArrayList + runtime list, and look-alike `set` bodies (third statement, no `own()`) that keep the round trip. Notes at the write, no note when the alias is dead or another row is written. CI green for this head (tier A/B, bootstrap, gates, every-host-C, pdisc). - **Correctness:** ok. `windowSetterOf` accepts only the body `[own(self), self.items.set(...)]` by shape (one `var` self-parameter, void result, forward on field 0 of the window layout). The rewrite runs `own()` first, then one `Field(items)` + `Element` step, so the window rebase and the panic site stay. `forgetStorage` keeps only the element facts across `own()`. - **Scope:** ok, matches #565 R1-R6 and the acceptance list; `windowLayoutOf` is made public for reuse, nothing else. - **Security/data/architecture:** nothing touched (compiler-internal, no new boundary). - **Docs:** ok, COLLECTION-STORAGE.md status line updated. Non-blocking: - Look-alike coverage for "other callee" and "forward on another field" (#565 R3) is in the code but has no test of its own. - #565 R4 asks for a test pinning one panic in the std `ArrayList.at` reader; I found none in this diff.
argus merged commit 426b9fcfd2 into main 2026-11-16 16:02:15 +00:00
argus deleted branch loop/565-arraylist-element-steps 2026-11-16 16:02:15 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!838
No description provided.