Skip to content

Add NativeAOT support with compile-time NodeData adapters - #4

Closed
JustSusie wants to merge 1 commit into
AXiX-official:masterfrom
JustSusie:codex/aot-nodedata
Closed

JustSusie wants to merge 1 commit into
AXiX-official:masterfrom
JustSusie:codex/aot-nodedata

Conversation

@JustSusie

Copy link
Copy Markdown

This adds a NodeData backend for asset types that currently require runtime-generated code, allowing source builds to run under NativeAOT. UnityAssetNodeData=true selects it explicitly, and PublishAot=true selects it automatically through UNITYASSET_NODEDATA.

  • Generate concrete interface adapters at compile time, preserving typed edits, nested/array mutations, unknown fields, optional fields, integer signedness, pointer variants and serialized field names.
  • Correct per-pair alignment in NodeData maps and annotate reflection-based build-time schema inspection for trimming.
  • Add a smoke/benchmark executable, a three-mode comparison script, usage documentation and JIT/NativeAOT CI jobs.

Validation:

  • .NET 10 / Windows x64: 565 unit tests passed in each JIT configuration.
  • Ordinary JIT, NodeData JIT and Windows NativeAOT smoke tests passed, including TPK loading; final native publish emitted no IL trimming/AOT warnings.
  • Regenerated interfaces from the supplied TPK at minimum version 2017.1.0b1 with no differences.
  • Ran five-process synthetic benchmarks for each mode; results and commands are in AOT.md. No real asset dataset was available.
  • .NET 11 and Linux CI are configured but were not run locally.

The existing untracked AssetModificationTests.cs belongs to an earlier branch and references a removed API. It was preserved, excluded only from local test invocations, and is not included in this PR. Precompiled packages must themselves be built with the fallback setting; application-only symbols cannot change an existing DLL.

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.

2 participants