Commit graph

246 commits

Author SHA1 Message Date
Sebastian Herrlinger
df26d7b266 Merge branch 'rust-gc-incremental' into codemode-rust-gc 2026-11-19 16:06:34 +01:00
Sebastian Herrlinger
3b47c29619 docs(codemode): record the psychoscript collector trials 2026-11-19 16:05:32 +01:00
Sebastian Herrlinger
3f47c98dc6 refactor(codemode): keep the incremental collector's hooks small for short runs
Allocation paths ask the collector for a freed slot rather than handing
it the object, so every allocation no longer builds its object in
memory first, and a reused slot's placeholder is replaced without drop
code. The heap's mark state is held inline, and the strings' collector
state is made only once a run passes its first threshold, so a short
run allocates nothing for the collector.
2026-11-19 15:53:16 +01:00
Sebastian Herrlinger
344e66c398 feat(codemode): bound incremental collector pauses with snapshot marking and chunked tracing
Replace the incremental-update barrier and its atomic finish with a
snapshot-at-the-beginning barrier: the first write to an object while
marking traces it before the write, cell writes shade the value they
overwrite, objects made while marking are black, and marking ends when
nothing is grey, with no rescan of the roots.

Count marking work in slots and trace long properties, elements and
entries a chunk at a time. Pay for no idle allocations at a cycle's
start, set the next threshold from the data live when marking ended,
and share the room between the arenas so the threshold holds.
2026-11-19 15:15:54 +01:00
Sebastian Herrlinger
0b343bbade Merge branch 'codemode-rust-gc' into rust-gc-incremental 2026-11-19 14:35:30 +01:00
Sebastian Herrlinger
329bd866f2 test(codemode): keep the many-heaps benchmark on the small programs 2026-11-19 14:34:53 +01:00
Sebastian Herrlinger
8b899e1b58 test(codemode): add a large live set to the memory benchmark 2026-11-19 14:34:40 +01:00
Sebastian Herrlinger
2871ed66a8 fix(codemode): bound incremental collector pauses on atoms and rewritten objects 2026-11-19 14:28:05 +01:00
Sebastian Herrlinger
073cbeb11f feat(codemode): add an incremental mark-sweep collector behind gc-incremental 2026-11-19 14:17:24 +01:00
Sebastian Herrlinger
6ca5dee148 test(codemode): add a memory benchmark for long-lived psychoscript runs 2026-11-19 13:13:15 +01:00
Sebastian Herrlinger
12c095410f docs(codemode): shorten the psychoscript pull request description 2026-11-19 03:43:30 +01:00
Sebastian Herrlinger
d986881b09 docs(codemode): move threading and reference observations into the README 2026-11-19 03:43:30 +01:00
Sebastian Herrlinger
2b150b4654 docs(codemode): describe how runs use threads 2026-11-19 03:34:51 +01:00
Sebastian Herrlinger
ba616f357a docs(codemode): refresh bench results after threading by nesting 2026-11-19 03:34:27 +01:00
Sebastian Herrlinger
47bf86e198 test(codemode): bench programs as futures with --async 2026-11-19 03:32:56 +01:00
Sebastian Herrlinger
34d2637981 feat(codemode): move long stretches of a run's compute to a worker thread, keeping host code on the executor 2026-11-19 03:32:56 +01:00
Sebastian Herrlinger
15a0948a0d refactor(codemode): runs own their module list and source, so a run outlives its caller's borrow 2026-11-19 03:24:13 +01:00
Sebastian Herrlinger
0e3de44007 refactor(codemode): size compile threads by a conservative nesting scan, not source size 2026-11-19 03:22:37 +01:00
Sebastian Herrlinger
3b682d0d93 refactor(codemode): make a run's state Send 2026-11-19 03:20:54 +01:00
Sebastian Herrlinger
cf1d29b111 test(codemode): measure the native stack compiling and re-entrant calls need 2026-11-19 03:20:02 +01:00
Sebastian Herrlinger
6f0711a1d7 docs(codemode): no surrogate difference is left in the README and the pull request description 2026-11-19 03:11:19 +01:00
Sebastian Herrlinger
c01c31121e feat(codemode): keep unpaired surrogates in namespace paths, error names, RegExp sources, bindings, metadata and durable data 2026-11-19 03:11:19 +01:00
Sebastian Herrlinger
7bddc79372 feat(codemode): keep unpaired surrogates in diagnostics and host failures 2026-11-19 03:02:33 +01:00
Sebastian Herrlinger
fef0d2ba28 docs(codemode): describe the lossless result and logs in the README and the pull request description 2026-11-19 02:53:56 +01:00
Sebastian Herrlinger
9257f8889f feat(codemode): keep unpaired surrogates in the result and the logs (Data, HostString) 2026-11-19 02:53:56 +01:00
Sebastian Herrlinger
f679776772 perf(codemode): make a namespace path a small heap object, spelled out only when a call needs it 2026-11-19 02:47:59 +01:00
Sebastian Herrlinger
fb3bec4ad9 docs(codemode): drop the closed differences from the README and the pull request description 2026-11-19 02:41:41 +01:00
Sebastian Herrlinger
6cfcfcf628 feat(codemode): cross strings to the host losslessly, unpaired surrogates included (HostString) 2026-11-19 02:41:41 +01:00
Sebastian Herrlinger
4c7e4da0d7 fix(codemode): give each read of a namespace path a new reference, as the reference does 2026-11-19 02:41:40 +01:00
Sebastian Herrlinger
d7829cc4d9 chore(codemode): format the streaming generator and its array frames 2026-11-19 02:24:27 +01:00
Sebastian Herrlinger
7df0f9074e test(codemode): keep another platform's cases in the current format, and fail when they need a run there 2026-11-19 02:24:27 +01:00
kommander
0a8fd7250b test(codemode): regenerate the Linux-only libm cases through the language runtime 2026-11-19 01:22:22 +00:00
Sebastian Herrlinger
8943a0a540 test(codemode): bound the streaming busy loops by wall-clock time, so a resumed run leaves them at once 2026-11-19 02:17:01 +01:00
Sebastian Herrlinger
e9e4e1ecad test(codemode): skip round trips after a large state in proportion to its size, as the reference does 2026-11-19 02:09:50 +01:00
Sebastian Herrlinger
4f456097f8 perf(codemode): count the frames toward the call-stack limit as they are pushed, not on every call past it 2026-11-19 02:09:50 +01:00
Sebastian Herrlinger
d76f81bdc0 docs(codemode): write the description of the eventual psychoscript pull request 2026-11-19 01:55:19 +01:00
Sebastian Herrlinger
52b73e3e03 test(codemode): say what a resume the state can't make records in the streaming recording 2026-11-19 01:55:19 +01:00
Sebastian Herrlinger
d4f4efab9e chore(codemode): record the bench against the reference's language runtime 2026-11-19 01:55:19 +01:00
Sebastian Herrlinger
04e3d5b5a0 chore(codemode): compare the Rust bench with the reference's language runtime 2026-11-19 01:54:19 +01:00
Sebastian Herrlinger
13f55e1b36 docs(codemode): describe the Rust crate as the language layer, with its API and parity 2026-11-19 01:54:19 +01:00
Sebastian Herrlinger
6d7e96a399 refactor(codemode): make the Rust crate the language layer only
The crate becomes the Rust implementation of the reference's language layer (`src/language/`): its public API is
the Rust form of `Language` (`Runtime::make` with `globals(run)`, modules, limits and translation; `HostFunction`
for `Host.fn` with sync, async and sync-thenable types, idempotent, constructible and takes-functions;
`DurableFunction`; `Namespace`; `Failure` for `Host.fail` and `Host.missing`; `Run` with its metadata; programs,
suspend and resume; snapshots). Code Mode (tools, schemas, the catalog, `search`, OpenAPI, hooks, max tool calls,
extensions) is removed, and the language files move from `src/language/` to `src/`.

Host calls follow the reference's language runtime: arguments cross under the runtime's translation (functions and
promises fail the call unless dropped or awaited), a function from a result crosses back only to a function that
takes functions, async and durable calls start at the next handover, sync work can block (`Returned::Block`) or
stay pending (`Returned::Pending`), and a suspend is refused while a call that can't be detached runs. Namespace
paths carry their root label, and their `keys` may fail. Snapshots save the run's metadata and its calls by global
path, and restart them by resolving that path again.

The replays define the generators' host globals (`conformance/reference.rs` shares `tools` with
`conformance/reference.ts`): the cases, `host.json`, `boundary.json` and `streaming.json`. `tests/host.rs` mirrors
the reference's `test/language.test.ts`; the API tests are ported, and the Code Mode tests are removed.
2026-11-19 01:54:11 +01:00
Sebastian Herrlinger
88ff918816 test(codemode): record namespace paths without comparing their identity 2026-11-19 01:53:46 +01:00
Sebastian Herrlinger
0c91fc1516 chore(codemode): format the language-layer generators 2026-11-19 01:53:46 +01:00
Sebastian Herrlinger
68af5876c5 chore(codemode): run the reference bench programs through the language runtime 2026-11-19 01:53:46 +01:00
Sebastian Herrlinger
5c11644089 test(codemode): record the boundary and configuration from the language runtime, drop the catalog and OpenAPI recordings 2026-11-19 01:53:46 +01:00
Sebastian Herrlinger
5d0ac6c8b2 test(codemode): record host-function behaviour from the language layer instead of tool calls 2026-11-19 01:53:46 +01:00
Sebastian Herrlinger
5208cfd308 test(codemode): record streaming and crossings through the reference's language runtime 2026-11-19 01:53:45 +01:00
Sebastian Herrlinger
1d250bc759 test(codemode): record the conformance cases through the reference's language runtime 2026-11-19 01:53:45 +01:00
Sebastian Herrlinger
e072d3c69c test(codemode): regenerate the streaming recording with unsupported syntax at run time 2026-11-19 00:29:56 +01:00
Sebastian Herrlinger
3cf39e761d test(codemode): record unsupported syntax at run time and acorn's parse errors from the reference
Programs in frames/core.ts record, with message and location, unsupported syntax that
runs or is never reached (classes, with, debugger, new.target, import.meta, super,
nested exports), the bindings it hides, using declarations, nested imports, names
located inside parentheses, and parse errors in acorn's words; a suspension reaches
unsupported syntax after resuming. New cases record values around it, and the api
test checks the suggestion, which the recordings do not capture. streaming.json is
to be regenerated at integration.
2026-11-19 00:28:20 +01:00