collections: collection names declared in std are ordinary types, Buffer.holdsClose (step 2 of #55, commit 1 of 2) #468
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 #55 (collections: rebuild
ArrayList, the hash tables and the tries onBuffer). Step 1 (#413) landed the design recorddocs/design/COLLECTION-STORAGE.md. Its section 8 slice 1 is "ArrayListas a type overBuffer" in two commits, and the first of them changes what the compiler has to read, so it is a seed matter under the two-commit rule. This issue is the first commit only; the second (std/moves, the 12 rows are removed) is filed as its own issue after the owner refreshed the seed (the pattern of #116 / #463).Goal
Teach the compiler the form that the later
std/rewrite needs, with nothing instd/using it yet: the collection namesArrayList,TrieList,HashMap,TrieMap,HashSetandTrieSetresolve to a type declared instd/wherestd/declares one, and to the runtime primitive otherwise (both forms work), and the constantBuffer.holdsCloseexists.Design record point
COLLECTION-STORAGE.mddecisions 1, 4 and 5, section 7 slice 1, section 8 slice 1 commit (1):feat(ir): collection names declared in std are ordinary types.Acceptance criteria
ir/instantiate.trbtreats each of the six names as a primitive of the runtime only whilestd/does not declare a type of that name; with a declared type,implementationOf(lowering, "ArrayList", ...)(list literals,lowerBuiltList, spread,forover a concrete list) resolves the declared generic type, built the wayfilledListbuilds it today (capacity = number of items, one allocation,appendper item or spread in written order).isListSetter(ir/elements.trb) also recognizes the wrapper shape the record'sArrayList.setwill have, soa[i].f = vstays an element step; the old shape keeps working.Buffer.holdsCloseis answered by lowering per instantiated item type from theClosing.holdsfact (true if the item may hold aClosevalue, false otherwise); a use with a false item folds away and emits no code. It is added to the closed K5 list indocs/design/NATIVES.mdwith its manifest row.std/orruntime/changes behaviour: all conformance programs and doc tests run unchanged, and the allocation budget of no conformance program rises.ArrayList-shaped type resolved through the literal andforpaths, one forholdsClosetrue and false, one pinning that aCloseitem's slice still copies) and the two forms check (the declared type is exercised only from tests/conformance, not fromstd/).tools/collection-cost.shin the pattern oftools/buffer-cost.sh(fastest of nine runs, merge base against branch, a measurement and not a gate, exits 0) and the new benchmarkslist-slice,list-write-shared,list-literalof the record's section 6, so the second commit has baselines; the PR body prints the table (list-index,list-iterate,array-write,buffer-write,bytes-pass, and the three new rows) for the unchanged tree. If a benchmark needs a declared type to run, the PR records it as "baseline on the primitive".skills/(torb docs skill docs skills); gates green in both tiers (CI).Seed impact
Yes. Adds a name the compiler answers (
Buffer.holdsClose) and changes how six names are resolved. The compiler of this commit must become the seed before the follow-up issue movesstd/. The seed refresh itself stays with the owner and is no part of this issue.Size
One PR, one or two Conventional Commits:
feat(ir): collection names declared in std are ordinary types, and optionallychore(benchmarks): collection-cost.sh and the list-slice, list-write-shared and list-literal benchmarks.Out of scope
Rewriting
ArrayListor any member instd/, removing manifest rows,TrieList/HashMapwork (slices 2 to 7), the seed refresh.Dependencies
Step 1 (#413, landed). #56 is closed. #58 (a
forover a concrete list as a counted loop) touches the sameforlowering: whichever lands second rebases onto the other; this issue keeps the inline iterator contract of decision 4 and does not change the loop's shape.[loop:torbscript] decided by the loop: step 2 is #468, the first commit of the record's slice 1 only. Why: slice 1 is two commits with a seed refresh between them (two-commit rule), and the refresh is the owner's, so one issue cannot hold both; the pattern is #116 / #463. The second commit (
refactor(collections): ArrayList over Buffer, the 12 rows) is filed after the seed was refreshed. Also decided: the benchmark baselines (tools/collection-cost.sh,list-slice,list-write-shared,list-literal) go into this step because the record has slice 1 record them before it changes anything; #56 is closed so the hash table slice is no longer blocked by it, but it followsArrayList(record section 8). Keyword search of open issues (ArrayList, Buffer, holdsClose, collection-cost, two-commit, seed) found no duplicate; #58 shares theforlowering and is noted as a rebase order, not a blocker.ArrayList, the hash tables and the tries onBuffer#55[loop:torbscript] claim implement by session:loop-torbscript-20261024 until 2026-10-24T13:15:00Z
[loop:torbscript] implement: checkpoint (context guard, no code written yet), next: continue implement (claim by session:loop-torbscript-20261024 stays)
code/wt/torbscript-language-468-collection-names, branchloop/468-collection-namesfrommain45f5ba05(clean, nothing committed or pushed).docs/design/COLLECTION-STORAGE.md(decisions 1, 4, 5; section 8 slice 1 commit 1).compiler/src/ir/instantiate.trb(newInstantiation, lines 74-81 register the six names viaaddPrimitive; only theBuffername must stay a primitive),compiler/src/ir/elements.trb(isListSetter),compiler/src/ir/lower/collection.trb(implementationOf,filledList,lowerDirectBuffer),compiler/src/backend/c/natives.trb(listEntries,containerOfrows;Buffer.withCapacityis a lowering-answered Container row, the model forBuffer.holdsClose),docs/design/NATIVES.mdK5 line 55 and its manifest drift check.addPrimitiveonly whenstd/declares no type of that name (a symbol check on the checker's declarations), (2)Buffer.holdsCloseas a lowering-answered member fromClosing.holdsplus K5 and the manifest row, (3)isListSetterwrapper shape, (4) conformance programs, (5)tools/collection-cost.shand the three benchmarks, (6) regenerateskills/, push, PRCloses #468,ci-wait.sh.Tokens used: about 90k
forpass over a flat list (step 2 of #58) #470forover a concrete list is a counted loop #58[loop:torbscript] implement: checkpoint 2 (context guard again, no code written yet), next: continue implement (claim by session:loop-torbscript-20261024 stays)
code/wt/torbscript-language-468-collection-names,loop/468-collection-namesfrommain45f5ba05, clean, nothing committed or pushed.git.torb.dev(token~/.secrets/torbdev-token), notgit.dmb.zone(thetasksMCP says "not found" for it; use curl againsthttps://git.torb.dev/api/v1).instantiate.trb:74-81addPrimitiveuseschecker.wellKnown.symbolNamed(name). Today all six names arenative typeinstd/collections/src/{list,map,set}.trb; so "std declares a type" = the symbol's declaration is not native.checker.siteOf(symbol)is a non-varmethod (context.trb:2024); matchsite.kindas insemantics/checker/escape.trb:442(.Owned(_, _, declared) => declared.modifiers.native,.Declared(declaration) => declaration.modifiers.native). A non-native symbol: skipaddPrimitive.typeSignatureOfneedsvar checker, whichnewInstantiation(checker)/newLowering(called fromlower.trb:59,107,148) do not have, so prefersiteOf.Bufferstays unconditional.implementationOf(lower/collection.trb:1009) =preludeType(lower/generic.trb:698) =wellKnown.symbolNamed(name)+checker.nominal; it already resolves a declared generic type, so it needs no change. The change is infilledList(213) /fillList(255) /lowerDirectList(288), which emitInstruction.ContainerNew(storage, RuntimeKind.ListStorage, [element])(capacity hint dropped today). For a declared type (container's IR type is notRuntime(ListStorage)): call the staticwithCapacity(n)of the container (a body, viamemberOfType/emitCallinlower/call.trb:1011), thenappendper item or spread as now (addInto,spreadInto461).lowerEmptyContainer(lower/call.trb:1566) is the constructor path forArrayList().Buffer.holdsClose: model iscontainerOf("{owner}.withCapacity", ...)inbackend/c/natives.trb:1155(listEntries,isBuffer); theClosing.holdsfact is inlower/scope.trb:417/lower/collection.trbneighbours. Needsstd/core/src/buffer.trbto declare thenative static const holdsClose(NOT in scope to change behaviour: check that adding a declared native with a manifest row passes the drift check indocs/design/NATIVES.mdK5 line 55 andhasManifestRow,semantics/checker/implementation.trb:2660-2790).tests/conformance/*.trbare single programs built against the realstd/, in which the six names are stillnative type, so a conformance program cannot declare a "test-localArrayList" thatsymbolNamed("ArrayList")resolves to. The place where a declaredArrayListcan exist is the in-memory prelude ofcompiler/tests/harness.trb(line 356 declarespublic native type ArrayList<Item> with List<Item>,ir-instances.test.trb:53another); a lowering test there with a non-nativeArrayListis the feasible "declared-type" test. Conformance programs remain possible forholdsClose(needs the realBuffer) and for theClose-item slice copy. The issue's acceptance wording ("conformance program for a test-local declared type") needs that adjustment; the implementer should state it in the PR.isListSetter(ir/elements.trb) andnatives.trbcontainerOf: not yet read; the "wrapper shape" isArrayList.setas a body callingBuffer.seton theitemsfield (record section 3, decision 1).skills/regen, PRCloses #468,ci-wait.sh).Tokens used: about 90k (this session)
[loop:torbscript] claim implement by session:loop-torbscript-20261024 until 2026-10-24T13:25:00Z (continuation 3 of 3, from checkpoint 5990)
[loop:torbscript] implement: checkpoint 3 (context guard, WIP pushed), next: implement
loop/468-collection-namesatdff3d70e(on main45f5ba05), one WIP commit, no PR, not formatted and never compiled (notorbin the worker sandbox). Worktreecode/wt/torbscript-language-468-collection-names.ir/instantiate.trb:addCollectionfor the six names; it callsaddPrimitiveonly whileisDeclaredType(checker, symbol)is false (newpublic fn,siteOf+.Declared(declaration) => !declaration.modifiers.native).Bufferstays onaddPrimitive.ir/lower/collection.trbfillList: for a declared container (isDeclaredContainer)emitWithCapacityreplacesContainerNew:lookupStaticMember(checker, container, "withCapacity"),memberMappingOf,instanceFor,emitCallwith anInt64capacity = number of non-spread items; thenappend/spread as before. New imports:lookupStaticMember,memberMappingOf,instanceFor,isDeclaredType. Check thatCandidate.kind's.Method(_, symbol)and thereportUnsupported4-argument form compile.ir/elements.trb:isListSetter=isStorageSetter(the old body) orfieldForwardedCallee(one call, receiverReference(Slot(0), [.Field]), other parameters forwarded in position) reachingisStorageSetter.Buffer.holdsClose):Closing(ir/closing.trbclosingOf(program)) is computed over the whole IR program after lowering (ownership.trb:52, both emitters), so lowering cannot readClosing.holdswhile it lowers a body. Options: (a) a lowering-time walk of the item type that is conservative in the same direction, or (b) a placeholder that the ownership pass (which hasclosing) rewrites into aBoolconstant. Declaration form: nonative static constexists instd/; the nearest model is K8 (static current: Self = targetOperatingSystem()+NativeTarget.Target, folded inir/fold.trb:303), but a per-Itemanswer needs a member ofBuffer<Item>, e.g.native static fn holdsClose(): Boolwith a newNativeTargetcase lowered atlower/call.trb:800. This choice needs a decision before code; a fresh implement run should take it (or split holdsClose into its own issue).compiler/tests/harness.trb:356) and the conformance programs,tools/collection-cost.sh+ three benchmarks,skills/regen, PRCloses #468, CI.Tokens used: about 95k (this session)
[loop:torbscript] release implement: continuation budget used up, checkpoint 6001, next: implement
forover 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 4 (context guard, no new code this session, branch rebased and pushed), next: implement
loop/468-collection-namesrebased onto main57085dce, now at29ffb22c(one WIP commit: instantiateaddCollection,fillList->emitWithCapacity,isListSetterwrapper). Still never compiled, unformatted, no PR. Worktreecode/wt/torbscript-language-468-collection-names(clean).Buffer.holdsClose(checkpoint 3's question):closingOf(program)runs ininsertOwnership(ir/ownership.trb:49) after lowering, and the backends already answer slice copying from it (holdsCloser,backend/bytecode/emit.trb:2285; C side the same). So lowering cannot know the narrow fact. Chosen: a generated, per-item-type body. NewGenerated.HoldsClose(ir/lower/context.trb, built inir/lower/derive.trbnext tocontainerBody, dispatched inir/witness.trb:482) whose body returns aBoolconstantfalse, plus a manifest rowNativeEntry name: "Buffer.holdsClose", target: NativeTarget.Lowered-like(newNativeTarget.Closingcase, handled inlowerNativeCallir/lower/call.trb:~858viageneratedFunctionOf, and in thecall.trb:2238operator arm).insertOwnershipthen rewrites each such body toclosing.holds(item)(the item = the type argument of the function's receiver; record it in a newFunctionKind.HoldsClose(item: IrTypeId)so the pass finds it). A call is an ordinary call of a constant function, the C compiler folds the branch.std/core/src/buffer.trbnative static fn holdsClose(): Bool(nonative static constexists), K5 line indocs/design/NATIVES.md+ manifest row;natives.trbdrift check (implementation.trb:2660-2790) andir/verify.trbfor the new FunctionKind need a look. The VM emitter and the C emitter treat aPlain-like body as normal, so no backend change if the kind is only read by the ownership pass.std/core/src/buffer.trbdeclaring the native is only legal if the seed knows the manifest row; per the issue this commit adds the native "without using it", so the declaration goes in this commit only if the seed tolerates an unknown manifest row (checkhasManifestRow); otherwise the declaration is the follow-up commit's and this commit ships the row + lowering only. Decide when readingimplementation.trb.ArrayList(compiler/tests/harness.trb:356; conformance cannot declare a test-localArrayList, say so in the PR), conformance programs forholdsClosetrue/false and theCloseitem slice copy,tools/collection-cost.sh+list-slice/list-write-shared/list-literalbenchmarks,torb format,skills/regen, PRCloses #468,ci-wait.sh.torbbinary in the worker sandbox: the first compile is forge CI; expect fix rounds.Tokens used: about 95k (this session)
CONTINUE: torbscript/language#468
[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T04:00:00Z
[loop:torbscript] implement: checkpoint 5 (context guard, WIP pushed), next: implement (claim by session:loop-torbscript-20261025 stays)
loop/468-collection-namesatd81f64c1, rebased on mainf45061f9, two WIP commits, no PR, never compiled (notorbin the sandbox), unformatted. Worktreecode/wt/torbscript-language-468-collection-names.Buffer.holdsClosedone in code. Design change against checkpoint 4: no generated body and no ownership-pass rewrite. The lowering already hasmayHoldClose(ir/lower/scope.trb, the wide answer the ownership pass narrows;falseis final), so a.Loweredmanifest rowBuffer.holdsCloseis answered inlowerNativeCall(ir/lower/call.trb,lowerHoldsClose) as aBoolconstant from the item type argument ofdispatched.subject. Also: row inbackend/c/natives.trb(loweredOf),native static fn holdsClose(): Boolinstd/core/src/buffer.trb, K5 line andBuffertable row indocs/design/NATIVES.md.std/core/src/buffer.trbwith the newnative static fnthat it has no manifest row for.hasManifestRowis only asked for trait requirements, so a native declared and never called should pass; if the bootstrap says otherwise, move the declaration to the follow-up and keep the row.ArrayListin the harness prelude (compiler/tests/harness.trb:356; conformance cannot declare a test-localArrayList, say so in the PR); conformance programs forholdsClosetrue/false and theCloseitem slice copy;compiler/tests/natives.test.trbcheck for the new row;tools/collection-cost.sh+list-slice,list-write-shared,list-literalbenchmarks;torb docs skill docs skills; open PRCloses #468(table or "baseline on the primitive");ci-wait.sh; fix rounds. First compile is forge CI, so open the PR early and expect rounds.Tokens used: about 100k (this session)
[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T04:15:00Z (continuation 1 of 3, from checkpoint 6164)
[loop:torbscript] release implement: no worker could be spawned in this run (spawn tool unavailable), checkpoint 6164 is current, next: implement (fresh worker from checkpoint 6164, open the PR first)
[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T04:15:00Z
[loop:torbscript] implement: checkpoint 7 (context guard, PR open, WIP pushed), next: implement (fix round; claim by session:loop-torbscript-20261025 stays)
Closes #468) open onloop/468-collection-names, head68243a6d(two new commits sinced81f64c1base: the lowering WIP, andchore(benchmarks):tools/collection-cost.sh+list-slice,list-write-shared,list-literalwith C twins,run.sh/README rows,gates.ymlstep).d81f64c1):bootstrap (linux-x64)SUCCESS, i.e. the compiler with the WIP compiles.tier A,tier B,gates,every host emits the same C,pack the seed,archives,playground,release-syncFAILED; job logs not yet read (jobs 2, 5, 6 of run 1655; ci-wait.sh printed no log tail, read them through the run page). Run for68243a6dpending.Buffer.holdsClosedeclaration instd/core/src/buffer.trbvs the seed, orcompiler/tests/natives.test.trb/manifest drift; fallback in checkpoint 6164: move the declaration to the follow-up and keep the row),torb formatof touched files, harness-prelude lowering test for a declaredArrayList, conformance programs (holdsClosetrue/false,Closeitem slice copies),skills/regen, PR body table (collection-cost output from CI, or "baseline on the primitive").Tokens used: about 90k (this session)
[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T04:15:33Z (continuation 1 of 3, from checkpoint 6211)
[loop:torbscript] implement: checkpoint 8 (context guard, fix round pushed), next: implement (fix round; claim by session:loop-torbscript-20261025 stays)
68243a6donlycommit messages(subject 103 > 100 chars) andpdisc(stale stamp ofbenchmarks/README.md) failed, which blocked every other job.861b495b; squashed the WIP into two commits,feat(ir): collection names declared in std are ordinary typesandchore(benchmarks): collection-cost.sh and three list benchmarks(check-commits.shclean);torb formatof all touched.trb(onlyir/lower/collection.trbchanged); atools/collection-cost.shparagraph inbenchmarks/README.md, sidecar summary + stamp,INDEX.md(pdisc checkclean);torb checkofcompiler/with the nightly toolchain: 401 files, no problems.c7041355toloop/468-collection-names(PR #474); its CI is the first real run of tier A/B, gates, every-host-same-C, pack seed, archives, playground, release-sync.actions/runs?head_sha=<sha>gives the API run ids, thenactions/jobs/<id>/logs; the web run numbers differ). If the old seed rejectsnative static fn holdsCloseinstd/core/src/buffer.trb, move the declaration to the follow-up and keep the manifest row (checkpoint 6164). Then: acompiler/tests/natives.test.trbcheck for theBuffer.holdsCloserow; a harness-prelude lowering test for a declaredArrayList; conformance programs (holdsClosetrue/false; aCloseitem's slice still copies);torb docs skill docs skills; PR body table from the CIcollection-cost.shoutput of tier B, or "baseline on the primitive".Tokens used: about 85k (this session)
[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T04:30:00Z (continuation 2 of 3, from checkpoint 6222)
[loop:torbscript] implement: checkpoint 9 (context guard, WIP pushed), next: implement (fix round; claim by session:loop-torbscript-20261025 stays)
c7041355: both runs (API ids 1712, 1713) stayedwaitingfor the whole session and never started, so no job result yet. They are superseded by the new head; nothing has been seen red yet.compiler/tests/natives.test.trbtest "the buffer's holdsClose is a ready row the lowering answers" (.Loweredtarget, ready, no symbol, no prototype, absent from the header). Committest(natives): ...f08496dc,check-commits.sh 861b495b HEADclean. Not formatted (notorbin this sandbox), so runtorb format compiler/tests/natives.test.trbwith the nightly toolchain.f08496dctoloop/468-collection-names(PR #474). Worktreecode/wt/torbscript-language-468-collection-names.f08496dc(actions/runs?head_sha=f08496dca1d7589727996124122499ad5e5956e8,ci-wait.sh, one blocking exec). If it stayswaiting, check runner availability before anything else. If the old seed rejectsnative static fn holdsCloseinstd/core/src/buffer.trb, move the declaration to the follow-up and keep the manifest row (checkpoint 6164).compiler/tests/lower-collections.test.trb, passextrathat overridesstd/prelude/src/types.trbwithpreludeSourcewhere thepublic native type ArrayList<Item>block is replaced by a declaredpublic type ArrayList<Item> with List<Item>, From<Iterate<Item>>over a fieldvar items: Buffer<Item>. It needs astatic fn withCapacity(const items: Buffer<Item> = Buffer.withCapacity(capacity), thenArrayList(items: items)),from,length,get,at,set(forwardingitems.set key, value, the shapeisListSetterrecognizes),append,appended,removeAt,iterate, andslice/replacewith apanicbody. Add a nativeBuffer<Item>(withCapacity, length, get, set, append, removeAt; TorbScriptiterateover aBufferIteratoras instd/core/src/buffer.trb), and overridestd/prelude/src/lib.trbto exportBuffertoo. Assertions:fn numbers(): ArrayList<Int> { [10, 20] }haswithCapacity,constant s_literal__Int64_2, two_appendcalls and no= new;forover anArrayList<Int>parameter callsArrayList_iterate;unsupportedIn(...) == []for both.holdsClosetrue and false; aCloseitem's slice still copies.torb docs skill docs skills.collection-cost.shCI output, or "baseline on the primitive".Tokens used: about 85k (this session)
[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T04:45:00Z (continuation 3 of 3, from checkpoint 6229)
forpass over a flat list (step 2 of #58) #470[loop:torbscript] implement: checkpoint 10 (last continuation's context guard, WIP pushed; claim by session:loop-torbscript-20261025 released), next: implement (continuation budget exhausted, fresh worker from this checkpoint)
f08496dc(1716, 1717) were still queued behind a busy serial runner (one job running, several queued, not a dead runner) and were cancelled by the new push. Still no job result on this branch.9df0cc54test(lower): a declared ArrayList over a Buffer is built through withCapacity and appendincompiler/tests/lower-collections.test.trb. The harness prelude lives incompiler/tests/harness.trb(preludeSource,workspace), not instd/prelude/src/types.trb.declaredListFiles()drops thenative type ArrayListblock and its doc comment frompreludeSource, appendsdeclaredList(a declaredArrayList<Item>overvar items: Buffer<Item>, plus a nativeBufferandBufferIterator) and addspublic use Buffer, BufferIteratorto the prelude'slib.trb. Two tests: the literal[10, 20]haswithCapacity,constant s_literal__Int64_2, two_append(calls and no= new;forover anArrayList<Int>parameter callsArrayList_iterate;unsupportedIn(...) == []for both. Not run (notorbhere), so the first CI result may need small fixes in that helper.check-commits.sh 861b495b HEADclean.9df0cc54pushed toloop/468-collection-names(PR #474). Its runs 1718 and 1719 are queued. Worktreecode/wt/torbscript-language-468-collection-names.ci-wait.shfor the current head. If the old seed rejectsnative static fn holdsCloseinstd/core/src/buffer.trb, move that declaration to the follow-up and keep the manifest row (checkpoint 6164). Fix what CI reports in the new lowering tests. Runtorb formatoncompiler/tests/natives.test.trbandcompiler/tests/lower-collections.test.trb(the format gate tells you which).holdsClosetrue and false; the slice of aCloseitem still copies.torb docs skill docs skills.collection-cost.shCI output, or "baseline on the primitive".Tokens used: about 90k (this session)
[loop:torbscript] implement: continuation cap reached (3 of 3), checkpoint 10 is current; PR #474 head
9df0cc54has CI queued behind a busy runner. next: waiting (forge CI on PR 474; on red a fix round via pr-followup from checkpoint 10) until 2026-10-25T01:30:00Z[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 11 (CI fix round 4; context guard reached, claim by session:loop-torbscript-20261025 released), next: implement (fresh worker from this checkpoint: wait for CI on
fff3d176)9df0cc54(run 1718):bootstrap (linux-x64)failed at step 1 with exactly two errors, bothString has no member lengthindeclaredListFiles()(compiler/tests/lower-collections.test.trb:614and:624). The seed acceptednative static fn holdsCloseinstd/core/src/buffer.trb, so the declaration stays.ca2fd986test(lower): the harness counts a line's indent in bytes(String.byteLength()in both places).fff3d176test(conformance): Buffer.holdsClose per item type, and a Close slice copies in a generic function:tests/conformance/buffer-holds-close.trb:Buffer<X>.holdsClose()for Int, String,ArrayList<Int>(false) and Probe,Probe?, a record with a Probe field,ArrayList<Probe>(true), plus a genericholdsAsItem<Item>instantiated for Int and Probe. Budget0is a guess (no Probe is made, only literals are printed). If CI reports another count, take it.tests/conformance/slice-close-generic.trb: the shape ofdestructor-slice-concrete.trb, but the slice is taken in the genericmiddleOf<Item>. Its expected output, exit code and budget (12) are copied from that program. If the count differs, take CI's number.torb docs skill): nothing to regenerate.skills/mirrors onlydocs/languageanddocs/standard-library, and this PR's docs change isdocs/design/NATIVES.mdalone. Say so in the PR body.fff3d176pushed toloop/468-collection-names(PR #474).check-commits.sh 861b495b HEADclean. Worktreecode/wt/torbscript-language-468-collection-names. CI not waited out.ci-wait.shforfff3d176. Fix what it reports:torb formatgate on the two test files and the new conformance programs, the two budgets, and the new lowering tests if tier A runs them.collection-cost.shoutput, or "baseline on the primitive", plus the skills note above.Tokens used: about 85k (this session)
[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T07:00:00Z (CI fix round 5: wait for CI on
fff3d176)[loop:torbscript] implement: checkpoint 12 (CI fix round 5; context guard reached, claim by session:loop-torbscript-20261025 released), next: implement (fresh worker from this checkpoint: format + docs declarations, then CI)
CI on
fff3d176(run 1722): bootstrap (linux-x64), tier B, commit messages, release-sync/registry, VS Code extension, pdisc green. Tier A red, 3 gates:test compiler/tests (native), 2 failures, both fixed in WIP head7bccb363(pushed):natives-audit.test.trb"the counts of the record are the rows of the tables": the Counts table ofdocs/design/NATIVES.mdnow says kernel 156, total 537 (the newBuffer.holdsCloserow).lower-collections.test.trb:649: the lowering was right (onewithCapacity, twoArrayList_append__Int64(calls); the filter looked for_append(, nowArrayList_append__Int64(.format --check:compiler/tests/lower-collections.test.trb,compiler/tests/natives.test.trb,tests/conformance/buffer-holds-close.trbwould change. Open. The log names only the files, no diff. The CI artifacttorb(compiler-linux-x64) needs GLIBC 2.38 and does not run in the worker's exec, so the format has to be fixed by hand againstcompiler/src/format/(suspects:assert true/assert falsein natives.test.trb, lines over the width in buffer-holds-close.trb and the new lowering tests), or through a CI step that printstorb formatdiffs.docs declarations --check:docs/standard-library/core.md:255, theBufferblock has to listnative static fn holdsClose(): Bool(where it now hasnative fn length(): Int; the generated order puts the static fn there). Open. Edit the block to the declaration order ofstd/core/src/buffer.trb. That changesdocs/standard-library, soskills/has to mirror it (torb docs skill docs skills; by hand: the same block in the skills copy of core.md). The skills note for the PR body is then: skills regenerated, not "nothing to regenerate".Allocation budgets: the conformance gate did not fail, so the guessed budgets (0 and 12) are no blocker now; recheck once tier A runs past the format gate.
Tier B
collection-cost.sh(fastest of 9, µs net of the floor, merge base861b495bvs headfff3d176) for the PR body:bytes-pass fastest of 9: Buffer base 0.0421 s / head 0.0382 s; List base 0.0454 s / head 0.0471 s (gate: ratio 0.890, bound 1.10). Allocation counts are the same in base and head. Every row runs on the primitive (nothing in
std/declares a list yet), so these are the baselines on the primitive for the follow-up commit.Next, in order:
core.mdBuffer block + skills mirror, one commit, push, one blockingci-wait.sh.Branch
loop/468-collection-names, head7bccb363(PR #474), worktreecode/wt/torbscript-language-468-collection-names.Tokens used: about 95k (this session)
[loop:torbscript] claim implement by session:loop-torbscript-20261025 until 2026-10-25T08:00:00Z (CI fix round 6, from checkpoint 12)
[loop:torbscript] implement: checkpoint 13 (CI fix round 6; context guard reached, claim by session:loop-torbscript-20261025 released), next: implement (fresh worker: wait for CI on head
8891a227, then verify budgets, PR body, handover)Done in this session, head
8891a227(pushed, force-with-lease; tree unchanged vsada4eef0, only the messages were reworded because the first CI run ofada4eef0failedcommit messages: typestyleis not allowed, and 7bccb363's subject was 103 characters):format --checkfixed by hand against the canon (compiler/src/canon/calls.trbK2: a call in command position without an operator or{in its arguments is a command):natives.test.trbtwoassert(...isEmpty())are nowassert ...isEmpty(),lower-collections.test.trbkept.joined separator: "\n",buffer-holds-close.trbthe ninesay(...)lines are commands (precedentprint Flags<Permission>.fromBits(69)). Unverified until the format gate runs.Bufferblock ofdocs/standard-library/core.mdand the skills mirror listnative static fn holdsClose(): BoolafterwithCapacity.In flight: CI on
8891a227(ci-wait session brisk-atlas of the ended worker may be gone; the next worker re-runsci-wait.sh -C <worktree>).Next, in order:
ci-wait.sh; if the format or docs gate still fails, fix from its log (the log names only files for format).next: review(handover to Argus). Do not merge.Branch
loop/468-collection-names, head8891a227(PR #474), worktreecode/wt/torbscript-language-468-collection-names.Tokens used: about 85k (this session)
[loop:torbscript] release implement: round 7 worker timed out while waiting on Forge CI, no changes (head still
8891a227, checkpoint 13 stands). next: waiting (CI on PR #474), then budgets, PR body, handoverArrayList, the hash tables and the tries onBuffer#55ArrayListis a type overBuffer(step 3 of #55, commit 2 of 2) #526ArrayListis a type overBuffer(step 3 of #55, commit 2 of 2) #526ArrayList, the hash tables and the tries onBuffer#55ArrayList, the hash tables and the tries onBuffer#55ArrayListis a type overBuffer(step 3 of #55, commit 2 of 2) #526