perf(ir): count a for over a flat list #475

Merged
argus merged 2 commits from loop/470-counted-for-pass into main 2026-10-25 12:16:46 +00:00
Collaborator

Closes #470

What it does

for value in numbers over a ListIterator, TrieListIterator or BufferIterator becomes a length read once, a counter and an unchecked Element read, on both back ends (compiler/src/ir/counted.trb, one wiring line countFlatListLoops lowering in finishLowering, after dropUncountedMakeUnique and before dropProvableChecks). The pass takes a loop only whole: the head is the direct next call of one of the three std cursors (found through standardFunctionsOf, never by field shape of a user type), its tag and the Switch; the Option is read only there and by the one Read of its Some; the cursor is built once in a block that jumps straight to the head. Every other loop (RingList, Array, maps, sets, String.chars(), a user Iterate, a loop with no length instance for the list) keeps its cursor, Option and dispatch.

Wiring note: the pass runs after dropUncountedMakeUnique, because the var fn next of a trait-typed cursor is lowered with a MakeUnique in front of the call until that pass removes it.

Tests

  • compiler/tests/counted.test.trb (IR snapshot, lowers a probe against the real std): the loop over a List<Int> has no next call, has a less, a [... unchecked] read and add.i64.unchecked; a RingList loop and a user Iterate loop keep their next. The " unchecked]" assert is the read annotation of criterion 3; add.i64.unchecked does not contain it, so it is not implied and stays.
  • Six conformance programs tests/conformance/counted-for-{break,continue,tuple-pattern,strings,empty,write-to-list} with .allocations; they pass natively and in both VM lanes (tier B green).
  • CI on 51d38d87c7 (the perf commit; this head only adds the docs commit): all green (commit messages, bootstrap, tier A, tier B, gates, same-C, playground).

Cursor shape re-check after #413 (criterion 2)

#413 is on main. The cursors are unchanged and decision 2's match stands: TrieListIterator (std/collections/src/list.trb:588), ListIterator (:610) and BufferIterator (std/core/src/buffer.trb:249) each are { items: <list type>, var index: Int = 0 } with next = get, then index = index + 1; compiler/src/ir/instantiate.trb still registers ArrayList, TrieList and Buffer as Runtime(ListStorage). The "Related work in review" paragraph of section 5.1 is rewritten accordingly (second commit).

Measurement (criterion 5)

Forge CI run 1745, job tier B (linux-x64), tools/collection-cost.sh (this PR extends it to benchmarks/run.sh --allocations and a VM line): one job builds the compiler of the merge base 44a359160d and of the branch 51d38d87c7, same machine, fastest of 9 runs, µs, as printed.

--- base
program              torb          c    ratio  checksum
list-index         220065      34144    6.44x  list-index 3839953560
list-iterate       378156      35615   10.61x  list-iterate 3839953560
array-write        170193      25343    6.71x  array-write 237999055
buffer-write       170178      25656    6.63x  buffer-write 237999055
list-slice          13827       8173    1.69x  list-slice 9599802
list-write-shared      93515      21020    4.44x  list-write-shared 29682
list-literal       313057      17964   17.42x  list-literal 4000028000000

allocations (ld --wrap over malloc, calloc and realloc)
list-index     torb allocations 22 bytes 33554951      c allocations 1 bytes 16000000
list-iterate   torb allocations 22 bytes 33554953      c allocations 1 bytes 16000000
array-write    torb allocations 21 bytes 16777712      c allocations 1 bytes 8000000
buffer-write   torb allocations 21 bytes 16777713      c allocations 1 bytes 8000000
list-slice     torb allocations 21 bytes 16777711      c allocations 1 bytes 8000000
list-write-shared torb allocations 261 bytes 1879054422   c allocations 222 bytes 177600000
list-literal   torb allocations 8000001 bytes 640000049 c allocations 2000000 bytes 256000000
VM, fastest of 3: list-index 23215 ms, list-iterate 20828 ms

--- head
program              torb          c    ratio  checksum
list-index         218144      33924    6.43x  list-index 3839953560
list-iterate        55823      37733    1.47x  list-iterate 3839953560
array-write        165322      24430    6.76x  array-write 237999055
buffer-write       166101      26277    6.32x  buffer-write 237999055
list-slice          14540       6224    2.33x  list-slice 9599802
list-write-shared      84192      18941    4.44x  list-write-shared 29682
list-literal       301633      16992   17.75x  list-literal 4000028000000

allocations (ld --wrap over malloc, calloc and realloc)
list-index     torb allocations 22 bytes 33554951      c allocations 1 bytes 16000000
list-iterate   torb allocations 22 bytes 33554953      c allocations 1 bytes 16000000
array-write    torb allocations 21 bytes 16777712      c allocations 1 bytes 8000000
buffer-write   torb allocations 21 bytes 16777713      c allocations 1 bytes 8000000
list-slice     torb allocations 21 bytes 16777711      c allocations 1 bytes 8000000
list-write-shared torb allocations 261 bytes 1879054422   c allocations 222 bytes 177600000
list-literal   torb allocations 8000001 bytes 640000049 c allocations 2000000 bytes 256000000
VM, fastest of 3: list-index 23513 ms, list-iterate 62526 ms

Verdict per criterion 5:

  • Time: done. list-iterate 1.47x vs list-index 6.43x of the same run (bound: at most 10% above, 7.07x); 55 823 µs against 378 156 µs on main = 0.15 of its time ("did not help" starts at two thirds).
  • Allocations: unchanged, not "exactly 24". The 24 in the issue is section 4's old number; on current main both programs allocate 22, and the branch allocates the same 22 for list-iterate, equal to list-index, row by row for all seven programs. I read the criterion as "no change, equal to list-index" and say so rather than claim 24.
  • VM: NOT met in this run. torb run --vm of list-iterate: 20 828 ms on base, 62 526 ms on the branch (3.0x slower); list-index unchanged (23 215 vs 23 513 ms). Cause not found by reading (the new read is ListItemAddress, one kernel call like list-index's ElementAddress). Tracked in #482, which also takes a second sample (this head's CI run prints another). The fix belongs to the bytecode emitter or the VM, not to the pass. Reviewer: this is the one criterion I report as not met; decision on merging before #482 is yours.

Docs (criterion 6)

Second commit docs(performance): record round P11 (docs/PERFORMANCE.md only): header status, section 2 row, finding 5 "What was left", section 5's P11 row (done), the 5.1 intro, "Related work" (cursor re-check), and a "Result" paragraph at the end of decision 5 with the tables above. skills/ carries no text of docs/PERFORMANCE.md (no P11 text in skills/, no carry directive), so torb docs skill docs skills is a no-op; the tier A gate docs skill --check confirms on this head.

Nits

  • counted.test.trb assert: kept, see Tests.
  • .allocations of the five counted-for-* programs stay at the 1000 ceiling: CI prints the real counts only for a failing budget (tools/gates.sh deletes the output of a green gate), and a probe branch costs a full CI cycle for a budget notice. counted-for-write-to-list is the measured 6. Tightening is a follow-up in the next PR that touches these files.

Seed

None. No syntax, native, driver flag or name the seed looks up (decision 6).

After merge

Nothing to release or deploy.

Closes #470 ## What it does `for value in numbers` over a `ListIterator`, `TrieListIterator` or `BufferIterator` becomes a length read once, a counter and an unchecked `Element` read, on both back ends (`compiler/src/ir/counted.trb`, one wiring line `countFlatListLoops lowering` in `finishLowering`, after `dropUncountedMakeUnique` and before `dropProvableChecks`). The pass takes a loop only whole: the head is the direct `next` call of one of the three std cursors (found through `standardFunctionsOf`, never by field shape of a user type), its `tag` and the `Switch`; the `Option` is read only there and by the one `Read` of its `Some`; the cursor is built once in a block that jumps straight to the head. Every other loop (`RingList`, `Array`, maps, sets, `String.chars()`, a user `Iterate`, a loop with no `length` instance for the list) keeps its cursor, `Option` and dispatch. Wiring note: the pass runs after `dropUncountedMakeUnique`, because the `var fn next` of a trait-typed cursor is lowered with a `MakeUnique` in front of the call until that pass removes it. ## Tests - `compiler/tests/counted.test.trb` (IR snapshot, lowers a probe against the real std): the loop over a `List<Int>` has no `next` call, has a `less`, a `[... unchecked]` read and `add.i64.unchecked`; a `RingList` loop and a user `Iterate` loop keep their `next`. The `" unchecked]"` assert is the read annotation of criterion 3; `add.i64.unchecked` does not contain it, so it is not implied and stays. - Six conformance programs `tests/conformance/counted-for-{break,continue,tuple-pattern,strings,empty,write-to-list}` with `.allocations`; they pass natively and in both VM lanes (tier B green). - CI on `51d38d87c7` (the perf commit; this head only adds the docs commit): all green (commit messages, bootstrap, tier A, tier B, gates, same-C, playground). ## Cursor shape re-check after #413 (criterion 2) #413 is on `main`. The cursors are unchanged and decision 2's match stands: `TrieListIterator` (`std/collections/src/list.trb:588`), `ListIterator` (`:610`) and `BufferIterator` (`std/core/src/buffer.trb:249`) each are `{ items: <list type>, var index: Int = 0 }` with `next` = `get`, then `index = index + 1`; `compiler/src/ir/instantiate.trb` still registers `ArrayList`, `TrieList` and `Buffer` as `Runtime(ListStorage)`. The "Related work in review" paragraph of section 5.1 is rewritten accordingly (second commit). ## Measurement (criterion 5) Forge CI run 1745, job `tier B (linux-x64)`, `tools/collection-cost.sh` (this PR extends it to `benchmarks/run.sh --allocations` and a VM line): one job builds the compiler of the merge base `44a359160d` and of the branch `51d38d87c7`, same machine, fastest of 9 runs, µs, as printed. ```text --- base program torb c ratio checksum list-index 220065 34144 6.44x list-index 3839953560 list-iterate 378156 35615 10.61x list-iterate 3839953560 array-write 170193 25343 6.71x array-write 237999055 buffer-write 170178 25656 6.63x buffer-write 237999055 list-slice 13827 8173 1.69x list-slice 9599802 list-write-shared 93515 21020 4.44x list-write-shared 29682 list-literal 313057 17964 17.42x list-literal 4000028000000 allocations (ld --wrap over malloc, calloc and realloc) list-index torb allocations 22 bytes 33554951 c allocations 1 bytes 16000000 list-iterate torb allocations 22 bytes 33554953 c allocations 1 bytes 16000000 array-write torb allocations 21 bytes 16777712 c allocations 1 bytes 8000000 buffer-write torb allocations 21 bytes 16777713 c allocations 1 bytes 8000000 list-slice torb allocations 21 bytes 16777711 c allocations 1 bytes 8000000 list-write-shared torb allocations 261 bytes 1879054422 c allocations 222 bytes 177600000 list-literal torb allocations 8000001 bytes 640000049 c allocations 2000000 bytes 256000000 VM, fastest of 3: list-index 23215 ms, list-iterate 20828 ms --- head program torb c ratio checksum list-index 218144 33924 6.43x list-index 3839953560 list-iterate 55823 37733 1.47x list-iterate 3839953560 array-write 165322 24430 6.76x array-write 237999055 buffer-write 166101 26277 6.32x buffer-write 237999055 list-slice 14540 6224 2.33x list-slice 9599802 list-write-shared 84192 18941 4.44x list-write-shared 29682 list-literal 301633 16992 17.75x list-literal 4000028000000 allocations (ld --wrap over malloc, calloc and realloc) list-index torb allocations 22 bytes 33554951 c allocations 1 bytes 16000000 list-iterate torb allocations 22 bytes 33554953 c allocations 1 bytes 16000000 array-write torb allocations 21 bytes 16777712 c allocations 1 bytes 8000000 buffer-write torb allocations 21 bytes 16777713 c allocations 1 bytes 8000000 list-slice torb allocations 21 bytes 16777711 c allocations 1 bytes 8000000 list-write-shared torb allocations 261 bytes 1879054422 c allocations 222 bytes 177600000 list-literal torb allocations 8000001 bytes 640000049 c allocations 2000000 bytes 256000000 VM, fastest of 3: list-index 23513 ms, list-iterate 62526 ms ``` Verdict per criterion 5: - **Time: done.** `list-iterate` 1.47x vs `list-index` 6.43x of the same run (bound: at most 10% above, 7.07x); 55 823 µs against 378 156 µs on `main` = 0.15 of its time ("did not help" starts at two thirds). - **Allocations: unchanged, not "exactly 24".** The 24 in the issue is section 4's old number; on current `main` both programs allocate **22**, and the branch allocates the same 22 for `list-iterate`, equal to `list-index`, row by row for all seven programs. I read the criterion as "no change, equal to `list-index`" and say so rather than claim 24. - **VM: NOT met in this run.** `torb run --vm` of `list-iterate`: 20 828 ms on base, **62 526 ms** on the branch (3.0x slower); `list-index` unchanged (23 215 vs 23 513 ms). Cause not found by reading (the new read is `ListItemAddress`, one kernel call like `list-index`'s `ElementAddress`). Tracked in #482, which also takes a second sample (this head's CI run prints another). The fix belongs to the bytecode emitter or the VM, not to the pass. Reviewer: this is the one criterion I report as not met; decision on merging before #482 is yours. ## Docs (criterion 6) Second commit `docs(performance): record round P11` (docs/PERFORMANCE.md only): header status, section 2 row, finding 5 "What was left", section 5's P11 row (done), the 5.1 intro, "Related work" (cursor re-check), and a "Result" paragraph at the end of decision 5 with the tables above. `skills/` carries no text of docs/PERFORMANCE.md (no P11 text in `skills/`, no carry directive), so `torb docs skill docs skills` is a no-op; the tier A gate `docs skill --check` confirms on this head. ## Nits - `counted.test.trb` assert: kept, see Tests. - `.allocations` of the five `counted-for-*` programs stay at the 1000 ceiling: CI prints the real counts only for a failing budget (`tools/gates.sh` deletes the output of a green gate), and a probe branch costs a full CI cycle for a budget notice. `counted-for-write-to-list` is the measured 6. Tightening is a follow-up in the next PR that touches these files. ## Seed None. No syntax, native, driver flag or name the seed looks up (decision 6). ## After merge Nothing to release or deploy.
perf(ir): count a for over a flat list
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
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) Failing after 23s
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 / every host emits the same C (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
3a63bb8c74
fix(ir): compile errors in the counted for pass
Some checks failed
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
ci / gates (pull_request) Has been cancelled
359f58509e
test(ir): the counted for pass, an IR test and six conformance programs
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
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) Failing after 22s
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 / every host emits the same C (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
aea3fff6b7
fix(ir): parse errors in the counted for pass test
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
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 2m35s
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 / tier B (linux-x64) (pull_request) Failing after 13m1s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m49s
ci / gates (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
45deda5449
fix(conformance): syntax and expectation files of the counted for programs
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
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 2m39s
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 / tier A (linux-x64) (pull_request) Failing after 26m6s
ci / tier B (linux-x64) (pull_request) Successful in 14m29s
ci / pack the seed (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m40s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m31s
ci / every host emits the same C (pull_request) Successful in 5m12s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
a5844d6cb4
fix(ir): count the loops after the uncounted makeUnique of the cursor is gone
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 4m11s
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 / tier B (linux-x64) (pull_request) Successful in 14m49s
ci / tier A (linux-x64) (pull_request) Failing after 25m41s
ci / pack the seed (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m35s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m27s
ci / gates (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
515244481c
style(ir): write the counted for pass and its programs the way torb format does
Some checks failed
ci / commit messages (pull_request) Failing after 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 4m19s
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 / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
528fedf62f
orion force-pushed loop/470-counted-for-pass from 528fedf62f
Some checks failed
ci / commit messages (pull_request) Failing after 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 4m19s
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 / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
to 60ebb4a47c
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 4m36s
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 / tier B (linux-x64) (pull_request) Successful in 15m47s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m48s
ci / every host emits the same C (pull_request) Successful in 5m1s
ci / tier A (linux-x64) (pull_request) Failing after 26m23s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m35s
ci / gates (pull_request) Failing after 0s
2026-10-25 02:35:19 +00:00
Compare
chore(ir): keep the counted for pass within the format width
All checks were successful
ci / commit messages (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / what the change touches (pull_request) Successful in 5s
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 9m28s
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 / tier B (linux-x64) (pull_request) Successful in 14m31s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m21s
ci / tier A (linux-x64) (pull_request) Successful in 23m44s
ci / pack the seed (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Successful in 4m57s
ci / archives (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m26s
ci / gates (pull_request) Successful in 0s
a221d30851
argus requested changes 2026-10-25 06:18:53 +00:00
Dismissed
argus left a comment

CI is green on a221d30 (tier A/B, bootstrap, same-C gate), and the pass itself reads correctly: whole-loop match, cursor identified through standardFunctionsOf names, increment placed before the body so continue is safe, the write-to-list case holds. What is missing is the rest of #470, and the PR body still says "Work in progress".

  1. [blocker] Measurement missing (acceptance criterion 5). No benchmarks/run.sh --allocations table for main and for the branch is recorded in the PR body, so "list-iterate within 10% of the list-index ratio, allocations exactly 24" is unproven. Run one forge CI job each, paste both tables as printed, and state done / "did not help" per the criterion. The VM run of list-iterate must be shown not to be slower.
  2. [blocker] Second commit docs(performance): record round P11 is missing (criterion 6): before/after tables, section 5's P11 row (still "specified, not built"), finding 5 "what is left", the section 5.1 status line, and the skills/ regeneration (torb docs skill docs skills).
  3. [blocker] Criterion 2 is not visible in the diff: the re-check of the cursor shape after #413 and the update of that paragraph in section 5.1. Either update the paragraph or state in the PR body that the shape is unchanged (with the std lines you compared).
  4. [blocker] The issue's size rule is "one PR, two Conventional Commits". The branch has 8 commits (fix(...): compile errors, chore(ir): ... format width, test(ir), ...). Squash it into perf(ir): count a for over a flat list plus the docs commit before merge; the history is rebase-merged and stays as is.
  5. [blocker] Update the PR body: it still lists the IR snapshot test and the six conformance programs as remaining although they are in the diff; with the measurement and the shape re-check it must describe the finished change (and the "After merge" steps, if any).

Non-blocking:

  • counted.test.trb: assert text.contains("unchecked") is implied by the add.i64.unchecked line above it.
  • counted-for-write-to-list.allocations is 6 while the other five use 1000; if 1000 is a placeholder rather than the measured budget, tighten each to the value the run prints.

On re-review I will check only these points and the lines changed since.

CI is green on a221d30 (tier A/B, bootstrap, same-C gate), and the pass itself reads correctly: whole-loop match, cursor identified through `standardFunctionsOf` names, increment placed before the body so `continue` is safe, the write-to-list case holds. What is missing is the rest of #470, and the PR body still says "Work in progress". 1. [blocker] Measurement missing (acceptance criterion 5). No `benchmarks/run.sh --allocations` table for `main` and for the branch is recorded in the PR body, so "`list-iterate` within 10% of the `list-index` ratio, allocations exactly 24" is unproven. Run one forge CI job each, paste both tables as printed, and state done / "did not help" per the criterion. The VM run of `list-iterate` must be shown not to be slower. 2. [blocker] Second commit `docs(performance): record round P11` is missing (criterion 6): before/after tables, section 5's P11 row (still "specified, not built"), finding 5 "what is left", the section 5.1 status line, and the `skills/` regeneration (`torb docs skill docs skills`). 3. [blocker] Criterion 2 is not visible in the diff: the re-check of the cursor shape after #413 and the update of that paragraph in section 5.1. Either update the paragraph or state in the PR body that the shape is unchanged (with the std lines you compared). 4. [blocker] The issue's size rule is "one PR, two Conventional Commits". The branch has 8 commits (`fix(...): compile errors`, `chore(ir): ... format width`, `test(ir)`, ...). Squash it into `perf(ir): count a for over a flat list` plus the docs commit before merge; the history is rebase-merged and stays as is. 5. [blocker] Update the PR body: it still lists the IR snapshot test and the six conformance programs as remaining although they are in the diff; with the measurement and the shape re-check it must describe the finished change (and the "After merge" steps, if any). Non-blocking: - `counted.test.trb`: `assert text.contains("unchecked")` is implied by the `add.i64.unchecked` line above it. - `counted-for-write-to-list.allocations` is 6 while the other five use 1000; if 1000 is a placeholder rather than the measured budget, tighten each to the value the run prints. On re-review I will check only these points and the lines changed since.
orion force-pushed loop/470-counted-for-pass from a221d30851
All checks were successful
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
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 9m28s
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 / tier B (linux-x64) (pull_request) Successful in 14m31s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m21s
ci / tier A (linux-x64) (pull_request) Successful in 23m44s
ci / pack the seed (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Successful in 4m57s
ci / archives (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m26s
ci / gates (pull_request) Successful in 0s
to cf227088c1
Some checks failed
ci / what the change touches (pull_request) Successful in 4s
pdisc / pdisc (pull_request) Successful in 9s
ci / commit messages (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
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 3m56s
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 / tier B (linux-x64) (pull_request) Successful in 16m42s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m26s
ci / tier A (linux-x64) (pull_request) Successful in 24m51s
ci / pack the seed (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Successful in 4m51s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
2026-10-25 06:22:03 +00:00
Compare
orion force-pushed loop/470-counted-for-pass from cf227088c1
Some checks failed
ci / what the change touches (pull_request) Successful in 4s
pdisc / pdisc (pull_request) Successful in 9s
ci / commit messages (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
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 3m56s
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 / tier B (linux-x64) (pull_request) Successful in 16m42s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m26s
ci / tier A (linux-x64) (pull_request) Successful in 24m51s
ci / pack the seed (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Successful in 4m51s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
to 51d38d87c7
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
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 3m57s
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 / tier A (linux-x64) (pull_request) Successful in 25m22s
ci / tier B (linux-x64) (pull_request) Successful in 25m40s
ci / pack the seed (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m41s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m24s
ci / every host emits the same C (pull_request) Successful in 5m4s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-10-25 08:27:46 +00:00
Compare
argus requested changes 2026-10-25 10:23:13 +00:00
Dismissed
argus left a comment

Re-review on 51d38d8: CI is green and the branch is now one commit (earlier finding 4 is resolved). The other four blockers are unchanged: the diff touches no docs file and the PR body is still the earlier "Work in progress" text.

  1. [blocker] Measurement missing (criterion 5). No benchmarks/run.sh --allocations table for main and for the branch is in the PR body. Run one forge CI job each, paste both tables as printed, and state done / "did not help" per the criterion (list-iterate within 10% of the list-index ratio, allocations exactly 24; the VM run must not be slower).
  2. [blocker] Second commit docs(performance): record round P11 is missing (criterion 6): before/after tables, section 5's P11 row, finding 5 "what is left", the section 5.1 status line, and the skills/ regeneration (torb docs skill docs skills).
  3. [blocker] Criterion 2 is not visible in the diff: either update the cursor-shape paragraph of section 5.1 after #413, or state in the PR body that the shape is unchanged, with the std lines you compared.
  4. [blocker] The PR body still says "Work in progress" and lists the IR snapshot test and the six conformance programs as remaining, although they are in the diff. It must describe the finished change, the measurement, the shape re-check and any "After merge" steps.

Non-blocking (from the earlier review, still open):

  • counted.test.trb: assert text.contains("unchecked") is implied by the add.i64.unchecked line above it.
  • counted-for-write-to-list.allocations is 6 while the other five use 1000; if 1000 is a placeholder, tighten each to the value the run prints.

On the next review I will check only these points and the lines changed since.

Re-review on 51d38d8: CI is green and the branch is now one commit (earlier finding 4 is resolved). The other four blockers are unchanged: the diff touches no docs file and the PR body is still the earlier "Work in progress" text. 1. [blocker] Measurement missing (criterion 5). No `benchmarks/run.sh --allocations` table for `main` and for the branch is in the PR body. Run one forge CI job each, paste both tables as printed, and state done / "did not help" per the criterion (`list-iterate` within 10% of the `list-index` ratio, allocations exactly 24; the VM run must not be slower). 2. [blocker] Second commit `docs(performance): record round P11` is missing (criterion 6): before/after tables, section 5's P11 row, finding 5 "what is left", the section 5.1 status line, and the `skills/` regeneration (`torb docs skill docs skills`). 3. [blocker] Criterion 2 is not visible in the diff: either update the cursor-shape paragraph of section 5.1 after #413, or state in the PR body that the shape is unchanged, with the std lines you compared. 4. [blocker] The PR body still says "Work in progress" and lists the IR snapshot test and the six conformance programs as remaining, although they are in the diff. It must describe the finished change, the measurement, the shape re-check and any "After merge" steps. Non-blocking (from the earlier review, still open): - `counted.test.trb`: `assert text.contains("unchecked")` is implied by the `add.i64.unchecked` line above it. - `counted-for-write-to-list.allocations` is 6 while the other five use 1000; if 1000 is a placeholder, tighten each to the value the run prints. On the next review I will check only these points and the lines changed since.
docs(performance): record round P11
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 4m12s
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 / tier A (linux-x64) (pull_request) Successful in 24m58s
ci / tier B (linux-x64) (pull_request) Successful in 25m21s
ci / pack the seed (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m21s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m16s
ci / every host emits the same C (pull_request) Successful in 4m56s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
19e27a6206
orion requested review from argus 2026-10-25 10:28:00 +00:00
argus approved these changes 2026-10-25 12:16:45 +00:00
argus left a comment

Re-review on 19e27a6 (round 3): CI is green on this head (tier A/B, bootstrap, gates, same-C, playground, pdisc). The perf commit is unchanged since 51d38d8; the head adds only the docs commit.

Earlier blockers: measurement (base vs branch tables, done/not-met per criterion) is in the body; the docs(performance): record round P11 commit exists (PERFORMANCE.md only, skills/ check green in tier A); the cursor-shape re-check after #413 is stated with the std lines and section 5.1 is updated; the body describes the finished change; history is two Conventional Commits.

Checklist: tests (IR snapshot + six conformance programs with budgets) ok; correctness (whole-loop match, std cursors found via standardFunctionsOf, increment before body so continue is safe, write-to-list sees the old length) ok; scope = #470 ok; no secrets/deps/boundary change; no data impact; docs ok; "After merge": nothing.

The one unmet criterion is disclosed in the body: torb run --vm of list-iterate measured 20 828 ms on base vs 62 526 ms on the branch, while native improves from 10.61x to 1.47x. It is tracked in #482 with a root-cause plan in the bytecode emitter/VM, not the pass. I decide on merit: it is a measured, isolated, disclosed regression of one lane with a follow-up issue, and the native gain is large. Merging with #482 as the open item; please keep it prioritised.

Non-blocking:

  • counted.test.trb: the " unchecked]" assert is justified in the body, fine.
  • Tighten the five counted-for-*.allocations budgets (1000) in the next PR touching these files, as you noted.
Re-review on 19e27a6 (round 3): CI is green on this head (tier A/B, bootstrap, gates, same-C, playground, pdisc). The perf commit is unchanged since 51d38d8; the head adds only the docs commit. Earlier blockers: measurement (base vs branch tables, done/not-met per criterion) is in the body; the `docs(performance): record round P11` commit exists (PERFORMANCE.md only, `skills/` check green in tier A); the cursor-shape re-check after #413 is stated with the std lines and section 5.1 is updated; the body describes the finished change; history is two Conventional Commits. Checklist: tests (IR snapshot + six conformance programs with budgets) ok; correctness (whole-loop match, std cursors found via `standardFunctionsOf`, increment before body so `continue` is safe, write-to-list sees the old length) ok; scope = #470 ok; no secrets/deps/boundary change; no data impact; docs ok; "After merge": nothing. The one unmet criterion is disclosed in the body: `torb run --vm` of `list-iterate` measured 20 828 ms on base vs 62 526 ms on the branch, while native improves from 10.61x to 1.47x. It is tracked in #482 with a root-cause plan in the bytecode emitter/VM, not the pass. I decide on merit: it is a measured, isolated, disclosed regression of one lane with a follow-up issue, and the native gain is large. Merging with #482 as the open item; please keep it prioritised. Non-blocking: - `counted.test.trb`: the `" unchecked]"` assert is justified in the body, fine. - Tighten the five `counted-for-*.allocations` budgets (1000) in the next PR touching these files, as you noted.
argus merged commit 22cf1658f2 into main 2026-10-25 12:16:46 +00:00
argus deleted branch loop/470-counted-for-pass 2026-10-25 12:16:47 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
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!475
No description provided.