Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
264 commits
Select commit Hold shift + click to select a range
e85916a
perf(codemode): make host globals and run ids only when a run uses them
kommander Nov 17, 2026
3c05dab
Merge the CI move into the host API work
kommander Nov 17, 2026
2a932f1
fix(codemode): convert functions, generators and iterators through To…
kommander Nov 17, 2026
3afec0d
fix(codemode): evaluate new arguments before checking the constructor
kommander Nov 17, 2026
e70845f
fix(codemode): evaluate the right side of o.x = v before checking o
kommander Nov 17, 2026
d4bb174
fix(codemode): delete on a primitive base is true unless the wrapper …
kommander Nov 17, 2026
58579fc
fix(codemode): match JS in built-in object details
kommander Nov 17, 2026
0c5a6a6
fix(codemode): let in find an array hole's inherited index
kommander Nov 17, 2026
3dbee2a
fix(codemode): convert Array arguments, lengths and sort elements thr…
kommander Nov 17, 2026
230d462
fix(codemode): parse Unicode 17 identifiers with acorn 8.16
kommander Nov 17, 2026
5880f79
feat(codemode): add OpenAPI tools to the Rust port
kommander Nov 17, 2026
c199fd9
chore(codemode): regenerate the catalog expectations in the conforman…
kommander Nov 17, 2026
005e480
feat(codemode): let a tool interrupt its whole run
kommander Nov 17, 2026
01a9a97
fix(codemode): word the timeout diagnostic as the reference does
kommander Nov 17, 2026
87ea80e
feat(codemode): report unhandled rejections as warnings
kommander Nov 17, 2026
efc462d
test(codemode): cover the warnings output budget
kommander Nov 17, 2026
014d0d9
fix(codemode): match the reference on 3.0 keywords, moved references …
kommander Nov 17, 2026
fccbad7
feat(codemode): add RegExp and regex-aware String methods
kommander Nov 17, 2026
7dd5025
feat(codemode): add String normalize, raw, isWellFormed and toWellFormed
kommander Nov 17, 2026
2a7c0b5
feat(codemode): add Date
kommander Nov 17, 2026
98bcf10
feat(codemode): add Uint8Array, Buffer, TextEncoder, TextDecoder, ato…
kommander Nov 17, 2026
5cdf1dd
feat(codemode): add Iterator helpers, WeakMap, WeakSet, groupBy and S…
kommander Nov 17, 2026
00964d8
fix(codemode): reject non-object receivers in Object.prototype methods
kommander Nov 17, 2026
ebb15ae
feat(codemode): add URI functions, toExponential, Math.sumPrecise, f1…
kommander Nov 17, 2026
aa0cd87
feat(codemode): add URL, URLSearchParams, Headers, crypto and structu…
kommander Nov 17, 2026
bb78f23
perf(codemode): install the larger built-in groups only when a run us…
kommander Nov 17, 2026
b43925d
fix(codemode): match JavaScriptCore's Math.hypot
kommander Nov 17, 2026
ae6c0c3
refactor(codemode): expose URL and Headers constructors to the crate
kommander Nov 17, 2026
f4d4236
perf(codemode): resume generators on the dispatch loop
kommander Nov 17, 2026
654615c
fix(codemode): stop ToNumber panicking on a non-ASCII string
kommander Nov 17, 2026
5147e8b
perf(codemode): append concatenations in place
kommander Nov 17, 2026
7a3d2e1
feat(codemode): add async generators and for await
kommander Nov 17, 2026
a74841f
fix(codemode): give function kinds their own prototypes, like the ref…
kommander Nov 17, 2026
eddd08c
fix(codemode): reject circular values and Promise.race([]) like the r…
kommander Nov 17, 2026
3fa2858
feat(codemode): add tagged templates
kommander Nov 17, 2026
0f359cf
fix(codemode): bind programs as scripts and fix loop and parameter sc…
kommander Nov 17, 2026
2c04a01
test(codemode): adapt the reference's language tests as lang- cases
kommander Nov 17, 2026
bcb2ddf
fix(codemode): guard opaque operands and word iteration errors like t…
kommander Nov 17, 2026
01ba82d
fix(codemode): one arguments object per call, keys converted once
kommander Nov 17, 2026
b4c5085
test(codemode): drop test262 files that RegExp and tagged templates n…
kommander Nov 17, 2026
5c40e4a
feat(codemode): carry dates, URLs, headers, bytes and RegExps across …
kommander Nov 17, 2026
b8f7c5a
feat(codemode): suspend and resume runs from snapshots
kommander Nov 17, 2026
7a73a24
chore(codemode): check Rust conformance in round-trip mode in CI
kommander Nov 17, 2026
e4c7371
feat(codemode): real array holes
kommander Nov 17, 2026
1449a5f
perf(codemode): skip the exotic JSON hook until a run can hold such a…
kommander Nov 17, 2026
e690e3b
fix(codemode): throw when a built-in accessor is read off its prototype
kommander Nov 17, 2026
3767364
fix(codemode): match the reference's host for Math.sumPrecise and **
kommander Nov 17, 2026
98653cb
feat(codemode): add console.table
kommander Nov 17, 2026
ff6da3f
fix(codemode): resolve \k to whichever duplicate named group matched
kommander Nov 17, 2026
f304df0
fix(codemode): reject Promise combinators whose input cannot be iterated
kommander Nov 17, 2026
1b65246
fix(codemode): let a function's name and length be deleted, and name …
kommander Nov 17, 2026
a5b41a5
feat(codemode): stream HTTP responses to programs through extensions
kommander Nov 17, 2026
03066b4
fix(codemode): delete, arguments, await names and iterator errors mat…
kommander Nov 17, 2026
c851e00
fix(codemode): keep the clock across round trips and make round-trip …
kommander Nov 17, 2026
19bfb0d
fix(codemode): name the callee in call errors, as the reference does
kommander Nov 17, 2026
29915a5
fix(codemode): assigning undefined fails like assigning a constant
kommander Nov 17, 2026
493240e
fix(codemode): match the reference's Array methods on frozen arrays, …
kommander Nov 17, 2026
2c721e5
feat(codemode): collate localeCompare like the reference's host
kommander Nov 17, 2026
d0ea5e8
feat(codemode): keep lone surrogates in strings
kommander Nov 17, 2026
d1cffe8
fix(codemode): word RegExp syntax errors as the reference's host does
kommander Nov 17, 2026
e10ecb8
fix(codemode): read 2^32 - 1 and above on an array as plain keys
kommander Nov 17, 2026
6c2724c
fix(codemode): new Map and Object.fromEntries reject a non-entry as t…
kommander Nov 17, 2026
a302fac
fix(codemode): iterator helpers name the call that made a record whos…
kommander Nov 17, 2026
3d0b1a1
fix(codemode): a program may name things await and still await at the…
kommander Nov 17, 2026
85ad951
fix(codemode): start streaming reads where the reference's fuel runs out
kommander Nov 17, 2026
54f0d1e
feat(codemode): hold huge sparse arrays
kommander Nov 17, 2026
22e185b
fix(codemode): keep lone surrogates in a streaming response's json()
kommander Nov 17, 2026
8ce9b4d
fix(codemode): spend the prelude's fuel in array, collection and set …
kommander Nov 17, 2026
7d3902f
fix(codemode): spend the prelude's fuel in sorts, bytes, replace and …
kommander Nov 17, 2026
102a3b1
fix(codemode): spend the prelude's fuel in the iterator helpers
kommander Nov 17, 2026
904a3f7
fix(codemode): spend the reference's fuel in Promise combinators and …
kommander Nov 17, 2026
b9faee4
fix(codemode): spend the reference's fuel converting objects to primi…
kommander Nov 17, 2026
4b60c4b
perf(codemode): keep the prelude's fuel cheap on the callback paths
kommander Nov 17, 2026
fc824d4
fix(codemode): a custom iterator's native next costs a call
kommander Nov 17, 2026
b7d45bc
fix(codemode): step a built-in iterator a custom Symbol.iterator retu…
kommander Nov 17, 2026
f66f9b6
fix(codemode): convert a native's listed values as the reference's $v…
kommander Nov 17, 2026
2cab125
fix(codemode): spend the reference's fuel in for await over sync iter…
kommander Nov 17, 2026
572aa2e
fix(codemode): convert the default sort's values as one list
kommander Nov 17, 2026
d96b76b
fix(codemode): stringify through the walk after 2,048 revisits of sha…
kommander Nov 17, 2026
bd4f8b7
chore(codemode): let compare.sh run on macOS
kommander Nov 17, 2026
76262a1
test(codemode): regenerate the benchmark results
kommander Nov 17, 2026
aa166bc
perf(codemode): skip the suspend bookkeeping when a built-in calls back
kommander Nov 17, 2026
6f7986e
feat(codemode): await promises nested in what crosses to the host
kommander Nov 17, 2026
c06b887
fix(codemode): a crossing's depth error costs no fuel
kommander Nov 17, 2026
a7f1c10
fix(codemode): JSON.stringify stops at the reference's depths
kommander Nov 17, 2026
1f08a7a
chore(codemode): say the Rust bench tools validate the reference's sc…
kommander Nov 17, 2026
36a9080
fix(codemode): enter promise handlers at the reference's cost
kommander Nov 18, 2026
25d9215
test(codemode): record tool calls with invalid input from the reference
kommander Nov 18, 2026
5174c6a
feat(codemode): run array callbacks in resumable native frames
kommander Nov 18, 2026
132b030
feat(codemode): run sorts, iteration and promise jobs in native frames
kommander Nov 18, 2026
ddf53d8
feat(codemode): run more callback built-ins in native frames
kommander Nov 18, 2026
38be59b
feat(codemode): run iterator consumers in native frames
kommander Nov 18, 2026
3f11192
feat(codemode): run JSON revivers and call/apply in native frames
kommander Nov 18, 2026
88e9f8d
test(codemode): check libm-dependent pow and hypot cases on Linux only
kommander Nov 18, 2026
c2f375a
test(codemode): record streaming programs independent of machine speed
kommander Nov 18, 2026
2d04847
refactor(codemode): give built-in families their own native frame ops
kommander Nov 18, 2026
8e483c3
feat(codemode): resume a generator with throw from a native frame
kommander Nov 18, 2026
975591d
feat(codemode): let for-of frames call after the loop and see a gener…
kommander Nov 18, 2026
90a252f
feat(codemode): iterate the program's iterators in native frames
kommander Nov 18, 2026
c18a830
feat(codemode): run Uint8Array callbacks and iterable sources in nati…
kommander Nov 18, 2026
95847e8
refactor(codemode): collect Uint8Array sources the VM iterates itself…
kommander Nov 18, 2026
c1db342
feat(codemode): run iterator helpers' next and return in native frames
kommander Nov 18, 2026
ba5784e
fix(codemode): name iterator helper errors as the reference does
kommander Nov 18, 2026
66a5c99
feat(codemode): step take, drop and Iterator.from over built-in itera…
kommander Nov 18, 2026
f0eaf2c
feat(codemode): run collection built-ins that call the program in nat…
kommander Nov 18, 2026
be19252
feat(codemode): ask a built-in has without a frame in the Set methods
kommander Nov 18, 2026
1372ed9
fix(codemode): run then, catch and finally of search results as the p…
kommander Nov 18, 2026
4398e5b
feat(codemode): read the iterables of fromEntries, AggregateError, su…
kommander Nov 18, 2026
1c9b6f5
feat(codemode): run JSON.stringify's internal walk in a native frame
kommander Nov 18, 2026
d6709ca
fix(codemode): leave a native frame's handlers to the VM when a gener…
kommander Nov 18, 2026
fda6f2d
fix(codemode): park a search inside a sync generator up to the neares…
kommander Nov 18, 2026
f84a4f9
feat(codemode): let a tool call, search or crossing hand off to a nat…
kommander Nov 18, 2026
a7d43a3
feat(codemode): convert with the program's valueOf and toString in na…
kommander Nov 18, 2026
3791ff2
feat(codemode): park a search across running generators
kommander Nov 18, 2026
fec3686
refactor(codemode): enter native frames in place and step built-in so…
kommander Nov 18, 2026
7bdbb10
refactor(codemode): keep the JSON.stringify walk's keys in its frame …
kommander Nov 18, 2026
71de733
test(codemode): record search parked inside running sync generators
kommander Nov 18, 2026
18913ef
feat(codemode): run yield* and for await calls into the program in na…
kommander Nov 18, 2026
31a124d
test(codemode): record yield* and for await over the program's iterators
kommander Nov 18, 2026
e077d7a
feat(codemode): park a search inside an async generator's frame
kommander Nov 18, 2026
4faf343
feat(codemode): call a crossing's toJSON from a native frame
kommander Nov 18, 2026
fb75dca
refactor(codemode): take arithmetic slow paths out of the dispatch loop
kommander Nov 18, 2026
64be1f3
feat(codemode): park a search inside the program result's toJSON
kommander Nov 18, 2026
4e653c1
fix(codemode): spend the reference's fuel on abrupt requests through …
kommander Nov 18, 2026
161cc82
test(codemode): record fuel of abrupt requests through yield* and for…
kommander Nov 18, 2026
6802757
fix(codemode): mark an async generator's parked frames after splittin…
kommander Nov 18, 2026
e73f259
feat(codemode): resume a sync generator's throw and return from the a…
kommander Nov 18, 2026
77e3136
feat(codemode): convert Object.groupBy keys from its frame, each afte…
kommander Nov 18, 2026
b9037a2
feat(codemode): convert Object.fromEntries keys and URLSearchParams a…
kommander Nov 18, 2026
62010c3
fix(codemode): end the failed-conversion message with a period, as th…
kommander Nov 18, 2026
7c7c332
test(codemode): record conversions with no primitive to give
kommander Nov 18, 2026
2a974f8
chore(codemode): regenerate bench results after native frames
kommander Nov 18, 2026
8818f5b
refactor(codemode): write an integer's digits and take an integer rem…
kommander Nov 18, 2026
44a75c4
refactor(codemode): hash Map and Set keys as one mixed word, with one…
kommander Nov 18, 2026
0d9e35f
refactor(codemode): look up a Map's or Set's properties without the e…
kommander Nov 18, 2026
b9d0670
refactor(codemode): keep short strings in one shared buffer
kommander Nov 18, 2026
9953535
fix(codemode): let 10,000 frames run above the program, as the refere…
kommander Nov 18, 2026
d507a59
test(codemode): record the call depth limit and its RangeError
kommander Nov 18, 2026
ecadfe2
chore(codemode): regenerate bench results after the Map/Set and strin…
kommander Nov 18, 2026
1361c6f
chore(codemode): write conformance recordings one entry per line
kommander Nov 18, 2026
0113bd7
chore(codemode): mark conformance recordings as generated
kommander Nov 18, 2026
ff703af
test(codemode): keep one busy-loop fuel case per cost rule
kommander Nov 18, 2026
0591fe8
refactor(codemode): let the prelude for...of helper only collect its …
kommander Nov 18, 2026
462f1b8
test(codemode): regenerate the recordings from the rebased reference
kommander Nov 18, 2026
dc8b931
test(codemode): expect queued jobs to wait for a search inside a gene…
kommander Nov 18, 2026
b159f92
feat(codemode): let an extension global be constructible
kommander Nov 18, 2026
cf1e148
feat(codemode): let each run pick which of the runtime's extensions i…
kommander Nov 18, 2026
0701c66
feat(codemode): let an extension name the modules that load its globals
kommander Nov 18, 2026
94cdd6f
fix(codemode): say why an import can't be resolved
kommander Nov 18, 2026
05c6497
fix(codemode): say where an import that can't be resolved failed
kommander Nov 18, 2026
beda448
test(codemode): record extension configuration from the reference
kommander Nov 18, 2026
b0407dc
test(codemode): resume a run with the extensions it picked
kommander Nov 18, 2026
f43cced
docs(codemode): list per-run extensions, module names and constructib…
kommander Nov 18, 2026
5e7afe1
fix(codemode): cross host-call arguments as the reference's toHost does
kommander Nov 18, 2026
d8f218b
fix(codemode): start a streaming response's operations when they are …
kommander Nov 18, 2026
a890120
fix(codemode): keep an error's own name among its host copy's fields
kommander Nov 18, 2026
71a99f6
test(codemode): record host-call argument cases from the reference
kommander Nov 18, 2026
e941709
test(codemode): mirror the reference's host-call argument tests
kommander Nov 18, 2026
96a6567
fix(codemode): count a host call wait's loop back-edge as bytecode does
kommander Nov 18, 2026
0514a86
fix(codemode): let a synchronous host call wait only from a frame the…
kommander Nov 18, 2026
b97c413
fix(codemode): match the reference's callback rules and messages in b…
kommander Nov 18, 2026
e8fafb8
fix(codemode): fail a host call whose saved value had no data form on…
kommander Nov 18, 2026
eea63a8
test(codemode): regenerate the recordings with dev's extension and ho…
kommander Nov 18, 2026
7b10229
refactor(codemode): put the crate's modules in a language layer and a…
kommander Nov 18, 2026
44500d0
refactor(codemode): give each layer its own shared types
kommander Nov 18, 2026
8b5ba7f
refactor(codemode): let the language layer see a run's suspenders onl…
kommander Nov 18, 2026
2a9405d
refactor(codemode): keep the language layer from depending on Code Mode
kommander Nov 18, 2026
f2f3a08
refactor(codemode): name a tool or an array method only when a messag…
kommander Nov 18, 2026
fdabc8d
docs(codemode): describe the crate's language and Code Mode layers
kommander Nov 18, 2026
a31e7f5
fix(codemode): convert a namespace or a promise without calling its m…
kommander Nov 18, 2026
a56513f
fix(codemode): reject String method arguments that are still not data
kommander Nov 18, 2026
84d9ab3
fix(codemode): take enumeration sources and property bases as the ref…
kommander Nov 18, 2026
1bfc8f6
fix(codemode): read namespace paths and nullish bases as the referenc…
kommander Nov 18, 2026
f2eb1ac
fix(codemode): word the two symbols as the reference's host does
kommander Nov 18, 2026
9f4fca2
fix(codemode): refuse built-in inputs as the reference does
kommander Nov 18, 2026
9a6b18d
test(codemode): record the fuel of namespace and promise conversions …
kommander Nov 18, 2026
9e87d3b
fix(codemode): check prototype method receivers and arguments in the …
kommander Nov 18, 2026
505a33d
test(codemode): regenerate the streaming recording with the boundary …
kommander Nov 18, 2026
a0ab788
fix(codemode): refuse calling the namespace itself and hide an uncaug…
kommander Nov 18, 2026
93abe8d
fix(codemode): let then name a namespace path, and never take a names…
kommander Nov 18, 2026
a20402a
fix(codemode): read destructured promises as the reference does and r…
kommander Nov 18, 2026
7ae50ea
fix(codemode): check the member an update or compound assignment writ…
kommander Nov 18, 2026
790c34e
test(codemode): record destructured promises, error locations and che…
kommander Nov 18, 2026
fcc9ebc
test(codemode): record unknown-tool suggestions and regenerate the st…
kommander Nov 18, 2026
603c565
fix(codemode): throw unsupported syntax where it runs instead of refu…
kommander Nov 18, 2026
fedd6bd
fix(codemode): bind and run what never-run syntax hides as the refere…
kommander Nov 18, 2026
84af887
fix(codemode): word and locate parse errors as the reference does
kommander Nov 18, 2026
3cf39e7
test(codemode): record unsupported syntax at run time and acorn's par…
kommander Nov 18, 2026
e072d3c
test(codemode): regenerate the streaming recording with unsupported s…
kommander Nov 18, 2026
1d250bc
test(codemode): record the conformance cases through the reference's …
kommander Nov 18, 2026
5208cfd
test(codemode): record streaming and crossings through the reference'…
kommander Nov 18, 2026
5d0ac6c
test(codemode): record host-function behaviour from the language laye…
kommander Nov 19, 2026
5c11644
test(codemode): record the boundary and configuration from the langua…
kommander Nov 19, 2026
68af587
chore(codemode): run the reference bench programs through the languag…
kommander Nov 19, 2026
0c91fc1
chore(codemode): format the language-layer generators
kommander Nov 19, 2026
88ff918
test(codemode): record namespace paths without comparing their identity
kommander Nov 19, 2026
6d7e96a
refactor(codemode): make the Rust crate the language layer only
kommander Nov 19, 2026
13f55e1
docs(codemode): describe the Rust crate as the language layer, with i…
kommander Nov 19, 2026
04e3d5b
chore(codemode): compare the Rust bench with the reference's language…
kommander Nov 19, 2026
d4f4efa
chore(codemode): record the bench against the reference's language ru…
kommander Nov 19, 2026
52b73e3
test(codemode): say what a resume the state can't make records in the…
kommander Nov 19, 2026
d76f81b
docs(codemode): write the description of the eventual psychoscript pu…
kommander Nov 19, 2026
4f45609
perf(codemode): count the frames toward the call-stack limit as they …
kommander Nov 19, 2026
e9e4e1e
test(codemode): skip round trips after a large state in proportion to…
kommander Nov 19, 2026
8943a0a
test(codemode): bound the streaming busy loops by wall-clock time, so…
kommander Nov 19, 2026
0a8fd72
test(codemode): regenerate the Linux-only libm cases through the lang…
kommander Nov 19, 2026
7df0f90
test(codemode): keep another platform's cases in the current format, …
kommander Nov 19, 2026
d7829cc
chore(codemode): format the streaming generator and its array frames
kommander Nov 19, 2026
4c7e4da
fix(codemode): give each read of a namespace path a new reference, as…
kommander Nov 19, 2026
6cfcfcf
feat(codemode): cross strings to the host losslessly, unpaired surrog…
kommander Nov 19, 2026
fb3bec4
docs(codemode): drop the closed differences from the README and the p…
kommander Nov 19, 2026
f679776
perf(codemode): make a namespace path a small heap object, spelled ou…
kommander Nov 19, 2026
9257f88
feat(codemode): keep unpaired surrogates in the result and the logs (…
kommander Nov 19, 2026
fef0d2b
docs(codemode): describe the lossless result and logs in the README a…
kommander Nov 19, 2026
7bddc79
feat(codemode): keep unpaired surrogates in diagnostics and host fail…
kommander Nov 19, 2026
c01c311
feat(codemode): keep unpaired surrogates in namespace paths, error na…
kommander Nov 19, 2026
6f0711a
docs(codemode): no surrogate difference is left in the README and the…
kommander Nov 19, 2026
cf1d29b
test(codemode): measure the native stack compiling and re-entrant cal…
kommander Nov 19, 2026
3b682d0
refactor(codemode): make a run's state Send
kommander Nov 19, 2026
0e3de44
refactor(codemode): size compile threads by a conservative nesting sc…
kommander Nov 19, 2026
15a0948
refactor(codemode): runs own their module list and source, so a run o…
kommander Nov 19, 2026
34d2637
feat(codemode): move long stretches of a run's compute to a worker th…
kommander Nov 19, 2026
47bf86e
test(codemode): bench programs as futures with --async
kommander Nov 19, 2026
ba616f3
docs(codemode): refresh bench results after threading by nesting
kommander Nov 19, 2026
2b150b4
docs(codemode): describe how runs use threads
kommander Nov 19, 2026
d986881
docs(codemode): move threading and reference observations into the RE…
kommander Nov 19, 2026
12c0954
docs(codemode): shorten the psychoscript pull request description
kommander Nov 19, 2026
077c2bc
feat(codemode): compile a program once with runtime.compile and run i…
kommander Nov 19, 2026
9fcc72f
feat(codemode): Runtime::compile in psychoscript, recorded against th…
kommander Nov 19, 2026
d429852
test(codemode): bench plugin events from a compiled program and a 100…
kommander Nov 19, 2026
39eb332
docs(codemode): describe runtime.compile in the README and the pull r…
kommander Nov 19, 2026
121bf79
docs(codemode): refresh bench results with plugin events from a compi…
kommander Nov 19, 2026
ac73f25
test(codemode): record suspends of responses reachable only through a…
kommander Nov 19, 2026
dbd27f0
refactor(codemode): trace snapshot reachability from shared root and …
kommander Nov 19, 2026
5f1b9ad
test(codemode): add a memory benchmark for long-lived psychoscript runs
kommander Nov 19, 2026
151b8a8
test(codemode): add a large live set to the memory benchmark
kommander Nov 19, 2026
ef14524
test(codemode): keep the many-heaps benchmark on the small programs
kommander Nov 19, 2026
193d0b4
feat(codemode): collect garbage in long-lived psychoscript runs
kommander Nov 19, 2026
a2145a9
feat(codemode): free atoms that long-lived psychoscript runs no longe…
kommander Nov 19, 2026
8e7f707
fix(codemode): compact deleted Map and Set entries
kommander Nov 19, 2026
ccbc2f1
docs(codemode): describe the psychoscript collector in the README, PR…
kommander Nov 19, 2026
4023cfa
Merge remote-tracking branch 'origin/dev' into codemode-rust
kommander Nov 19, 2026
ead8cc3
feat(codemode-rust): getters and setters
kommander Nov 19, 2026
563db04
test(codemode-rust): record getters, setters and descriptors from the…
kommander Nov 19, 2026
064db7a
docs(codemode-rust): update the recording and test262 counts in PR.md
kommander Nov 19, 2026
7927b7f
Merge remote-tracking branch 'origin/dev' into codemode-rust
kommander Nov 19, 2026
0962708
feat(codemode-rust): classes, ported from #64965, and BYTES_PER_ELEME…
kommander Nov 19, 2026
0c6ec4e
fix(codemode-rust): define the built-ins' properties in the reference…
kommander Nov 19, 2026
ae487b3
test(codemode-rust): record host functions that built-ins call with g…
kommander Nov 19, 2026
c9fc80f
docs(codemode-rust): update the recording and test262 counts in PR.md
kommander Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ packages/core/src/**/*.txt text eol=lf
packages/httpapi-codegen/test/generated/*.ts text eol=lf
# The site tests compare source text and humans.txt byte for byte, so Windows checkouts keep LF.
services/site/** text=auto eol=lf
packages/codemode-rust/conformance/catalog.json linguist-generated=true
packages/codemode-rust/conformance/streaming.json linguist-generated=true
packages/codemode-rust/conformance/tools.json linguist-generated=true
packages/codemode-rust/conformance/cases/*.json linguist-generated=true
104 changes: 104 additions & 0 deletions .github/workflows/check-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,23 @@ jobs:
# Pull requests diff against the merge's first parent; pushes diff against the previous dev head.
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}

# The Rust port of codemode is checked in this job, on Linux, only when it or its TypeScript reference changed.
# Runs without a base to diff against (manual runs, the release gate, a new branch) check it always.
- name: Decide whether the codemode Rust checks run
id: codemode-rust
if: runner.os == 'Linux'
run: |
paths=(packages/codemode packages/codemode-rust .github/workflows/check-test.yml)
if [ "$AFFECTED" != "true" ] || ! git cat-file -e "${TURBO_SCM_BASE}^{commit}" 2>/dev/null; then
run=true
elif git diff --quiet "$TURBO_SCM_BASE" "$TURBO_SCM_HEAD" -- "${paths[@]}"; then
run=false
else
run=true
fi
echo "run=$run" >> "$GITHUB_OUTPUT"
echo "codemode Rust checks: $run"

- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
Expand Down Expand Up @@ -155,6 +172,93 @@ jobs:
working-directory: packages/protocol
run: bun run check:generated

# The toolchain, profile and components come from packages/codemode-rust/rust-toolchain.toml.
- name: Install Rust for codemode
if: runner.os == 'Linux' && steps.codemode-rust.outputs.run == 'true'
working-directory: packages/codemode-rust
run: rustup toolchain install --no-self-update

# One cache for the debug and release builds below.
- name: Cache codemode Rust builds
if: runner.os == 'Linux' && steps.codemode-rust.outputs.run == 'true'
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
shared-key: codemode-rust
key: ${{ hashFiles('packages/codemode-rust/rust-toolchain.toml') }}
workspaces: packages/codemode-rust -> target

- name: Check codemode Rust formatting, Clippy and tests
if: runner.os == 'Linux' && steps.codemode-rust.outputs.run == 'true'
timeout-minutes: 15
working-directory: packages/codemode-rust
run: |
cargo fmt --check
cargo clippy --locked --workspace --all-targets -- -D warnings
# Includes bench/tests/conformance.rs, which checks every conformance case against the reference outcome.
cargo test --locked --workspace

# Saves and restores every run at each host stop and after 64, 128, 256, ... loop iterations; outcomes must not
# change. Reuses the debug build of the step before and takes seconds.
- name: Check codemode Rust conformance in round-trip mode
if: runner.os == 'Linux' && steps.codemode-rust.outputs.run == 'true'
timeout-minutes: 5
working-directory: packages/codemode-rust
env:
PSYCHOSCRIPT_ROUNDTRIP: "1"
run: cargo test --locked -p psychoscript-bench --test conformance

# A change to the reference fails here until the Rust side is updated and the expectations regenerated.
- name: Check codemode Rust conformance expectations match the reference
if: runner.os == 'Linux' && steps.codemode-rust.outputs.run == 'true'
working-directory: packages/codemode-rust
run: |
bun conformance/generate.ts
bun conformance/boundary.ts
bun conformance/streaming.ts
bun conformance/host.ts
git status --porcelain -- conformance
git diff --exit-code -- conformance
test -z "$(git status --porcelain -- conformance)"

- name: Read the pinned test262 revision
id: test262
if: runner.os == 'Linux' && steps.codemode-rust.outputs.run == 'true'
run: |
revision=$(jq -r .revision packages/codemode/test/test262/manifest.json)
echo "revision=$revision" >> "$GITHUB_OUTPUT"
echo "checkout=$HOME/.cache/test262-$revision" >> "$GITHUB_OUTPUT"

- name: Cache the test262 checkout
if: runner.os == 'Linux' && steps.codemode-rust.outputs.run == 'true'
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ steps.test262.outputs.checkout }}
key: test262-${{ steps.test262.outputs.revision }}

# Parity both ways, against test262/rust-skipped.txt and test262/reference-gaps.txt; see test262/README.md.
- name: Check codemode Rust test262 parity
if: runner.os == 'Linux' && steps.codemode-rust.outputs.run == 'true'
timeout-minutes: 10
working-directory: packages/codemode-rust
env:
TEST262_CHECKOUT: ${{ steps.test262.outputs.checkout }}
run: bash test262/run.sh

# Shared runners are too noisy for a performance gate; the numbers go to the job summary only.
- name: Benchmark codemode Rust against the reference (informational)
if: runner.os == 'Linux' && steps.codemode-rust.outputs.run == 'true'
continue-on-error: true
timeout-minutes: 10
working-directory: packages/codemode-rust
env:
ITERATIONS: "5"
COLD_RUNS: "5"
PLUGIN_RUNS: "2000"
run: |
[ -x /usr/bin/time ] || (sudo apt-get update && sudo apt-get install -y time)
bash bench/compare.sh
cat bench/RESULTS.md >> "$GITHUB_STEP_SUMMARY"

build:
name: build (${{ matrix.settings.name }})
# Compiling the CLI and smoke-testing its service lifecycle is part of the full tier.
Expand Down
1 change: 1 addition & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
"**/*.d.ts",
"**/sdk.gen.ts",
"packages/plugins/figma/skills/**",
"packages/codemode-rust/conformance/cases/**",
".agent/**",
".agents/**",
".claude/**",
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ packages/desktop/src/bindings.ts
packages/client/src/generated/
packages/client/src/generated-effect/
packages/plugins/figma/skills/
packages/codemode-rust/conformance/catalog.json
packages/codemode-rust/conformance/streaming.json
packages/codemode-rust/conformance/tools.json
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/codemode-rust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
39 changes: 39 additions & 0 deletions packages/codemode-rust/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# PsychoScript (Rust)

The Rust implementation of the PsychoScript language layer, whose reference implementation is `src/language/` of `packages/codemode` (the `Language` namespace: `Runtime.make`, `Host`, programs, suspend and resume, snapshots). It embeds in Rust programs with no Bun, Node or other JavaScript engine at build or run time. Code Mode (`src/codemode/` of the reference: tools, schemas, the catalog, `search`, OpenAPI, hooks, `maxToolCalls`) is not part of this crate.

## Parity with the reference language layer

This package is a second way to run and embed the same language, not a replacement. The two must stay equally capable in both directions.

- A language feature, built-in or host API lands in both or in neither. Rust-native forms of a reference API (futures instead of Effects, closures or traits instead of services) are fine; Rust-only capabilities are not.
- The public API in `crates/psychoscript/src/lib.rs` is the Rust form of `src/language/index.ts`; the README maps one to the other. Keep that table current.
- Known differences are listed in the README; add to that list only with the owner's agreement, and prefer removing one.

## Conformance

The recordings are generated from the reference's language layer; never edit them by hand. CI regenerates them and fails on any difference. Each generator's top comment states the host globals and runtime options it uses, which the Rust replays define the same way (`conformance/reference.ts` and `conformance/reference.rs` share the `tools` namespace):

- `conformance/cases/*.json` by `bun conformance/generate.ts`, replayed by `bench/tests/conformance.rs`.
- `conformance/host.json` by `bun conformance/host.ts` (host functions: types, keys, idempotent and durable calls across a suspend, namespaces, failures, `run.metadata`, translation, limits, compiled programs), replayed by `crates/psychoscript/tests/host_recording.rs`.
- `conformance/boundary.json` by `bun conformance/boundary.ts` (values crossing the host boundary, globals, module names and imports), replayed by `crates/psychoscript/tests/boundary.rs`.
- `conformance/streaming.json` by `bun conformance/streaming.ts` (streaming responses, host-call arguments, fuel, suspensions), replayed by `crates/psychoscript/tests/streaming.rs`.
- `crates/psychoscript/tests/host.rs` mirrors the reference's `test/language.test.ts`.

## Scope

- Pipeline: parse → compile to bytecode → stack VM. Values cross the host boundary as copies (`HostValue`), never shared.
- Out of scope, as in the reference: classes (rejected), `export`, BigInt, Symbol beyond the well-known iterators.

## Rules

- Functional style at the API: plugins are programs over data, not objects. Do not add classes to the language.
- Unsupported syntax throws `UnsupportedSyntax` with a location where it runs; never panic on user input.
- No `unsafe` unless measured and justified in a comment.
- Dependencies: pure Rust only, and few. Justify each in the commit that adds it.
- test262 parity runs both ways: `bash test262/run.sh` must pass, and `test262/rust-skipped.txt` and `test262/reference-gaps.txt` may only shrink.
- `cargo fmt --check`, `cargo clippy --workspace --all-targets -- -D warnings`, and `cargo test --workspace` must pass.
- The conformance cases must also pass in round-trip mode, which saves and restores every run at each host stop and after 64, 128, 256, … loop iterations: `PSYCHOSCRIPT_ROUNDTRIP=1 cargo test -p psychoscript-bench --test conformance`.
- Benchmark claims need the command, machine and numbers in `bench/RESULTS.md`, measured against the reference's language layer by `bash bench/compare.sh`.
- CI: the `unit` job of `.github/workflows/check-test.yml` runs these checks, round-trip conformance, conformance freshness, test262 and the informational bench on Linux, whenever `packages/codemode`, `packages/codemode-rust` or that workflow changed.
- Nothing in the repo mentions internal tooling, private chats, home paths, hostnames or secrets.
Loading
Loading