perf: P11 step 2 - the counted for pass over a flat list (step 2 of #58) #470
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Step 2 of #58 (perf: P11 - a
forover a concrete list is a counted loop; PERFORMANCE.md finding F5 level 2). Step 1 (#415) landed the specification asdocs/PERFORMANCE.mdsection 5.1 "What P11 builds"; that record is the specification of this issue and decisions 1 to 6 there are not reopened.Goal
Build the pass:
for value in numbersover a cursor of the flat runtime list becomes a length read once, a counter and an uncheckedElementread, on both back ends, andbenchmarks/list-iterateis measured before and after in forge CI.Acceptance criteria
compiler/src/ir/counted.trbwith one wiring line infinishLowering(ir/lower/lower.trb), betweenrewriteElementPlacesanddropProvableChecks(decision 1). It accepts only aRecordcursor of std'sListIterator,TrieListIteratororBufferIteratorwhosenextis that type's ownnext(found throughstandardFunctionsOf, never by field shape of a user type), and only a loop it recognises whole (decisions 2 and 3). Any other loop keeps its cursor,Optionand dispatch.std/collectionsandstd/coreonmain, adjust decision 2's match if it changed, and update that paragraph of section 5.1.compiler/tests/: the loop oflist-iteratehas nonextcall, aless, a[... unchecked]read and an unchecked add; aRingListloop and a userIterateloop keep theirnext.tests/conformance/, each with its.allocationsbudget:break,continue, a tuple pattern, a counted item (List<String>), an empty list, a write to the original list inside the body (the loop sees the old length). They pass natively and withtools/conformance.sh --vm.benchmarks/run.sh --allocationsonce onmainand once on the branch, one job each, both tables recorded in the PR body as printed. Done =list-iterateratio at most 10% above thelist-indexratio of the same run and allocations exactly 24 (decision 5); "it did not help" = time above two thirds ofmain's in the same run or allocations not 24, then the PR reads the generated C (length hoisted? retain left in the loop?) and says so.torb runoflist-iterate(VM) must not get slower.docs(performance): record round P11: before and after tables, section 5's P11 row, finding 5 "what is left", section 5.1 status line.tools/gates.sh aandbgreen in forge CI; docs changes regenerateskills/(torb docs skill docs skills).Design record point
PERFORMANCE.md section 5.1 decisions 1 to 6, finding F5 level 2, round P11.
Seed impact
None expected (decision 6: no syntax, no native, no driver flag, no name the seed looks up). If the pass turns out to need one, stop and record it in the PR; the two-commit rule then applies.
Size
One PR, two Conventional Commits:
perf(ir): count a for over a flat listanddocs(performance): record round P11. If it grows, cut by cursor as section 5.1 says: first commit withListIteratoralone,TrieListIteratorandBufferIteratoras a PR of their own.Dependencies
Step 1 (#415, landed). Shares the
forlowering with #468 (collection names declared in std, in progress): whichever lands second rebases onto the other. Rebase order: #468 first (it only changes name resolution and keeps the inline iterator contract), then this step re-reads the cursor's shape; not a blocker for either.Out of scope
RingList,Array, maps, sets,String.chars(), userIterate; the bounds check ofa[index](finding 8); #56, #59; the seed.forover a concrete list is a counted loop #58forover a concrete list is a counted loop #58forover a concrete list is a counted loop #58[loop:torbscript] claim implement by session:loop-torbscript-20261024-1000 until 2026-10-24T14:10:28Z
[loop:torbscript] implement: checkpoint, research only, no code written yet (worker context guard at ~91k tokens, ~0.1M tokens used). next: implement continues in a fresh worker.
State
/home/node/workspaces/orion/code/wt/torbscript-language-470-counted-for-pass, branchloop/470-counted-for-passfrommain@57085dce. Nothing committed, nothing pushed, nothing to lose.docs/PERFORMANCE.mdF5 and section 5.1 (the specification),CLAUDE.md,compiler/CONTRIBUTING.md,ir/lower/lower.trb(finishLowering),ir/bounds.trb, the IR types inir/ir.trb.Findings for the next worker
finishLoweringincompiler/src/ir/lower/lower.trb, betweenrewriteElementPlaces lowering.programandrewriteMapPlaces/dropProvableChecks. Spec says "betweenrewriteElementPlacesanddropProvableChecks";rewriteMapPlacesanddropUncountedMakeUniquesit between them today, so put the call right afterrewriteElementPlaces(or afterdropUncountedMakeUnique, which clears the cursor'smakeUnique; check which one leaves the loop head in the shape decision 3 wants by readingtorb iroutput in CI).provenReadinir/bounds.trbbuildsInstruction.Read target, Reference(list, [PathStep.Element(item, index, at, checked: false)]);listItemOfgets the item type fromIrType.Runtime(RuntimeKind.ListStorage, [item]). Intrinsics:Intrinsic(operation: .Less/.Add, kind: .Signed(width: 64), checked: false);Instruction.Intrinsic(target, intrinsic, [slots], at). TerminatorsBranch(condition, then, else)/Switch(scrutinee, values, targets, else). Helpers:successorsOf,definedSlotfromir/verify.trb;standardFunctionsOf loweringfor finding std functions (listMembersOfinir/lower/collection.trbis the model for recognisingat/length).ir/lower/statement.trb(lowerForIterate, line ~600); read it for the exact head shape (call next,tag,switch, theReadof theSomepayload).torbbinary and nobuild/in the worktree or on this host; there is no way to try the pass locally, so write it carefully and let forge CI (ci-wait.sh) be the compiler. Reuse test scaffolding fromcompiler/tests/devirtualize.test.trb,ir-elements.test.trb,lower-harness.trbfor the IR snapshot.Skill torbscriptis not loadable by name from the subagent; the repo's skills are underskills/torbscript*and.claude/skills/. Readskills/torbscript-language/before writing any.trb.ir/counted.trb+ wiring; re-check cursor shape after #413 (std/collections,std/core) and update the paragraph in 5.1; IR snapshot test; six conformance programs with.allocations; CI measurement (benchmarks/run.sh --allocationsonmainand the branch); second commitdocs(performance): record round P11andtorb docs skill docs skills.CONTINUE: torbscript/language#470
[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T04:00:00Z
[loop:torbscript] implement: checkpoint, research only, no code written yet (worker context guard at ~81k tokens, ~0.1M tokens used). next: implement continues in a fresh worker.
State
ws wt new torbscript/language 470 counted-for-pass --branch loop/470-counted-for-pass->/home/node/workspaces/orion/code/wt/torbscript-language-470-counted-for-pass, fromorigin/main. Nothing committed, nothing pushed, no remote branch yet.Findings (do not re-read these; go straight to writing
compiler/src/ir/counted.trb)mainis unchanged by #413:ListIterator(std/collections/src/list.trb:610),TrieListIterator(:588),BufferIterator(std/core/src/buffer.trb:243) are all{ items: <List type>, var index: Int = 0 }withnext=get,index = index + 1. Field 0 isitems, field 1 isindex. Decision 2 of section 5.1 needs no change to its match; only the "re-read" sentence in the issue is satisfied.lowerForIterate(ir/lower/statement.trb:600) emits:checkblock:call next(&cursor)->pulled,Tag(tag, pulled),Switch(tag, [some], [inner], done);innerblock:Read(value, Reference(pulled, [Variant(layout, some, 0)])), then the body (scope opened,continuejumps tocheck,breaktodone). The pass must recognise exactly that, withCall.calleebeing the directnextinstance of one of the three types afterdevirtualizeProgram.ir/ir.trb):Instruction.Intrinsic(target, Intrinsic(operation: .Less/.Add, kind: .Signed(width: 64), checked: false), [slots], at),Instruction.Read(target, Reference(list, [PathStep.Element(item, index, at, checked: false)])),Terminator.Branch(cond, then, else); template inir/bounds.trb(provenRead,dropListBoundsChecks).Block.instructions/terminatorare mutable; slots arefunction.slots(SlotDeclaration(type, role, name)), no builder after lowering, so append slots by hand. Item type:IrType.Runtime(RuntimeKind.ListStorage, [item])->item.FunctionIdfor thelengthof that list type to hoist the length read.lengthandgetarenative fnofArrayList/TrieList(std list.trb:647/771), so an instance exists only when something calls or tables it. For anumbers: List<Int>subject a witness table ofList<Int>holdslength(find viaprogram.witnessTables[..].members, asboxedListSlotsOfinir/lower/lower.trb:321does forat/set/update); for a concreteArrayList<Int>subject it may not exist. Recommended: look the instance up likelistMembersOf(lower/lower.trb:274: std function namedlength, one parameter, first parameterRuntime(ListStorage, ...)of the same IR type) and refuse the loop when there is none; then check in CI which of the benchmark's shape gets counted. If the benchmark misses, fall back to making the threenextbodies callitems.length()(guarantees the instance) or request the instance withinstanceForfrom the pass.finishLowering(ir/lower/lower.trb:173) order today isdevirtualizeProgram,rewriteElementPlaces,rewriteMapPlaces,dropUncountedMakeUnique,dropProvableChecks. PutcountedLoops lowering.program, <std-flags/length lookup>right afterrewriteElementPlaces(spec) unlessdropUncountedMakeUniquemust come first for the cursor record; theMakeUniqueguarding writes to the original list in the body is unaffected (the cursor still holds the list by value).compiler/tests/ir-elements.test.trbbuilds IR by hand (newFunction,addSlot,emit,terminate,finishFunctionfromir/build;verifyProgram;printFunction);devirtualize.test.trbandlower-harness.trblower real source and print IR. The benchmark isbenchmarks/list-iterate.trb(single file, not a directory);benchmarks/run.sh --allocations.ir/elements.trb(peephole model for rewriting blocks),ir/verify.trbhelperssuccessorsOf/definedSlot,tests/conformance/conventions and.allocationsformat,docs/PERFORMANCE.mdsection 5 P11 row text.Next worker, in this order: (1) write
ir/counted.trb+ wiring line, commit and push as WIP; (2) IR snapshot test; (3) six conformance programs with.allocations; (4) open PR (Closes #470),ci-wait.sh; (5) measurement jobs and the docs commit.CONTINUE: torbscript/language#470
[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T04:15:00Z
[loop:torbscript] implement: checkpoint, first code pushed (context guard at ~95k tokens, ~0.2M tokens used). next: implement continues in a fresh worker.
Done
loop/470-counted-for-passpushed with commitperf(ir): count a for over a flat list: newcompiler/src/ir/counted.trb(countedLoops) and the wiringcountFlatListLoops loweringright afterrewriteElementPlacesinfinishLowering(ir/lower/lower.trb). Never compiled: no local torb binary, so forge CI is the compiler.call next(&cursor),tag,Switch; inner block starts with theReadofSome;Option, tag and cursor mentioned only there (3/2/2 mentions); the cursor's single definition sits in a block that jumps straight to the head. Preheader appendsRead items,call length, two constants; head becomesless+Branch; inner gets the uncheckedElementread plus the unchecked add.lengthis found likelistMembersOf(instance with the list type as its only parameter) and the loop is refused when none exists.Next worker
Closes #470, base main, headloop/470-counted-for-pass); runci-wait.shand fix compile errors on the same branch (suspect spots:returninsidematcharms,program.layoutAt/typeAtuse,SlotDeclaration(type:, role:)construction,internStaticimport in lower.trb, alengthinstance missing forArrayList<Int>: then make thenextbodies callitems.length()or request the instance)..allocations, CI measurement (benchmarks/run.sh --allocationsonmainand the branch), second commitdocs(performance): record round P11,torb docs skill docs skills.CONTINUE: torbscript/language#470
[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T05:15:00Z (continuation 3 of 3, fresh worker after checkpoint 6204)
[loop:torbscript] implement (checkpoint, cont 3): PR #475 is open (Closes #470, branch loop/470-counted-for-pass, head
aea3fff6), next: implement (CI fix rounds), not yet a review.Done this round
3a63bb8c(bootstrap linux-x64, step 1, the seed compiling the compiler) found 5 errors incompiler/src/ir/counted.trb:??chain overLocationId?,typeused as a parameter name,SlotDeclarationneeds(type, role, name)positionally. Fixed in359f5850(nested matches forat,addSlot(annotation),SlotDeclaration(annotation, SlotRole.Temporary, "")). Whether the file compiles now is NOT known: the CI run of that sha never started.aea3fff6:compiler/tests/counted.test.trb(lowers a probe file against the real std throughreadSourceTree([root]).withFile(...); asserts: List loop has nonext, haslessandadd.i64.unchecked; RingList and a userIterateloop keepnext) and six conformance programstests/conformance/counted-for-{break,continue,tuple-pattern,strings,empty,write-to-list}with.expected/.exitwritten by hand (not from a run) and placeholder.allocationsof 1000.State
aea3fff6: all jobspending(only commit messages / gates / what-the-change-touches queued, bootstrap not started), the runner queue was busy for 30+ minutes (probably #468 PR #474 in parallel).withFileon an unlisted path is not accepted bycheck, or intrinsic print names differ fromless/add.i64.unchecked; (2) conformance.expectedvalues (14, 16,abbccc/6,x-yy-zzz-, 0, 3/6) are computed by hand; (3).allocationsmust be set to the printed counts (sh tools/conformance.sh --filter counted-for --update-budgetsequivalent in CI output); (4) open risk from before: the pass refuses a loop when nolengthinstance exists for the list type: if the IR test showsnextinprobelist, make thenextbodies in std callitems.length().Next (in order)
bash /opt/openclaw/skills/dev-workflow/scripts/ci-wait.sh -C code/wt/torbscript-language-470-counted-for-passonaea3fff6(push needs-c http.extraHeader="Authorization: Basic <base64 orion:token>"), fix compile/test errors on the branch..allocationsto the real counts.benchmarks/run.sh --allocationson main and on the branch (ratio list-iterate <= 1.10 x list-index, allocations exactly 24), tables into the PR body.docs(performance): record round P11+torb docs skill docs skillsregen; squash myfix(ir)commit into the first before review.[loop:torbscript] release implement: continuation cap reached (3 of 3), worker result collected (checkpoint #470 (comment)), next: waiting (CI running on PR #475 head
aea3fff6; runners busy with861b495b).When CI finishes on
aea3fff6:compiler/src/ir/counted.trb(fixed in359f5850) are gone..allocationscounts (currently placeholder 1000) and check the hand-computed.expected/.exitfiles against the run. Then do the P11 docs commit, theskills/regeneration, and squash thefix(ir)commit. After that, hand over to review.nextin theList<Int>loop, the stdnextbodies must callitems.length().[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T05:00:00Z (CI fix round: bootstrap linux-x64 red)
[loop:torbscript] implement (checkpoint, cont 4): CI fix round done for bootstrap, tier A/B still queued, next: implement (waiting on the CI of
45deda54, then conformance budgets and docs).Done this round
bootstrap (linux-x64)onaea3fff6, step 1:compiler/src/ir/counted.trbnow compiles (the earlier 5 errors are gone); the 20 errors were all incompiler/tests/counted.test.trb: a method call without parentheses insideif/assert(function.name.contains marker,assert text.contains "x") andassert !expr.45deda54(fix(ir): parse errors in the counted for pass test):contains(...)with parentheses,assert(...)form (as other tests do), dropped the unusedverifyProgramimport. Pushed to loop/470-counted-for-pass.45deda54(run 1675):bootstrap (linux-x64)is GREEN (so the test file now compiles too), commit messages / touches / runners green. tier A, tier B, gates, release-sync, same-C, playground, pack/archives are still pending in the runner queue (slow).State
45deda54, worktree code/wt/torbscript-language-470-counted-for-pass, clean and pushed.counted.test.trbassertions and the sixcounted-for-*conformance programs (hand-written.expected/.exit, placeholder.allocations1000) pass.Next (in order)
bash /opt/openclaw/skills/dev-workflow/scripts/ci-wait.sh -C code/wt/torbscript-language-470-counted-for-pass --timeout 3000on45deda54(run in background with output to a file); fix test/conformance failures..allocationsto the real counts from the CI output, verify.expected/.exit.docs(performance): record round P11(+torb docs skill docs skillsregeneration); squashfix(ir)commits intoperf(ir)/test(ir);tools/check-commits.sh; rebase on current main (it moved by ~30 commits; #474 may land first).[loop:torbscript] release implement: CI fix round collected (checkpoint #470 (comment)),
bootstrap (linux-x64)green on45deda54; tier A/B, gates, release-sync, same-C, playground, pack/archives still pending. On CI result: red -> fix round (fresh worker from 6257); green -> real.allocationscounts, verify.expected/.exit, benchmark ratios into PR #475 body, P11 docs commit +skills/regen, squash fixups, rebase on main. next: waiting (CI running on PR #475 head45deda54)[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T07:00:00Z (CI fix round: tier B red on
45deda54)[loop:torbscript] implement (checkpoint, cont 5): tier B red on
45deda54diagnosed and fixed ina5844d6c, next: implement (waiting on the CI ofa5844d6c, then budgets, measurement, docs).Done this round
45deda54) failed only on the sixcounted-for-*conformance programs, in all three lanes (native, VM, VM lowered for the debugger); every other program, the runtime tests,tests/languageand the compiler test (counted.test.trb, so the IR assertions) passed. Causes, all in my hand-written files, never run before:name [list literal]is always indexing (needsf([...])) in five programs;print turns none(needsprint(turns(none))); and the.expectedfiles held the literal text$14\nfrom a badecho, not output with real newlines.a5844d6cfix(conformance): syntax and expectation files of the counted for programs(pushed): call forms in parentheses,.expectedrewritten with real newlines (14,16,0,x-yy-zzz-,abbccc/6,3/6),counted-for-write-to-list.allocations= 6 (the CI count). The write-to-list program already ran and printed3,6correctly, so its output matches the expectation.State
a5844d6c, worktree code/wt/torbscript-language-470-counted-for-pass, clean and pushed. CI ofa5844d6cjust started (commit messages, touches, gates pending)..allocationsare still the placeholder 1000: CI printsallocated N blocks, under its budget of 1000 by Xfor them under "allocation budgets that can be lowered" once they build and run. Placeholder passes, it is only a notice.Next (in order)
a5844d6c(ci-wait.sh -C <worktree> --timeout 3300 > file, then read the file; the exec yield does not hold, wait with onewhile pgrep ... sleepexec orprocess poll). Red -> read the failed conformance output (job logs viaGET /api/v1/repos/torbscript/language/actions/jobs/<job id>/logs, job id fromactions/runs/<run>/jobs; plain ci-wait only prints the tail)..allocationsto the printed counts (and any real failure of the five new programs:.expectedand.exitwere hand-computed).benchmarks/run.sh --allocationsruns in no CI job today. Precedent:tools/map-cost.sh(builds the merge-base compiler with the checkout'storb, runsbenchmarks/run.sh <programs>with both, a measurement not a gate, exit 0) plus its step in.forgejo/workflows/gates.yml(tier B, aftermap-cost.sh). Addtools/list-cost.shthe same way forlist-iterate list-indexwith--allocations(touched-files guard oncompiler/src/ir/counted.trb,ir/lower/lower.trb,benchmarks/list-iterate.trb) and the same step in gates.yml. Commit asci(...)/test(...), folded into the PR; the tables come out in the tier B log. Done =list-iterateratio <= 1.10 xlist-indexratio of the same run, allocations 24; VMtorb runof list-iterate not slower.docs(performance): record round P11(section 5 P11 row, finding 5 "what is left", 5.1 status line, before/after tables as printed),torb docs skill docs skillsregeneration (CI-only, no local torb: ifskills/must be regenerated, do it from a CI artifact or ask the tick), squashfix(...)commits into theperf(ir)commit,sh tools/check-commits.sh(the file is not executable: run withsh), rebase on main (was ~30 commits ahead; #474 may land first), PR body tables, then commentnext: review.[loop:torbscript] release implement: tier B fix round collected (checkpoint above),
a5844d6cpushed (six counted-for conformance programs corrected), next: waiting (CI running on PR #475 heada5844d6c). On result: red -> fix round from the checkpoint; green -> lower the five.allocations, add thetools/list-cost.shmeasurement step, P11 docs commit, squash, rebase, review.[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T08:00:00Z (CI fix round: tier A and gates red on
a5844d6c, run 1680)[loop:torbscript] release implement (checkpoint, context guard): CI fix round diagnosed, nothing pushed yet, head
a5844d6c, next: implement (fix worker continues; PR 475 CI red).Done this round
GET /actions/runs?head_sha=<sha>), jobs viaGET /actions/runs/1726/jobs, log viaGET /actions/jobs/<job id>/logs(tier A job 19452 works; thegatesjob 19449 log is empty in dbfs, but it runs the same gates.sh, so the same two red gates).test compiler/tests (native): 3083 passed, 1 failed -compiler/tests/counted.test.trb:118"a loop over a List has no call of next ...": the pass did NOT fire onprobelist; the final IR still has%4 = call ListIterator_next__Int64(&%2 borrowed),tag,switch,%3 = read %4.Some.value,%2 = call ArrayList_iterate__Int64_$direct(%0 owned last)in b0 (jump b1). The two negative tests (RingList, user Iterate) pass.format --check: 8 of 1458 files would change: compiler/src/ir/counted.trb, compiler/tests/counted.test.trb, tests/conformance/counted-for-{break,continue,empty,strings,tuple-pattern,write-to-list}.trb. Needs the formatter's exact output (no local torb): derive from the rules in the repo's formatter or from a CI artifact.Already checked by reading (not the cause): mention counts (pulled 3, tag 2, cursor 2:
slotsOfArgumentsuses place.base once), head shape (2 instructions + Switch), Variant step shape, listItemOf same as bounds.trb.Not yet checked (candidates for why the pass bails): (a)
nexts:function.originof the instantiatedListIterator.nextmay be None, orsymbolPathOf(...).ownersis not exactly["ListIterator"](awith Iterator<Item>member could carry the trait); (b)lengths: nolengthfunction withparameters[0].type == listType(listType = type ofListIterator.items); (c)fields.length() != 2; (d)item != typeOfSlot(value). Quickest probe: temporarily make each earlyreturn Nonedistinguishable is impossible without torb, so readstd/collections/src/list.trbArrayList.lengthandLowering.originsetting for generic instances.State: branch loop/470-counted-for-pass at
a5844d6c, worktree code/wt/torbscript-language-470-counted-for-pass clean, nothing uncommitted.[loop:torbscript] checkpoint (context guard, CI fix round 2): root cause of the counted.test.trb:118 failure found and fixed, format still open.
Root cause: the pass runs in
finishLoweringright afterrewriteElementPlaces, but thevar fn nextof a trait-typed cursor is lowered withmakeOwnersUnique(call.trb:688 / place.trb:1107), i.e. aMakeUnique(cursor)sits in front of thenextcall untildropUncountedMakeUniqueremoves it, which runs AFTER the pass. At pass time the head was[MakeUnique, Call, Tag](3 instructions, cursor mentioned 3 times), sohead.instructions.length() != 2bailed. The earlier shape checks were derived from the printed final IR (afterdropUncountedMakeUnique+ ownership), which hid it. Everything else read OK: devirtualized call shape (referenced(Reference(cursor, [])), no witnesses,owners == ["ListIterator"]).Done: commit
51524448pushed to loop/470-counted-for-pass:countFlatListLoopsmoved to directly afterdropUncountedMakeUnique(still beforelowerBoxedUpdates/dropListBoundsChecks). Worktree clean.Left: (1)
format --checkstill wants 8 files (counted.trb, counted.test.trb, six tests/conformance/counted-for-*.trb); no local torb, so the exact formatter output has to come from the formatter rules or a CI log/artifact diff of the next run. (2) Wait for CI on51524448(tier A + gates); the test should now pass. Next step: read the format --check output of that run (job log), apply it, push, wait for CI once.[loop:torbscript] release implement: CI fix round 2 collected (checkpoint above),
51524448pushed (countFlatListLoops moved directly after dropUncountedMakeUnique in lower.trb). Open: format --check on 8 files (counted.trb, counted.test.trb, six counted-for-* conformance programs). next: waiting (CI on PR #475 for51524448), then format fix from the CI log[loop:torbscript] claim implement by session:loop-torbscript-20261025-0258 until 2026-10-25T08:30:00Z (CI fix round 3: tier A red on
51524448, run 1692 job 5)[loop:torbscript] release implement: CI fix round 3 pushed
528fedf6, next: waiting (CI on PR #475). The 8 format --check files were hand-aligned with canon rule K2 (calls.trb): lone-argument calls as commands, parentheses where an argument has an operator, no CI-less verification possible. Claim released.[loop:torbscript] claim implement by session:loop-torbscript-20261025-0258 until 2026-10-25T08:30:00Z (CI fix round 4 on PR 475: commit messages check red on
528fedf6)[loop:torbscript] release implement: CI fix round 4 reworded
528fedf6(typestyleis not a Conventional Commit type here) tochore(ir), now60ebb4a4, tree unchanged, no review existed on the old head, next: waiting (CI on PR 475)[loop:torbscript] claim implement by session:loop-torbscript-20261025-0258 until 2026-10-25T09:30:00Z (CI fix: tier A + gates red on PR 475 head
60ebb4a4, web run 1709)[loop:torbscript] release implement: CI fix round
a221d308, next: waiting (CI + review on PR 475)[loop:torbscript] claim implement by session:loop-torbscript-20261025-0542 until 2026-10-25T13:15:00Z (address Argus changes-requested review on PR 475: measurement, docs commit, PR body)
[loop:torbscript] implement (checkpoint, context guard, review round on PR 475): nothing pushed this round, head
cf227088, next: implement (fix worker continues from here).Found (no work redone)
cf227088is ONE commitperf(ir): count a for over a flat listdirectly on top of main44a35916; CIcommit messagesis green on it. Only the docs commit is still missing.cf227088) started 06:22 UTC and was still pending at 07:14 UTC (bootstrap, tier A/B, gates, cross, same-C, pack). A backgroundci-wait.shwrites /tmp/ci-wait-470.out (may be gone with the session; re-runci-wait.sh -C <worktree> --timeout 3500).tools/collection-cost.sh(2b2b4856), run at the end of tier B in.forgejo/workflows/gates.yml. It builds the merge-base compiler and this checkout's, runsbenchmarks/run.sh list-index list-iterate ...with both in ONE job (same machine, fastest of 9) and prints<program> allocated N blocks; its touched-files guard includescompiler/src/ir, so it fires on this PR. Read the tier B job log of run 1780 (GET /repos/torbscript/language/actions/runs/1780/jobs, then/actions/jobs/<id>/logs; if empty in the API, the web run page) and paste the--- baseand--- headtables as printed. Caveat: it callsrun.shwithout--allocations; if Argus insists on that column, add--allocationsto therun.sh $programscall in collection-cost.sh (fold into the perf commit, or state the leak-report count is the same number). Also in that log: the notice "allocation budgets that can be lowered" gives the printed counts for the fivecounted-for-*.allocationsplaceholders (1000) andwrite-to-list(6): set each to the printed value (nit 2).list-iterateratio <= 1.10 xlist-indexratio of the same table AND allocations exactly 24; "did not help" = list-iterate time > 2/3 of base in the same run or allocations != 24 (then read the generated C and say so). VM:torb runof list-iterate not slower: collection-cost.sh does not measure the VM; either add a VM timing line to the script or say plainly it was not measured (criterion 5 asks for it).a62088e6design record,0f63b4acBuffer is a List,9cc7666c). Cursors to re-compare against 5.1 decision 2:std/collections/src/list.trb:588TrieListIterator,:610ListIterator,std/core/src/buffer.trb:249BufferIterator (andListStorageinstantiation incompiler/src/ir/instantiate.trb). The 5.1 paragraph "Related work in review" is now stale ("is not on main"): rewrite it to say #413 landed and whether the cursor shape is unchanged, with the compared lines.docs(performance): record round P11edits in docs/PERFORMANCE.md only: header status (lines 3-5, "P11 is not built"), section 2 rowfor value in collection as a whole(~163), finding 5 "What is left" (~505), section 5 P11 row (line 1383, "specified, not built" -> done with numbers), 5.1 intro (~1414 "nothing in it is built yet"), "Related work in review", plus the before/after tables.skills/: no skill carries docs/PERFORMANCE.md (no P11 text in skills/, no carry directive in docs/skills), sotorb docs skill docs skillsshould be a no-op; the tier A gatedocs skill --checkconfirms. State that in the PR body.assert text.contains("unchecked")in compiler/tests/counted.test.trb (implied by theadd.i64.uncheckedline above it).State: worktree code/wt/torbscript-language-470-counted-for-pass clean at
cf227088= origin/loop/470-counted-for-pass. Push with force-with-lease only if the perf commit is amended (nit fixes go into it); the docs commit is a second commit. Then re-request Argus on PR 475 and release the claim (release implement).[loop:torbscript] implement (checkpoint, context guard, review round 2 on PR 475): pushed
51d38d87(perf commit amended, force-with-lease), CI of51d38d87running, next: implement (fix worker continues from here).Done
cf227088) tier A and tier B green. Read its tier B log (collection-cost.sh, base44a35916vs head),list-iterate385894 us 10.85x -> 53851 us 1.56x;list-index6.21x -> 6.76x (same table, same job); other rows within noise (array-write6.77x/7.55x,buffer-write6.77x/6.48x,list-slice2.08x/2.28x,list-write-shared3.95x/4.17x,list-literal17.48x/16.22x). Done-criterion time part holds (1.56x <= 1.10 x 6.76x).run.sh --allocationscount ("exactly 24"). So51d38d87amends tools/collection-cost.sh:run.sh --allocations $programs(theallocations (ld --wrap ...)block), the live-at-exit line renamed "has N blocks live at exit", and a VM line per label (VM, fastest of 3: list-index X ms, list-iterate Y ms,COLLECTION_VM_RUNS) for the "VM not slower" check.sh -nok, not run (no compiler on the gateway).gate()rm -f report.out), so notes are invisible. Counts for the six counted-for-*.allocations need either a failing probe (budget 0 prints "allocated N blocks, over its budget of 0") on a throwaway branch/PR, or a local run (no gcc here). Not done yet; nit, non-blocking.assert text.contains(" unchecked]")(compiler/tests/counted.test.trb:121) is the read annotation;add.i64.uncheckeddoes not contain it, so it is not implied and criterion 3 asks for it. Plan: keep it and say so in the PR body.Next (in order)
51d38d87(ci-wait.sh -C code/wt/torbscript-language-470-counted-for-pass --timeout 3500), read tier B job log (GET /actions/runs/<id>/jobs,/actions/jobs/<id>/logs):--- base/--- headtables with the allocations block and the VM line.run.sh --allocationstorb count 24 for list-iterate (equal to list-index); otherwise "did not help", read the generated C.tests/conformance/counted-for-*.allocations= 0, read counts from the failed tier B output, then set them in the perf commit (amend, force-with-lease, own branch only), or leave 1000 and say so.docs(performance): record round P11(docs/PERFORMANCE.md only: header status lines 3-5, section 2 row ~163, finding 5 ~505, section 5 P11 row ~1383, 5.1 intro ~1414 and "Related work in review" now: #413 landed, compare std/collections/src/list.trb:588 TrieListIterator, :610 ListIterator, std/core/src/buffer.trb:249 BufferIterator against decision 2), before/after tables.release implement.State: worktree code/wt/torbscript-language-470-counted-for-pass clean at
51d38d87= origin/loop/470-counted-for-pass. Claim of session:loop-torbscript-20261025-0542 still held (until 13:15 UTC).[loop:torbscript] claim implement by session:loop-torbscript-20261025-0542 until 2026-10-25T15:40:00Z (respawn: previous worker ended with nothing new; continue from the 08:27 checkpoint, CI of
51d38d87still running)[loop:torbscript] release implement: PR 475 now has the docs commit
19e27a62docs(performance): record round P11on top of the perf commit51d38d87, PR body rewritten, Argus review re-requested (worker ended without a release comment), CI of19e27a62running, next: waiting (CI + review on PR 475)forover a concrete list is a counted loop #58ArrayListis a type overBuffer(step 3 of #55, commit 2 of 2) #526ArrayListis a type overBuffer(step 3 of #55, commit 2 of 2) #526ArrayListis a type overBuffer(step 3 of #55, commit 2 of 2) #526