js: the rest of the kernel, manifest walk, isSame and BigInt property tests (slice 4B of #63) #724
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#724
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 6 of epic #63 (JavaScript back end), slice 4, part B of
docs/design/JAVASCRIPT-BACKEND.mdsection 6 row 4 ("The kernel, part 1B"). Slices 1 to 3 and 4A (#678, #684, #701, #708; PR #718 merged as79b35cb9) are onmain:compiler/src/backend/javascript/{emit,body,type,natives,witness,count,writer}.trb,runtime/javascript/{core,int64,list}.mjs,tools/conformance.sh --js,tests/conformance/js.allow, CI jobconformance-js. 4A left the list storage and the list and text natives in place; what still stops programs is the part of the kernel of natives that has no JavaScript yet (the text show, parse and hash natives, the remaining widths,isSame) and the fact that nothing proves the table complete.Source
docs/design/JAVASCRIPT-BACKEND.mdsection 3 (the kernel, K1 to K8), section 6 row 4B and the paragraph "What slice 4A left out, on purpose".docs/design/NATIVES.md(the manifest,nativeEntries();isSameis a planned intrinsic there).compiler/src/backend/c/natives.trbandruntime/as the reference for what each symbol means;compiler/src/backend/javascript/natives.trbfor what is mapped today.Goal
nativeEntries()and fails for every entry that has no JavaScript mapping, except for an explicit deferred list naming the entries that belong to slice 5 (floats,libm) and slice 7 (tasks, time, files). The list is data in the repo, reviewed likejs.allow.isSame. Mapped as it stands in NATIVES.md; if it has become an IR intrinsic by the time this is implemented, follow the IR.Intrinsicsweep. EveryIntrinsicof the IR over every width is emitted or named as deferred.runtime/javascript/int64.mjsand the intrinsics are tested againstBigIntintools/(random and boundary operands, each operator and width, 10^6 cases each) and report zero differences.Decided by the loop
HashMap,HashSetorTrie*stays offjs.allow.bankers-queue,bound-methods,buffer-field-derived,buffer-list,collect-through-wrappers,cons-stack-persists,destructor-early-exits,entry-cell-trait,interpolation,joined,plain-bound,shared-top-level-const,source-trait-value,trait-constants, andheap-order(differs at runtime). A program that still needs floats, tasks or a map stays off and is listed in the PR with the finding that names the later slice.tools/check-commits.sh.Files
compiler/src/backend/javascript/natives.trb,body.trb(intrinsics),emit.trb.runtime/javascript/core.mjs,int64.mjs(helpers; a new file only if the "absent unless used" rule needs it).tools/(theBigIntproperty tests), the manifest-walk test and the deferred list.tests/conformance/js.allow.docs/design/JAVASCRIPT-BACKEND.md: row 4 marked done, a "What slice 4B left out" paragraph; docs regenerated astorb docsrequires.Tests
nativeEntries()without a mapping or a deferred entry fails it.BigIntproperty tests report zero differences for each operator and width..expected,.stderrand.exitfiles joinjs.allow(candidates above); no program ofjs.allowis removed.Acceptance criteria
mainwith the list naming only slice 5 and 7 entriesBigInt(10^6 cases per operator and width) report zero differencesjs.allowgrows by every candidate above that passes, at leastbuffer-list,interpolationandheap-order; each program left off is listed in the PR with its reasonjavascript_first.trbtorb format --checkandtorb docs checkgreentools/check-commits.shclean;sh tools/gates.sh aand theconformance-jsjob green in forge CI (CI only, no local bootstrap or gates)Seed
No syntax change and no new std name the compiler looks up; the manifest is read, and a change of it follows the two-commit rule. Split by the implementer if a review cannot hold it: the manifest walk with the deferred list first, then the width and intrinsic sweep with the property tests, both inside this issue.
Out of scope
Maps and sets (epic #55), floats and
libm(5), structured control flow (6), tasks (7),.nojsmarkers andtorb test(8), a minifier, source maps.Dependencies
#708 (slice 4A, landed as PR #718).
Part of #63 (epic; do not close it).
[loop:torbscript] claim implementation by session:loop-torbscript-20261113 until 2026-11-13T05:11:12Z
[loop:torbscript] checkpoint implementation (branch
loop/724-js-kernel-rest, nothing pushed yet).isSame, the design record update.[loop:torbscript] checkpoint 2 (implementer, #724)
tools/js-int-properties.mjs: 113,982,535 cases (seed 724, 10^6 random per operator and width, plus boundary pairs), 0 differences against BigInt for value, canonical form and panic text. A mutation check (an overflow check removed) is caught (8 differences), so the harness is sensitive. No defect found inint64.mjs..Runtime(symbol)entries plus the intrinsicsemitIntrinsicdoes not emit (floats, LazyForce).writer.trb(usesX flag),cli/build.trb(reads the new runtime file), because a new runtime part must be absent unless used (criterion 4).[loop:torbscript] checkpoint 3: the kernel runtime part and its oracle property scripts are written and clean (tools/js-int-properties.mjs: 113,982,535 cases, 0 differences; tools/js-kernel-properties.mjs: 639,174 checks, 0 differences, the mutation check detects faults). Next: natives.trb mappings, the usesKernel plumbing (writer, body, emit, cli/build), the deferred list, the manifest-walk test, docs. The compiler edits cannot be built in my exec, so CI is the check.
[loop:torbscript] checkpoint 4: natives.trb mappings, the usesKernel plumbing, the deferred list (tests/conformance/js.deferred) and the manifest-walk test (compiler/tests/js-natives.test.trb) are written. Next: js.allow candidates, the design record, commit, push, PR and CI. Note for the PR: criterion 1 holds with honest tags (5, 7, 8, 55, vm, unassigned) because many deferred natives belong to no numbered slice.
[loop:torbscript] checkpoint 5: PR #725 round 2 had 4 conformance programs red (buffer-list, cons-stack-persists, heap-order, interpolation). Round 3 pushed as
d4d8ec9a: interpolated Char and Void now go through torb_show_char / "void" (cause of the223and the empty line); a retained slot now hands a copy of its own to the new holder (suspected cause of the aliasing). Waiting for CI; any program still red will be taken off js.allow and listed in the PR.ArrayList, the hash tables and the tries onBuffer#55[loop:torbscript] claim implement by session:loop-torbscript-20261113 until 2026-11-13T08:00:00Z
PR #725 at
40720250: tier A, tier B and tools/release-sync are red (run 2635 jobs 5, 6, 7); a fix worker reads the failures and pushes a fix round to loop/724-js-slice-4b.[loop:torbscript] implementation: fix round for PR #725 at
40720250found no code defect, so nothing was pushed (head unchanged).context canceledfrom the runner, not with a test failure. The forge job logs (tasks 12572, 12573, 12574) show every test that ran as passing (release-sync: 66 passed, 0 failed (5 files); tier A and B had no FAIL line; tier B was in the runtime tests when the runner cancelled it). The three jobs were killed at 01:32:20 to 01:32:45Z, within seconds of each other. The same cancel hit an unrelated PR: #723 run #2633 tier A (task 12556) endedcontext canceledat 01:32:57Z. In the same run, bootstrap, conformance (JavaScript under Node.js), every host emits the same C and the playground are green on40720250, so js.allow stays as it is.[loop:torbscript] release implement: no code fault found in the red jobs (runner
context canceledat 01:32Z, also hit #723); a clean CI run on40720250(#2644) is queued, nothing pushed, claim ends