Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
ca856e9
Bump coverlet.collector and 2 others
dependabot[bot] Nov 16, 2026
d044d0b
docs(rust): fix the fixed-value rustdoc link
JasonXuDeveloper Nov 18, 2026
01cf19c
chore(git): ignore generated output at legacy paths
JasonXuDeveloper Nov 18, 2026
ff6be5b
refactor(codegen): share recursive struct detection
JasonXuDeveloper Nov 18, 2026
c97d5a9
fix(codegen): size closed generic Go structs before reading
JasonXuDeveloper Nov 18, 2026
b238556
feat(typescript): support rectangular arrays
JasonXuDeveloper Nov 18, 2026
2386861
refactor(typescript): split the runtime into source modules
JasonXuDeveloper Nov 18, 2026
1885805
docs(skills): preserve single-scope TypeScript builds
JasonXuDeveloper Nov 18, 2026
4715bc3
refactor(rust): split standard codecs by value kind
JasonXuDeveloper Nov 18, 2026
a0f9e9c
test(typescript): narrow the decoded grid owner
JasonXuDeveloper Nov 18, 2026
7e9f15e
perf(rust): write fixed-size set elements in one block
JasonXuDeveloper Nov 18, 2026
da7253b
docs(skills): record Rust fixed-set measurements
JasonXuDeveloper Nov 18, 2026
4e64b58
docs(skills): compare each TypeScript benchmark harness
JasonXuDeveloper Nov 18, 2026
9735fce
perf(go): encode padded primitive pairs at fixed offsets
JasonXuDeveloper Nov 18, 2026
2ed62c9
perf(go): guard bytewise keys with the reader table
JasonXuDeveloper Nov 18, 2026
acaea63
docs(skills): record the TypeScript bundle A/B
JasonXuDeveloper Nov 18, 2026
be71660
test(typescript): include collections in the generated corpus
JasonXuDeveloper Nov 18, 2026
77a69a1
perf(go): encode fixed-width collections in one block
JasonXuDeveloper Nov 18, 2026
39a6506
test(typescript): allow engine NaN encoding in plain arrays
JasonXuDeveloper Nov 18, 2026
f0f4b6d
docs(skills): record Go union boxing constraints
JasonXuDeveloper Nov 18, 2026
64e4ef4
perf(rust): construct generated union variants directly
JasonXuDeveloper Nov 18, 2026
d78b209
docs(skills): record Rust union read results
JasonXuDeveloper Nov 18, 2026
9cf0a43
perf(typescript): reserve fixed union cases in one block
JasonXuDeveloper Nov 18, 2026
c6f7532
docs(skills): record fixed union write results
JasonXuDeveloper Nov 18, 2026
ecf56a3
docs(skills): use QEMU 10 for Go 386 tests
JasonXuDeveloper Nov 18, 2026
a921e0d
docs(skills): check both runner refs are reachable
JasonXuDeveloper Nov 18, 2026
831667e
docs(skills): record runtime copy microbenchmarks
JasonXuDeveloper Nov 18, 2026
7f4a2b8
docs(skills): record TypeScript Wasm copy measurements
JasonXuDeveloper Nov 18, 2026
1f85123
perf(go): keep scalar and string duplicate checks on their hot paths
JasonXuDeveloper Nov 18, 2026
0371eec
perf(codegen): encode fixed Go map entries in place
JasonXuDeveloper Nov 18, 2026
d6823c7
docs(skills): record Go byte-array codec results
JasonXuDeveloper Nov 18, 2026
ffdae92
docs(skills): record Rust byte-vector codec results
JasonXuDeveloper Nov 18, 2026
da2e2f2
docs(skills): record Go fixed-collection runner results
JasonXuDeveloper Nov 18, 2026
4ca3570
ci(release): bump the Rust fuzz workspace's lockfile with the crates
0z5a Nov 18, 2026
1510329
docs(skills): record runtime block-copy results (#404)
JasonXuDeveloper Nov 18, 2026
6bffcd3
chore(repo): fix Rust docs and ignore legacy output (#396)
JasonXuDeveloper Nov 18, 2026
f58faad
Bump coverlet.collector and 2 others (#359)
JasonXuDeveloper Nov 18, 2026
9e34d62
fix(codegen): share recursive checks and size Go generic structs (#398)
JasonXuDeveloper Nov 18, 2026
7095615
perf(rust): write fixed-size sets as one block (#399)
JasonXuDeveloper Nov 18, 2026
8625e06
perf(codegen): optimize Rust and TypeScript union codecs (#402)
JasonXuDeveloper Nov 18, 2026
b24ccc5
ci(release): bump the Rust fuzz workspace's lockfile with the crates …
JasonXuDeveloper Nov 18, 2026
4bde705
Merge remote-tracking branch 'origin/main' into codex/go-fixed-collec…
JasonXuDeveloper Nov 18, 2026
9da7481
Merge remote-tracking branch 'origin/main' into codex/typescript-grid…
JasonXuDeveloper Nov 18, 2026
e72d93b
docs(agents): place grid.ts under src/runtime in the TypeScript file map
JasonXuDeveloper Nov 18, 2026
b603448
perf(go): encode fixed-width collections in blocks (#403)
JasonXuDeveloper Nov 18, 2026
5998ded
Merge remote-tracking branch 'origin/main' into codex/typescript-grid…
JasonXuDeveloper Nov 18, 2026
63ef558
feat(typescript): support grids and modularize the runtime (#401)
JasonXuDeveloper Nov 18, 2026
f4a6c04
docs(skills): record gated Rust byte writer measurements
JasonXuDeveloper Nov 19, 2026
dc848f5
docs(skills): distinguish copy results from the noise floor
JasonXuDeveloper Nov 19, 2026
cad8954
refactor(rust): keep codec fragments in one module
JasonXuDeveloper Nov 19, 2026
3a2be47
ci(rust): check formatting of included codec fragments
JasonXuDeveloper Nov 19, 2026
73766a8
docs(skills): record the machine-code check for Rust splits
JasonXuDeveloper Nov 19, 2026
d3c0a34
docs(skills): record the mixed Rust copy comparison
JasonXuDeveloper Nov 19, 2026
f5bbe18
docs(skills): record the end-to-end Go copy comparison
JasonXuDeveloper Nov 19, 2026
7422fbf
perf(go): call sample raw codecs directly
JasonXuDeveloper Nov 19, 2026
9ea6f57
perf(codegen): prepare Go duplicate-key checks
JasonXuDeveloper Nov 19, 2026
fc2568d
docs(skills): describe prepared Go key checks
JasonXuDeveloper Nov 19, 2026
b974411
docs(skills): record Arm32 QEMU retry flags
JasonXuDeveloper Nov 19, 2026
44244b2
docs(skills): record prepared key runner results
JasonXuDeveloper Nov 19, 2026
7dcf080
docs(skills): record runtime block-copy conclusions (#414)
JasonXuDeveloper Nov 19, 2026
5fea67b
perf(go): prepare fixed collection key checks (#418)
JasonXuDeveloper Nov 19, 2026
06cbf9a
refactor(rust): preserve codegen when splitting codecs (#419)
JasonXuDeveloper Nov 19, 2026
87b05ca
Merge remote-tracking branch 'origin/main' into claude/sync-main
JasonXuDeveloper Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .claude/skills/audit-layout/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ its own `AGENTS.md` maps every file in it.
- In the Unity project an asmdef, not the folder name, decides where an assembly compiles: `Assets/Test/Editor/Model`
and `CrossRef` build for players too and sit under `Editor/` because only the editor tests use them (their
namespaces say `Test.Editor`); move them only together with their namespaces.
- **Preserve the original module and item order when splitting Rust files whose machine code must stay identical.**
Moving impls to child modules can change rustc's codegen-unit partitioning and alter even untouched hot functions
(`DateOnly::new` in #248). Use ordered `include!` fragments when ordinary modules change the instructions.
Compare the release binaries from the same checkout path and flags with the same hot-path implementations on both
sides (`optimize-runtimes`). Check the fragments with `rustfmt --check` as well as `cargo fmt --all --check`,
which does not follow `include!`.

## Adding files that nothing builds

Expand Down
3 changes: 1 addition & 2 deletions .claude/skills/audit-runtimes/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ nothing.
the bytes on its own. Read UTF-16 text from the wire with `MemoryMarshal.Cast<byte, char>`, never
`Encoding.Unicode.GetString`, which replaces lone surrogates with U+FFFD (spec §4.1 keeps them; `string-lone-surrogates`
caught it). Raise the depth of `JsonDocument` (64) and `Utf8JsonWriter` (1000) for deep corpus cases, and run deep
reads on a thread with a large stack. "Struct holds itself" is computed in four places (`CodegenModel.HoldsItself`,
used by inspect, and each target's own, which filters by the types it supports): merge them when a target changes.
reads on a thread with a large stack.
- A `[NinoType]` added to `runtimes/csharp/tests/Nino.Codegen.Tests` (Shapes.cs, InspectTypes.cs) is in nino-gen's generated Shapes
files unless every target leaves it out, and a keyed or version-tolerant one is in `LayoutsCommandTests`' baseline
list: update that list with it.
Expand Down
10 changes: 7 additions & 3 deletions .claude/skills/benchmark/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ runs in both, so its two results show how much the machine moved. Heavy runs go
- **Reach the commits** with `git merge -s ours --no-edit <ref>` (history only: the test branch keeps main's code,
so its CI runs main's code; merging an experiment's code ran CI on it, and a Go test that overflowed `int` on 386
and a Windows stack test mailed the owner a failure per push).
Check `git merge-base --is-ancestor <sha> HEAD` for both refs after the history merges. The #353 benchmark
baseline and candidate were built on independent branches, so merging only the candidate left the baseline
missing from every runner checkout (44333395182).
- **Time the Nino.Core build you mean.** BenchmarkDotNet's runner project (`Nino.Benchmark-<job>`) gets Nino.Core
only through Nino.Benchmark's references, so a referenced package built for fewer frameworks than Nino.Core brings
an older build into it: until f01a8d3c Nino.Immutable (net8.0 only) made every runner process load Nino.Core's
Expand Down Expand Up @@ -133,9 +136,10 @@ runs in both, so its two results show how much the machine moved. Heavy runs go
took 6 h 17 min (run 41364890698); a filter of 13 cases at 12 rounds took 2 hours (41399172268).
- **Skip an A/B whose code is unchanged** (identical generated files or machine code prove it), and prove it per
runtime before requesting the line: Go, `go test -c` the bench at both commits and diff `go tool objdump` with
paths and addresses stripped; TypeScript, runtime-ab runs the head's `bench.ts` on both sides, so the sides differ
only in `src/nino.ts`, what nino-gen writes for `bench/Bench.dll` and the data `Bench.dll` writes (diff all
three); Rust, `objdump -d` the bench binary each side builds with the line's
paths and addresses stripped; in TypeScript, diff each revision's benchmark harness, `src/nino.ts`, and the
codecs and data its `bench/generate.sh` writes. Since #374 the runtime A/B workflow runs each revision's own
harness and generates its fixtures from the .NET benchmark schema. In Rust, run `objdump -d` on each benchmark
binary built with the line's
`RUSTFLAGS=-Cllvm-args=-align-all-functions=6`, addresses stripped (after items moved between modules, also
the `::h<hash>` suffixes, the moved paths mapped and the `# <symbol>` comments; criterion's code and a bench's
own setup can land in other codegen units of the bench crate, so compare every `nino::` function and timed
Expand Down
3 changes: 2 additions & 1 deletion .claude/skills/optimize-runtimes/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ metadata:
The techniques that made the Go, Rust and TypeScript runtimes and nino-gen's generated code faster or slower. The
.NET and Unity techniques, reading .NET machine code and the prefetch design of every runtime are `optimize` (prefetch:
its references/prefetch.md). How to measure on runners is `benchmark` (runtime A/B), where the next win is
`audit-perf`, each runtime's rules are `runtimes/*/AGENTS.md` and `audit-runtimes`.
`audit-perf`, each runtime's rules are `runtimes/*/AGENTS.md` and `audit-runtimes`. For Rust source splits that must
keep machine code identical, see [audit-layout](../audit-layout/SKILL.md#splitting-long-files).

## The techniques, by topic

Expand Down
68 changes: 68 additions & 0 deletions .claude/skills/optimize-runtimes/references/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ value check in a runtime or a template.

## Fixed-size blocks in Rust

- Write fixed-size Rust sets through `extend_fixed_iter`, reserving the count and payload together in iteration order.
In runtime A/B 44329792122, the median write time for 1,000 `i32` hash-set elements fell 33–43 % across EPYC
7763, 9V74, 9V45 and Xeon 8573C, and 58 % on Neoverse-N2. The GUID hash-set case fell 26–44 % on the same
x64 CPUs and 58 % on Neoverse-N2. The ordered `i32` case fell 37 % on Neoverse-N2 and ranged from on par
to 20 % lower on x64. The comparison used the same block benchmark harness on both sides.

- In Rust, give every fixed-size shape `FIXED_SIZE` with `decode_fixed` / `encode_fixed` and let `read_fixed` /
`extend_fixed` run it over `chunks_exact`; write no shuffle kernel. LLVM already turns a block whose wire bytes
equal its memory ((i32, i32), a raw struct, a derived plain `{i32, f32}`) into vector copies (`vmovups ymm` on
Expand Down Expand Up @@ -41,6 +47,21 @@ value check in a runtime or a template.

## Checking blocks in Go

- Reserve one checked block for fixed-width Go containers. Use constant wire offsets for padded primitive pairs
and copy compatible primitive grids as blocks. In runtime A/B
[44339615693](https://github.com/JasonXuDeveloper/Nino/actions/runs/44339615693), padded-pair read times fell
66–75 % on the measured x64 CPUs and 72 % on Neoverse-N2. Byte-grid writes fell 92–96 % on both architectures.
Fixed DateTimeOffset sequence writes fell 52–59 % on x64 and 47 % on Neoverse-N2.
- Encode fixed map entries through their addresses. In the original fixed-stride loop the x64 GUID entry value
crossed two stack temporaries. The address loop reduced ten `MOVUPS` per entry to two, with the stride guard
intact. In [44347813411](https://github.com/JasonXuDeveloper/Nino/actions/runs/44347813411) the revised GUID map
write took 82–85 % less time on x64 and 81 % less on Neoverse-N2. The revised map read took 52–54 % less on
x64 and 45 % less on Neoverse-N2.
- Keep generated raw fallback loops on direct codecs after the raw-memory attempt. In the
[prepared-key follow-up](https://github.com/JasonXuDeveloper/Nino/actions/runs/44451141322) both native
listings call `repeatedBits` directly for padded primitive pairs. The eight-pair read was on par on
EPYC and Neoverse-N2. Its Xeon 6973P-C sample took 9 % less time, with no same-CPU control.

- Check a block of range-limited 8- or 16-byte values four a step with one compare each (`w[0].Valid() && ... &&
w[3].Valid()`, then the failing step value by value), each `Valid` a single compare (a signed range from 0 as
unsigned; a Decimal's flags without the sign, rotated by 16 bits, `<= 28`). Writing 1000 values (runtime A/B runs
Expand All @@ -63,3 +84,50 @@ value check in a runtime or a template.
read and 92-96 % to write; narrowing Latin-1 four units a word 40-64 % faster to write. Widening Latin-1 four bytes
a word on read (`load32`, `widen`, `store64` into a fresh slice) was slower than the byte loop: +86 % on EPYC 7763,
+56 % on Xeon 6973P, +10 % on Neoverse-N2 (run 40822228516); the byte loop stays.

## Byte block copies

- Confirm copy microbenchmarks in the codec that allocates or reuses the real buffer. Runtime A/B
[44339615693](https://github.com/JasonXuDeveloper/Nino/actions/runs/44339615693) probed disjoint copies with
rotated buffers, including a destination offset of four bytes. Go's candidate lowered the Neoverse-N2 time
by 10–33 % at 2–4 KiB but raised it by 21 % at 256 KiB with that offset. On the x64 runners it lowered the
hot 1 MiB time by 20–44 %, while the 2–4 KiB results varied by CPU and alignment.
Keep Go's built-in copy in `Reader.ByteArray`. The Arm64 candidate for fresh 2–4 KiB reads took 5–9 %
longer with a hot input and 24–26 % longer with a 64 MiB source rotation on Neoverse-N2
([44347813411](https://github.com/JasonXuDeveloper/Nino/actions/runs/44347813411), `DeserializeExact`).
The 128-byte fallback control also took 30 % longer.
The [1 MiB end-to-end x64 follow-up](https://github.com/JasonXuDeveloper/Nino/actions/runs/44451141322)
ran the AVX2 candidate through the same fresh `Reader.ByteArray` read. With a 64 MiB source rotation,
median time rose 17 % on Xeon 6975P-C, 39 % on EPYC 9V45 and 122 % on EPYC 7763. The hot 7763 row
rose 21 %. The same-revision 9V45 rotation moved 1.5 %. The other two x64 CPU models did not occur
in the floor jobs. The standard path compiles the allocation and copy to `runtime.makeslicecopy`.
Keep it for megabyte reads as well.
- Compare Rust's standard copy under the default loader and with
`GLIBC_TUNABLES=glibc.cpu.x86_rep_movsb_threshold=2112`. In the same run, forcing the historical lower
threshold made the unaligned 2,113-byte standard copy 7.1× its default time on EPYC 7763 and 5.8× on 9V74.
AVX2 took about 13–15 % of that tuned time. With the default loader the custom vectors had mixed x64 results
and the unaligned NEON copies cost 15–25 % more through 64 KiB. The lower threshold reproduces the AMD
`rep movsb` transition. The current loader still has its own upper stop threshold, so the 1 MiB row does
not reproduce every historical glibc configuration.
In real Rust codecs ([44347813411](https://github.com/JasonXuDeveloper/Nino/actions/runs/44347813411)),
the scoped AVX2 candidate lowered reused writes by 14–33 % at 2,113 and 4,096 bytes on EPYC with the
forced threshold. The 2,113-byte writes also fell 9–10 % under the default loader on EPYC 7763 and 9V74.
Ordinary read measurements shifted by about 25–30 % even with the same revision on both sides.
- Keep Rust's standard counted byte copy. A write-only AVX2 candidate gated to AMD family 19h
([44443778134](https://github.com/JasonXuDeveloper/Nino/actions/runs/44443778134)) lowered reused
2,113-byte writes by 31 % on EPYC 7763 and 19 % on 9V74 with the forced historical glibc threshold.
At 4,096 bytes the apparent gains were 30 % and 26 %, while the same-revision floors themselves
moved 27 % and 17 % lower by median. With the default loader, the 2,113-byte case improved 13 % on
9V74 and was on par on 7763. The 4,096-byte 9V45 control took 19 % longer, with no matching same-CPU
floor. The 2,113-byte legacy gain is repeatable. Evidence for the full range and fallback remains
inconclusive. A separate [mixed workload](https://github.com/JasonXuDeveloper/Nino/actions/runs/44447481096)
varied source alignment and payload lengths from 2,113 to 4,096 bytes. The measured AMD writers
stayed on par under the default loader. Under the forced threshold, EPYC 9V74 fresh and reused times
fell 9 % and 18 %, respectively, with overlapping same-revision controls that fell 12 % for both.
Keep the standard writer. Do not infer the effective threshold from the glibc version alone. The
[glibc 2.39 stable branch](https://sourceware.org/pipermail/glibc-cvs/2024q2/084781.html) backported the
AMD change, as did [RHEL 9.5](https://docs.redhat.com/en-us/documentation/red_hat_enterprise_linux/9/pdf/9.5_release_notes/Red_Hat_Enterprise_Linux-9-9.5_Release_Notes-en-US.pdf).
- Keep `TypedArray.set` for ordinary TypeScript buffers. In 44339615693, copying through Wasm memory with both
staging copies took 82–339 % more time than `TypedArray.set` across the default and historical threshold
runs. For views already backed by Wasm memory, `memory.copy` varied from 8 % lower to 17 % higher by size and
CPU. These views avoid the staging cost and are timed separately from ordinary arrays.
28 changes: 28 additions & 0 deletions .claude/skills/optimize-runtimes/references/dispatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ call, a helper that takes a function, or a `read_into` / `deserializeInto` path.
the template's had none): in the release build of `tests/generated` the standalone raw `read`/`write` symbols are
gone and their callers inline them (no runner number yet: the benches' `Point` uses the macros since).

- Generate a direct fixed-stride fallback when `TryReadRaw` or `TryWriteRaw` declines a Go layout. Apple Arm64
disassembly of the padded Gappy and Marked fixtures had direct decode and encode calls on the fallback.
Keep the exported callback helpers available for callers that supply their own codecs.
- Keep structural composite-key discovery outside Go's scalar and string duplicate loops. When the initial #353
implementation sent all keys through the shared cache and added a byte-size test to the string loop,
[44339615693](https://github.com/JasonXuDeveloper/Nino/actions/runs/44339615693) measured the eight-int control
15 % higher on Neoverse-N2. Caching only the composite field walk and restoring the string probe brought both
controls within 2 % by median on that CPU ([44347813411](https://github.com/JasonXuDeveloper/Nino/actions/runs/44347813411)).
The bytewise path still uses the reader's shared seeded table and bounded probing. Prepare generated duplicate
checks in package initializers, shared by key type across set and dictionary helpers; primitive-entry readers
know the key width and distinguish integer `K(1)/K(2)` from floating point at compile time.
In [44451141322](https://github.com/JasonXuDeveloper/Nino/actions/runs/44451141322), eight-element Guid sets and
maps took 6–10 % and 5–7 % less time on sampled x64 CPUs and stayed on par on Neoverse-N2. The 1,024-entry Guid
map, eight-integer and 1,024-string controls were within 2 % by CPU median.

## Reuse branches

- Keep reuse branches off the read path of a new value: share the body, not the dispatch. Reading into an existing
Expand Down Expand Up @@ -63,3 +78,16 @@ call, a helper that takes a function, or a `read_into` / `deserializeInto` path.
and the tagged union is the faster form (12.1 µs serialize, 7.5 deserialize against 23.1 and 13.0 on EPYC 9V45, with
fewer and smaller values); Go deserializes in about three times its serialize time (35.7 against 11.9 µs, EPYC
9V74) with an allocation per non-int case (808 for UnionArray). The gaps are #387.
- Construct the Rust union variant directly in its read, and record a deferred trail only for cases that can open
deferred bodies. Against 44d49866 on runtime A/B 44333395182, `UnionArray` / `TaggedUnionArray` deserialize
medians fell 38 % / 51 % on EPYC 9V74, 43 % / 55 % on Xeon 6975P-C and 33 % / 44 % on Neoverse-N2.
Both serialize controls stayed on par. Count struct depth around each non-null case, including a failed read.
- Reserve the case ID and fixed payload together in TypeScript union writers. Use the same offset writer and padding
policy as other fixed shapes. On runtime A/B 44333395182, Node's `UnionArray` / `TaggedUnionArray` serialize
medians fell 17 % / 22 % on Neoverse-N2. The plain union wrote its 1,000 values in 37.1 µs against JSON's 38.8 µs
on that CPU, within 5 %. The sampled x64 medians fell 10–14 % / 17–23 %.
- Treat the dynamic type of a generated Go union case as part of its API: callers assert the concrete value wrapper.
`go build -gcflags=-m ./model` in the Go bench module reports heap escape for `UnionValueInt32`,
`UnionValueInt64`, `UnionValueUnionPoint`, `UnionTaggedInt32` and `UnionTaggedInt16`. Go's small-integer
conversion table can still supply some of those boxes. The string wrapper has a single pointer field and fits
directly in an interface. Returning pointers into a typed slice would change what callers' type assertions accept.
7 changes: 7 additions & 0 deletions .claude/skills/optimize-runtimes/references/inlining-gc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ Read it before growing a TypeScript or Rust hot helper, or when a TypeScript cas
when a shape helps one target and hurts another, put it behind `cfg(target_arch)` and keep the generic loop for
every other target (the map read taking one check per entry is x86/x86_64 only: on Arm64 it held the key/value pair
in a SIMD register across the hash call and Neoverse-N2 ran 3 to 4 % slower). Test both paths (`platforms`).
- Flatten the TypeScript runtime modules into one lexical scope for npm and nino-gen. On Node 22.23.4, #247's
single-file output kept the bytecode lengths and TurboFan inlining of the monolith's string and Latin-1 paths,
numeric blocks, and generated IntArray, BoolArray and ByteArray readers, both with and without `Buffer`.
Compare `--print-bytecode` lengths and `--trace-turbo-inlining` call edges after warming both paths of each build.
The MixedStrings runner A/B and same-revision controls (44329792122) put the modular bundle within 5 %
by per-CPU median on every measured x64 CPU and Neoverse-N2. On Neoverse-N2 the medians moved −1.13 % for
serialize, −1.17 % for serializeInto and −0.11 % for deserialize.
- TypeScript output is the bytes it writes: a slower serialize in a large heap is often GC, not the loop. Before changing
a write loop for a case that got slower, run it with `--trace-gc` and read whose pauses land in its task. Every new
`ArrayBuffer` counts as external memory, and Node 24 starts a full GC for each 64 MB of them that no scavenge
Expand Down
9 changes: 8 additions & 1 deletion .claude/skills/platforms/references/emulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ crashing. Read it before running anything under qemu or taking a listing for Arm
garbage collector's lock-free lists (`runtime.(*lfstack).pop` SIGSEGV at address 0, during any test) in 2 to 5 of
8 runs with qemu 8.2 and the runners' qemu, and main's code before the run that showed it (f618b973) crashed too
(1 of 10, more allocation only made it likelier); Go 1.24 crashed in 0 of 8, `GOMAXPROCS=1` in 0 of 18, `GOARM=6`
did not help (4 of 8). runtimes.yml sets it on that step (r101).
did not help (4 of 8). runtimes.yml sets it on that step (r101). If qemu-arm still faults in
`runtime.(*lfstack).pop`, retry with `GODEBUG=asyncpreemptoff=1` as well. With Go 1.26.11 and QEMU
10.0.13, the first #353 run faulted during `TestStringEncodings`; all packages passed with both flags.
Use QEMU user-mode 10.0.13 or later for local Go 386 tests on Arm64 Linux. Go 1.26.11's same static
test binary reported `bad g in signal handler` or `morestack on gsignal` on QEMU 7.2.22. On Debian
trixie's QEMU 10.0.13 it passed three runs and `GOARCH=386 go test -exec qemu-i386 ./...` passed with
asynchronous preemption enabled (#353). Where QEMU 7.2 is required, `GODEBUG=asyncpreemptoff=1` and
`GOMAXPROCS=1` allowed the 386, Arm32 and s390x suites to pass.
- To run tests under qemu-aarch64, pass `-cpu neoverse-n1` (listings can keep the default): qemu 8.2's default CPU
(`max`) has LRCPC2, whose `ldapur`/`stlur` (what the optimizing JIT emits for `Volatile.Read`/`Write` of a field) it
emulates wrong. With or without Nino's code, runs crashed (`ToImmutableDictionary`), or a static field written by
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ runtimes/rust/tests/conformance/types.rs linguist-generated
runtimes/go/internal/generated/**/nino_types.go linguist-generated
runtimes/rust/tests/generated/*.rs linguist-generated
runtimes/typescript/test/generated/*.ts linguist-generated
# npm run build:bundle
runtimes/typescript/src/nino.ts linguist-generated
# Protocol Buffers code the runtimes' benchmarks compare against.
*.pb.go linguist-generated
*_pb.ts linguist-generated
Expand Down
Loading
Loading