Skip to content

refactor(rust): preserve codegen when splitting codecs - #419

Merged
JasonXuDeveloper merged 3 commits into
mainfrom
codex/rust-impls-exact-layout
Nov 19, 2026
Merged

JasonXuDeveloper merged 3 commits into
mainfrom
codex/rust-impls-exact-layout

Conversation

@JasonXuDeveloper

@JasonXuDeveloper JasonXuDeveloper commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Changes

  • Keep the Rust codec files grouped by value kind and include them in their original order in one impls module. This preserves the original macro scope and codegen-unit assignment.
  • Check the included files directly with rustfmt in CI and document the local command. Cargo fmt follows module declarations and skips include!.
  • Keep the fixed-width set writer from Write Rust sets of fixed-size elements as one block #354.

Verification

  • Built compare, text, and blocks on macOS Arm64 with RUSTFLAGS=-Cllvm-args=-align-all-functions=6 from the same checkout path. The flattened control retained current runtime logic, including Write Rust sets of fixed-size elements as one block #354, and the same benchmark sources. After normalizing symbol hashes and addresses, all 10,313 compare, 67 text, and 428 blocks symbols matched, including the timed closures.
  • Cross-linked the same Linux x64 binaries with Zig and kept the ELF symbol table for normalization. The flattened control matched all 10,327 compare, 81 text, and 428 blocks symbols. Compared with live main on x64, three drop-glue instantiations differed in compare. The text and blocks symbols matched.
  • Compared separately with current main (63ef558b), which already contained the initial split. Normalized code differs in five compare symbols and two blocks symbols. These are the date constructors, the DateTime decode fallback, and drop glue. Timed closure bodies and text match. The earlier runner A/B put the median shift of the valid DateOnly block-read case within 0.5% on each sampled CPU.
  • Cargo fmt, direct fragment rustfmt, all-target and all-feature Clippy, the Release workspace with the required corpus, default-feature lib/spec/values, scoped actionlint, and the repository instruction checks passed.

Closes #248


Generated by Codex

Include the codec files in their original order to preserve Rust codegen-unit assignment and the scope of the map macro. Retain the shared fixed-width set writer from #354.

Refs #248
Cargo fmt follows module declarations. Check files loaded through include! explicitly and document both commands for local runs.
Document how to preserve the Rust module and item order for source-only splits, isolate existing optimizations in the baseline, and verify formatting coverage.
@JasonXuDeveloper
JasonXuDeveloper merged commit 06cbf9a into main Nov 19, 2026
42 checks passed
@JasonXuDeveloper
JasonXuDeveloper deleted the codex/rust-impls-exact-layout branch November 19, 2026 06:11
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.

Split Rust's impls.rs by kind of value

1 participant