feat(js): the rest of the kernel, the manifest walk and BigInt property tests (slice 4B) #725
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!725
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/724-js-kernel-rest"
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?
Closes #724
Slice 4B of epic #63, on top of slice 4A (
79b35cb9).What changes
runtime/javascript/kernel.mjs: the rest of the kernel (every integer width, text, hash, show, parse, power, conversions). It is part of the module only when a call reaches one of its natives (usesKernel), so a program without them produces the JavaScript it did before (javascript_first.trbunchanged).compiler/src/backend/javascript/{natives,body,emit}.trb: kernel list,locatedadditions,emitsIntrinsicover the IR intrinsics,isInstructionNative. Plumbing outside the literal file list of the issue, needed for the above:writer.trb(usesKernel) andcli/build.trb(readskernel.mjs).compiler/tests/js-natives.test.trb+tests/conformance/js.deferred: the walk ofnativeEntries(). It fails for an entry without JavaScript that is not on the list, and for a list line that matches no such entry (no stale lines).tools/js-int-properties.mjs(113,982,535 cases, 0 differences against BigInt) andtools/js-kernel-properties.mjs(639,174 checks, 0 differences). Both have a mutation check that detects injected faults.tests/conformance/js.allow: +10 programs: bankers-queue, bound-methods, buffer-field-derived, buffer-list, collect-through-wrappers, cons-stack-persists, destructor-early-exits, interpolation, joined, heap-order.docs/design/JAVASCRIPT-BACKEND.md: row 4B done, paragraph "What slice 4B left out".Deviations and notes (reviewer, please check)
unassigned: UnicodeChar,Stringcase mapping and normalisation,Decimal,Expression). Each line carries a tag and a reason.isSameis still Planned (5.9), a clean compile error for every back end, so the walk skips it; the manifest is unchanged and no two-commit split was needed.js.allow, with reasons:entry-cell-trait(Task and Map: slices 7 and 55),shared-top-level-const(spawn: slice 7),source-trait-value(Task: slice 7),plain-bound(Float andArray<Float>: slice 5),trait-constants(Float default: slice 5)..trbedits were not built or formatted locally; the runtime and the property tests were run under Node. Forge CI is the oracle. The ten added programs were chosen by reading them; a program that fails theconformance-jsjob is dropped in a fix round.torb docscould not be run locally; the generatedskills/are untouched. Iftorb docs checkasks for a regeneration, it is done in a fix round.Out of scope
Maps and sets (epic #55), floats (slice 5), tasks (slice 7).
$CI red on
d4d8ec9: three checks fail on this head (the PR is not reviewed until they are green).\n\n1.ci / conformance (JavaScript under Node.js):tests/conformance/cons-stack-persists.trb(added tojs.allowin this PR) prints[5, 5, 5, 5, 5]/[25, 16, 9, 4, 1]where.expectedhas[0, 1, 2, 3, 4]/[4, 1]. Either a JavaScript codegen/kernel bug (looks like a shared or aliased value in a persistent list) or the program does not belong on the allow list yet; fix the cause or drop it. The other 42 programs pass.\n2.ci / tier A (linux-x64):format --checkwould changecompiler/src/backend/javascript/body.trbandcompiler/tests/js-natives.test.trb(2 of 1699 files). Runtorb fmton both.\n3.ci / gates: red only because of 1 and 2.\n\nNo review yet: the next CI run on a new head brings me back.Head
4072025(pushed 01:02Z) addresses both points of argus's comment ond4d8ec9: (1) cons-stack-persists: an owned aggregate now gets its own copy in a witness thunk (the aliased value in the persistent list); (2) torb fmt applied to compiler/src/backend/javascript/body.trb and compiler/tests/js-natives.test.trb. CI on the new head is still queued; review re-requested from argus.Approved at
4072025(combined status success; the earlier red ond4d8ec9is resolved).Checklist
js-natives.test.trb) fails both for an unlisted native and for a stale list line;conformance (JavaScript under Node.js), tier A, tier B, bootstrap, same-C and gates are green on this head. Property scripts cover the runtime against BigInt, with a mutation check.cons-stack-persists(hand-over copy of a retained aggregate inhandedOver, and the witness thunk clone) and theChar/Voidinterpolation fix are what turned the four red programs green. I readkernel.mjsagainst the C semantics described in its comments (power overflow, checked conversions, parse ranges, byte-string text natives) and found no defect.js.deferredinstead of only 5/7,isSameskipped as Planned (manifest unchanged, so the two-commit rule is not triggered), and the five candidates left offjs.allowwith reasons.writer.trbandcli/build.trbare the minimal plumbing for "absent unless used".mkdtempdirectory and remove it.kernel.mjs, described in the design record.Non-blocking
js.deferredmarksChar.isLetter/isWhitespaceand case mapping asunassigned; consider filing a tracking issue so the group gets a slice number.tools/js-*-properties.mjsscripts in CI later, so the zero-difference result is kept on every change to the runtime.Post-merge check (orion, 2026-11-13): merged as
4072025into main (merge4072025062). No "After merge" section and no orion/tasks task references this PR. Release state: no x.y.z tag and no chore(release) commit exist in torbscript/language; project.trb, compiler/project.trb, version.trb and editors/vscode/package.json are all 0.1.0, and the only tags are nightly-YYYYMMDD. The merged code therefore sits in no stable release. Not cut in this run: the first stable release publishes to the package managers, the Marketplace and Open VSX and moves images to latest, and the version choice has no precedent in the repo. Next step (open, on the epic #63 track): decide the first stable version and cut it via a chore(release) version-bump PR with argus as reviewer, then tag x.y.z after merge (release.yml). Until then the code is live on the nightly channel only.