tests: harness prelude declares ArrayList in the std shape (follow-up of #565) #837
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language#837
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
Follow-up of #565 (step 3a of #55, merged as PR #838). Since #526 / PR #529,
ArrayListis a TorbScript record overBuffer<Item>(items,start,count) instd/collections/src/list.trb. The compiler test harness (compiler/tests/harness.trb) still declaresnative type ArrayListinpreludeSource(withslice/replacehelpers, no manifest rows), so every test that writesArrayListwithout extra files lowers a list that a real build never has. #529 moved the tests that pin pass shapes toTrieList, the runtime's list.State on
mainafter #838 (the harness now holds three shapes besides the native one):windowedList(noown(),slice/replace/frompanic), spliced in bydeclaredListFilesindebugger.test.trb(listFiles) and described in the comment abovedeclaredListinlower-collections.test.trb.stdShapedList(with the privatevar fn own(), writers call it first;slice/replace/frompanic), spliced in bystdListFiles(); used byelements.test.trb(two of its tests as a mutated copy throughdeclaredListFiles(stdShapedList.replace(...))) andexplain-copies.test.trb.declaredListinlower-collections.test.trb: a one-field record (itemsonly) for the "namestd/declares as an ordinary type" group.tests/command-line/copiesis already anArrayListagain (#838) and needs no change here. This issue makes the std shape the prelude itself and removes the copies.Goal
The harness prelude declares
ArrayList(and theBufferit needs) once, in the std shape, so every test that saysArrayListlowers what a real build lowers; nonative type ArrayListand no second or third copy of the shape remains.Requirements
ArrayListas a record with the fieldsitems: Buffer<Item>,start,countand a privatevar fn own()that every writing member calls first, with the bodies ofstd/collections/src/list.trbfor the members the suite reaches. A member that no test reaches may keep a one-linepanicbody, asstdShapedListdoes now; a member that a moved test reaches (R2) gets its real body.BufferandBufferIterator(asdeclaredListFilesdoes now), so the default prelude needs no extra files to declare the list.windowedList, the one-fielddeclaredListoflower-collections.test.trband the splice indeclaredListFilesthat removes the native declaration shall be folded into the one prelude declaration. The two tests ofelements.test.trbthat mutateown()away keep working through one small helper that puts a modified copy of the single shape text in place of it; there is still exactly one text of the shape inharness.trb.TrieListin #529 shall useArrayListagain when what it pins is the behaviour of the list a user sees (record,own(),Buffercalls, element steps, copy reports, panic site and message ofat). A test that pins a native row or the runtime's list (torb_listwrappers,by addresselements, the C of a native call, task crossing of the runtime list) keepsTrieList, with a one-line comment saying so. Starting classification, to be confirmed per test by the implementer:partial.test.trb(theatpanic note names the list type) and theTrieListtests ofelements.test.trb/explain-copies.test.trbwhoseArrayListtwin from #838 exists: keep one pair where both shapes are pinned, drop a pure duplicate;lower-natives.test.trb(nativeList.appendwrapper),lower-places.test.trb(nativeappend) andcrossing.test.trb(C of a task over the runtime list) are native-row tests and stay onTrieListunless a test turns out not to pin the native; tests aboutTrieListitself keep it.stdListFiles()argument anddeclaredListFilesuse in the tests ofelementsandexplain-copiesshall go away (the default prelude is the std shape); no test shall pass the std shape as extra files.lower.test.trb, IR and C texts of tests that nameArrayList, thenativesandbuffer-tablesexpectations) shall be reviewed against the std shape and updated by hand with the reason in the PR body; none is regenerated wholesale.Files
compiler/tests/harness.trb; test files that nameArrayListthrough the default prelude and may change expectations:lower.test,lower-collections,collections,natives,traits,ownership,ir,devirtualize,documentation; test files of R4 (elements,explain-copies,partial,lower-natives,lower-places,crossing);debugger.test.trb(replaceswindowedList).ir-instances.test.trbhas its own mini prelude withnative type ArrayListto test the IR type mapping and stays as it is. Nocompiler/src, noseed/.Tests
The suite is the deliverable: the unit tests of the files above in tier A. Pinned by existing tests that must stay green unchanged in meaning:
elements.test.trb(element steps throughown()),explain-copies.test.trb(copy notes), the debugger list display (debugger/values.trbshowsitems[start..start+count]), andtests/command-line/copies. Nothing is run locally beyondtorb format --checkand one unit test; gates, bootstrap and the counts are read from the forge CI of the PR.Acceptance criteria
grep -n "native type ArrayList" compiler/tests/harness.trbfinds nothing.grep -n "windowedList" -r compiler/testsfinds nothing, andharness.trbholds exactly onepublic type ArrayList<Item>declaration.grep -rn "stdListFiles\|declaredListFiles" compiler/testsfinds only the helper of R3 (or nothing).ArrayListor onTrieListwith a comment saying why, and no test that pins a native row was moved.aandbgreen in the forge CI of the PR.Seed
No. Test-only change: no syntax, no new native, no driver flag, no std name the compiler looks up by string;
seed/stays untouched. One commit (test: ...), the two-commit rule does not apply.Size
One PR:
harness.trbplus test sources. Most of the diff is churn in expectations; the shape itself is moved, not new. Fallback if the CI reads more than a handful of unexplained count changes: land the prelude switch with R1 to R3 and R5 first and leave the R4 moves to a follow-up (one commit each), never a blind regenerate.Dependencies
stdShapedListandstdListFilesexist). No longer a blocker.inlineSizeLimitfrom 32 to 48 incompiler/src/ir/layout.trb, changes the layout tests (ir-layout,make-unique,emit-c,bytecode), the.allocationsbudgets anddocs/design/COLLECTION-STORAGE.md. It does not touchharness.trbor any test file of this issue, so there is no textual conflict apart from the status text of the design record. It is a semantic neighbour: with the std shape the defaultArrayListis a 32-byte record, and whether an aggregate holding it is inline or a counted block depends on that limit, so IR/C expectations that show a layout or a release of such an aggregate differ between 32 and 48. Order: this issue does not wait for #841. Whichever lands second re-reads the other's affected expectations (R6); if #841 is merged first, implement againstmainwith the limit 48; if this lands first, the #841 branch rebases and re-checks the same list. The worker records which case applied in the PR body.Decided by the loop
stdShapedList), not a new one;windowedListanddeclaredListare the copies that go, because the std shape is a superset of both for what their tests reach (startstays 0, the window is never narrowed).TrieList, which also keeps one place that exercises anative typelist as long asTrieListexists.[loop:torbscript] intake: triaged. Follow-up of #565 (step 3a of #55): switches the whole harness prelude to the std ArrayList and moves the tests of #529 back from TrieList. Depends on PR #838 landing (it adds the element steps the tests pin); refine when #838 is merged and fewer than 4 issues are ready (now 4: #836, #620, #565, #365). next: waiting (ready buffer full, PR #838 not merged)
[loop:torbscript] next: waiting (PR #838 must land first, it changes the same ArrayList element-step passes; ready buffer is full with #836, #566, #565, #365, refine resumes when fewer than 4 are ready)
[loop:torbscript] claim refine by session:loop-torbscript-837-refine until 2026-11-17T01:30:00Z Reason: PR #838 (#565) is merged and main is green; ready buffer is 3 of 4 (#836, #566, #842), three worker slots free. Refine brings #837 to the definition of ready, noting that PR #841 (#566) also changes ArrayList.
[loop:torbscript] decided by the loop: #837 is refined against
mainafter #838. Facts that changed the scope: the harness now holds the nativeArrayListpluswindowedList,stdShapedListand the one-fielddeclaredListoflower-collections.test.trb;tests/command-line/copiesand theArrayListtests ofelementsandexplain-copiesare already done by #838. The body now folds the shapes into one prelude declaration (R1 to R3, R5), moves tests back toArrayListper test by what they pin (R4: native-row tests such aslower-natives,lower-placesandcrossingstay onTrieList), and requires reasoned count changes (R6). Dependency on PR #841 (#566): no file overlap (it changesir/layout.trb, four layout tests,.allocationsand the design record), but it raisesinlineSizeLimitto 48 and the stdArrayListis a 32-byte record, so layout-dependent expectations differ; this issue does not wait for #841, whichever lands second re-reads those expectations. No owner decision, seed: no, one PR.[loop:torbscript] release by session:loop-torbscript-837-refine: body rewritten to the writing standard (goal, EARS requirements R1 to R6, files, tests, acceptance criteria, seed, size, dependencies, decisions); label
readyadded; claim released. next: ready[loop:torbscript] claim implement by session:loop-torbscript-837-implement until 2026-11-17T05:30:00Z Reason: #837 is ready (refined after #838, main CI green), implementation starts as one PR with
Closes #837; PR #841 (#566) has no file overlap and whichever lands second re-checks layout-dependent expectations.[loop:torbscript] implement: PR #843 open, CI green, next: review