Skip to content

feat(typescript): support grids and modularize the runtime - #401

Merged
JasonXuDeveloper merged 11 commits into
mainfrom
codex/typescript-grids-modules
Nov 18, 2026
Merged

JasonXuDeveloper merged 11 commits into
mainfrom
codex/typescript-grids-modules

Conversation

@JasonXuDeveloper

Copy link
Copy Markdown
Owner

Changes

  • Generate row-major NinoGrid<TData> codecs for rectangular arrays of rank 2 to 4. Numeric grids use typed storage, and raw nullable elements retain their slot encoding.
  • Split the TypeScript runtime into source modules. Npm and nino-gen still ship one runtime file at the existing import paths.
  • Run the grids, raw nullable slots and newly generated Collections type through the corpus. In the plain number-array fixture, compare the one JavaScript NaN semantically and compare the surrounding bytes exactly. Typed-array fixtures keep their byte checks.

Verification

  • SDK 11.0.100 regenerated the fixtures. Codegen passed 98 tests and integration passed 16.
  • Node, browser simulation and browser without Wasm each passed 862 tests with 96 existing skips and zero failures.
  • wasm-tools rebuilt the same 1,280-byte module. Rebuilding the bundle produced the same file.
  • The grid-enabled builds before and after modularization match hot-function bytecode lengths, opcode sequences and TurboFan inlining decisions in all three environments.
  • MixedStrings A/B and noise floor placed all three operations within 5% by median on each measured x64 CPU and Neoverse-N2.
  • tools/agents.sh --check

Closes #299
Closes #247
Refs #400


Generated by Codex

Generate TypeScript codecs for flattened row-major grids. Check dimensions before allocating and use typed storage for fixed-size numbers, while preserving nullable slot encoding.

Refs #299

Added: nino-gen generates TypeScript codecs for rectangular arrays of rank 2 to 4, with typed storage for numeric grids.
Generate one runtime from named modules for the npm build and the nino-gen resource. Keep the checked-in bundle and its import path so .NET builds and generated consumers retain their existing requirements. Check the bundle in the npm build and tests, and rebuild it after embedding Wasm.

Refs #247
Record the bundle requirement and the V8 bytecode and inlining checks used for the runtime split.
Assert that the class decoded for the reuse test is present before inspecting its grid.
The runtime A/B workflow generates and runs fixtures with each revision. Include both harnesses when checking whether an A/B measures a change.
The same-revision controls and the comparison show that the modular source bundle retains MixedStrings throughput on both architectures.
Collections is now generated because its rectangular member has a codec. Exercise its valid and truncated payloads through both array modes.
Validate the numeric NaN in the newly enabled Collections fixture and compare the surrounding bytes exactly. Leave exact comparison enabled for typed-array fixtures and all grid cases.
The module lives in src/runtime/ like the others; the map listed it one level up.
@JasonXuDeveloper
JasonXuDeveloper merged commit 63ef558 into main Nov 18, 2026
35 checks passed
@JasonXuDeveloper
JasonXuDeveloper deleted the codex/typescript-grids-modules branch November 18, 2026 23:57
JasonXuDeveloper added a commit that referenced this pull request Nov 19, 2026
Merges `origin/main` (06cbf9a) into `feat/storage-layer`. That brings
in 62 commits main has gained since the last sync, so the storage
layer's final PR into main has fewer conflicts. The merge had no
conflicts.

What came in:
- #401: TypeScript grids, and the runtime split into modules
- #414: skills record why Rust, Go and TypeScript keep their standard
block copies
- #418: Go runtime and nino-gen prepare duplicate-key checks once per
key type
- #419: Rust `impls` codec files kept in one module through ordered
`include!` fragments, and their rustfmt check in CI
- the other main commits since the last sync: Go, Rust and TypeScript
runtimes, nino-gen templates and fixtures, `Directory.Packages.props`
bumps, skills and docs

None of them touches Nino.Core or Nino.Generator. On the .NET side only
Nino.Codegen, its tests, the GeneratorBenchmark project and
`Directory.Packages.props` change.

Checked locally: `dotnet build` (0 warnings), `Nino.UnitTests` on
net10.0 (1,233 passed, 1 skipped), `tools/agents.sh --check`.

---
_Generated by [Claude Code](https://claude.ai/code)_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read and write multi-dimensional arrays in the TypeScript target Split the TypeScript runtime into modules

1 participant