perf(core): look up IfcType keywords through a minimal perfect hash (#7914)

Merged
LO
1mo ago
+4988-4126

Replace the generated linear IfcType name dispatch with a deterministic minimal perfect hash across the canonical registry and four schema-specific registries. Every occupied slot still requires an exact spelling match; unknown names retain the existing normalization, spelling and fallback behavior. No public API changes.

Refs #7779. This is the standalone lookup prerequisite for #7914; land it first, then requalify #7914 with this lookup in both comparison arms.

Reviewed source: ef6ebcb8b37480c7aaa567fe07107ee6e5ba267c (head 8c9dd972b7 adds only the perf-ledger verdict in scripts/perf/README.md) on main 2bd09a18ba9786623401df3852d541515d283ede. Compared with independently approved f3057fe2, all substantive lane code is unchanged. Subsequent changes are main merges, the union of both workflow oracle branches, and formatting-only registry tests. Both clean merges reproduce exactly; the conflicted merge preserves both branches without other edits.

The generated registries match fresh regeneration at ef6: all 16 codegen synchronization targets pass. The coverage-ledger suite passes 25/25. Main's newer leaf and georeference readers use types already present in the lookup tables.

Performance acceptance follows the user ruling of 2026-10-27. At 09468a7b against b5e663f0, native instruction ratios were:

FixtureParse ratioTotal ratio
Haus0.9339520.981663
ISSUE_1290.9588870.998670
duplex0.8993880.980650

Mesh, vertex and triangle counts match in all three instruction runs. The acceptance ruling also records identical output. The native cohort hd-09468a7b-ab-r2 is protocol-inconclusive because ISSUE_129 lookup/preprocess phases fell below timer resolution. Its observed totals were Haus 57→59 ms (+3.5%, ±5%), ISSUE_129 3459→3396 ms (-1.8%, ±4%), and duplex 98→99 ms (+1.0%, ±4%). Acceptance is based on the instruction reductions and the large-fixture wall observation; this is neither a passing wall-time protocol nor a browser speedup claim. No new A/B is required under that ruling.

At 09468a7b, the PC native qualification ended EXIT 0: formatting introduced no new drift, all 182 fixtures were verified, workspace tests and strict all-target Clippy passed, and the instruction comparison passed. Rust summaries report 7,127 passed and 46 ignored. The separate WASM qualification ended EXIT 0: official source build, committed type synchronization, contract tests (229 passed, one optional historical-baseline case skipped), and wasm32 mesh determinism passed.

Qualification of ef6ebcb8 against 2bd09a18 completed on PC/WSL: all 15 gates passed, JOBGEN_DONE failed=0 and EXIT 0, with unchanged source. Workspace tests report 7,204 passed and 48 ignored; root package build, official WASM build, unchanged committed types, contract tests (229 passed, one optional historical-baseline skip), wasm32 determinism, strict workspace Clippy and instruction comparisons passed. Head 8c9dd972 adds only the perf-ledger verdict. Hosted checks report 61 pass, 0 fail and 22 skipping, including Changed tests observe production and Perf ratchet ceilings. The build job measured engine WASM Brotli at 2,407,350 bytes against the unchanged 2,409,444-byte ceiling; all bundle metrics passed. No HD ceiling exception was needed. Final review: hd-8119-final-review-r2.json.

The exact-comparison mutation removes only the comparison from the generator and all five registries, retaining APIs, generated synchronization and default changed-test selection.

Evidence: hd-094-qual-r1/run-a1.log, hd-094-wasm-r1/run-a1.log and hd-ef6-qual-r1 under /home/louistrue/.t3/artifacts/rust-sweep-takeover-49a6a50d/. Final review: hd-8119-final-review-r1.json. The perf-ledger verdict is recorded in scripts/perf/README.md.