Complete native codegen milestone gate (#50)
This commit is contained in:
@@ -62,6 +62,14 @@ IDs or truncated payloads without panicking. Generated tests round-trip all 483
|
||||
packet types and exercise every truncation boundary, while focused fixtures
|
||||
assert exact reference bytes and malformed-input behavior.
|
||||
|
||||
The generated packet and block APIs also implement the golden generator's
|
||||
`PacketToOSD`, `PacketFromOSD`, `ToOSD`, and `FromOSD` behavior. This includes
|
||||
little-endian binary encoding for unsigned 32- and 64-bit values, permissive
|
||||
LLSD conversions, omission of absent map fields, one-element arrays for single
|
||||
blocks, exact replacement of variable blocks, and bounded updates of
|
||||
fixed-repeat blocks. The all-fields test round-trips every packet through both
|
||||
wire bytes and LLSD maps.
|
||||
|
||||
Generation also compares all packet, block, field, field-type, and `PacketType`
|
||||
entries against the pinned compiled public API catalog. This rejects a template
|
||||
parser or naming change even if the emitted Rust would otherwise compile. The
|
||||
@@ -131,6 +139,13 @@ Verify hashes and reject stale output without writing:
|
||||
cargo run -p libremetaverse-codegen -- check
|
||||
```
|
||||
|
||||
Generate into an empty temporary tree while continuing to read the pinned
|
||||
inputs from this checkout:
|
||||
|
||||
```console
|
||||
cargo run -p libremetaverse-codegen -- generate-to /tmp/metacrate-codegen
|
||||
```
|
||||
|
||||
Maintainers can refresh the vendored snapshots from an explicitly supplied
|
||||
checkout. The command verifies all six golden generator hashes and all input
|
||||
hashes before writing, so a different upstream revision is rejected:
|
||||
@@ -145,3 +160,28 @@ manifest records by stable IDs, emits provenance-rich generated headers, and
|
||||
always terminates output with one LF. Tests generate every registered output
|
||||
twice in memory and require byte identity before comparing with the checked-in
|
||||
files.
|
||||
|
||||
## Completion gate
|
||||
|
||||
The complete milestone gate regenerates `source_manifest.rs`,
|
||||
`packet_catalog.rs`, `visual_catalog.rs`, `foliage_catalog.rs`,
|
||||
`skeleton_catalog.rs`, `attention_catalog.rs`, and `genepool_catalog.rs` in an
|
||||
isolated temporary directory and byte-compares them with the checked-in files.
|
||||
It also verifies the six golden generator records (`PacketSourceGenerator`,
|
||||
`VisualParamGenerator`, `SkeletonGenerator`, `AttentionsGenerator`,
|
||||
`TreesGenerator`, and `GenepoolGenerator`), all eight pinned input names and
|
||||
hashes, generated headers and licenses, complete public API ledgers/shims and
|
||||
the compile fixture, native packet LLSD implementations, and the absence of
|
||||
.NET/Roslyn dependencies or build-script invocations.
|
||||
|
||||
Run the normal gate after generating a clean Rust release build:
|
||||
|
||||
```console
|
||||
cargo build --workspace --release --locked
|
||||
python3 tools/check_codegen_gate.py --release-dir target/release
|
||||
cargo check --manifest-path tests/api-compile/Cargo.toml --locked
|
||||
```
|
||||
|
||||
The release-directory option additionally scans actual artifacts for managed
|
||||
runtime names and markers. The Gitea workflow runs these commands from a clean
|
||||
checkout using only `ubuntu-latest`.
|
||||
|
||||
Reference in New Issue
Block a user