Skip to content

3.5 Pins and surfaces

Source and layout pins detect changes to specific files and ABI declarations. For each mismatch, identify the changed bytes and the authority that hashes them. Correct unintended edits, and update pins only for an authorized source or ABI change, in the same commit and with the reason recorded.

Native layouts and the wasm fingerprint

Rust #[repr(C)] records share their layouts with Java JNA, Python ctypes and C++ declarations. Rust layout tests, Java FfiLayoutParityTest, Python test_ffi_layout_parity.py and C++ static assertions check the sizes and field offsets. A layout change requires coordinated binding and test updates.

rust/wasm/build.rs computes the WebAssembly source fingerprint from rust/.cargo/config.toml, rust/Cargo.toml, rust/core/Cargo.toml, rust/wasm/Cargo.lock, rust/wasm/Cargo.toml, rust/wasm/build.rs and the files listed in rust/wasm/conformanceSources.txt. Any byte change can move the fingerprint, including dependency or version edits. No committed value pins it. Out-of-tree expected values belong to their owner. The hash framing and algorithm test vectors remain fixed. A changed WebAssembly closure requires rebuilding its packages.

The byte-identical bake guarantee

A plan served from the baked corner graph is byte-identical to one computed from a cold build, and this depends on the following ordering and numeric contracts:

  • Dijkstra follows adjacency order for tie-breaking, and reordering the heap (for example with an A* f-cost) changes which of two equal-cost paths wins.
  • OrdF64 carries a NaN contract in pathfinding.rs.
  • float_roundtrip is pinned in rust/Cargo.toml because one bit of float formatting flips corner choices.
  • A deferring cache’s first plan sweeps candidate corner pairs and every pending pair on a path no longer than the route found, and this preserves the full build’s tie-breaking. Omitting that final sweep changed routes in 333 to 415 of every 20,000 mirrored grid layouts.
  • Route, certificate, and speed-bound cache keys compare every input bit for bit. Cached routes record the IDs of graph entries they use without keeping those entries alive, and eviction invalidates route reuse and forces replanning. Recreating an entry at a heading within the matching tolerance can produce different corners and routes.

Conformance fixtures and host-recorded traces check this guarantee. Changes to cache occupancy or speed must preserve output bytes, and output changes require semantic review and the applicable fixture procedure.

Conformance fixtures are not pins

The cross-language conformance fixtures are separate from the pins. They assert that identical inputs produce identical plans across bindings and across time, and they fail on a behavior change, not a file change. Review behavior differences before editing expected results by hand. TEMPO_REGEN_FIXTURES=1 rewrites the core-derived planning fixtures from rust/core/tests/conformance.rs (cargo test -p tempo-core --test conformance), and the diff is reviewed as a behavior change before it is committed. Never set TEMPO_REGEN_TRACES (see testing.md for fixture rules). The sequencing traces have no recorder behind them, so the Java oracle refuses TEMPO_REGEN_TRACES, and a trace that has to move is hand-edited in a commit that names the behavior that moved.

Compile-time include_str!, include_bytes! and include! targets must all be tracked and available in a clean checkout. Keep existing embed sites intact, because converting them to runtime reads is a separate owner decision. Source-text invariants and bytes compared to compiled hashes must describe the same content the binary was built from.

API surface tracking

The wrapper API is tracked in tests/fixtures/api/{java,python,cpp}.txt and can change before 1.0. Maintainer review compares these snapshots with the wrappers’ public declarations. Keep fixtures synchronized with each approved API change; the maintainers regenerate them with an extraction tool. The test suites compile and test the wrappers but do not compare these snapshots. C ABI pins and file-format conformance remain separate checks.

esc

Loading search...