Repository navigation
t27o golden port 1 (step 4 of #9000): bootstrap/src/host/bitmask.rs becomes specs/host/bitmask.t27 and its generated Rust #11156
Description
Goal
First golden port of step 4 of #9000: replace the hand-written bootstrap/src/host/bitmask.rs (170 physical lines, 96 of them #[cfg(test)]) by the spec specs/host/bitmask.t27, converted by tri t27o and reviewed by hand, and the Rust that t27c gen-rust writes from it, bootstrap/gen/rust/host/bitmask.rs, mounted as module bitmask of bootstrap/src/host/mod.rs. The pull request deletes about 170 hand-written Rust lines and adds about 1, so the own-language gate returns rc 0.
Why
#11149 (analysis in draft PR #11155) ranked the 85 Rust files that t27o converts whole and named this one the first candidate that deletes at least 100 hand lines with every caller unchanged: its only callers are two lines of bootstrap/src/host/mod.rs (pub mod bitmask; and the pub use bitmask::{...} of ten names). The analysis measured t27c test-report 14/14 with 0 vacuous passes, an oracle replay of 95 asserts, and a side-by-side run of the hand file and the generated file with 0 disagreements in 68,268 comparisons, but it was a simulated tree. Nothing has yet been built in the real crate, and #9000 needs one landed golden pull request to show the path end to end: spec, seal, generated file, mount, deletion.
Boundary
- specs/host/bitmask.t27
- bootstrap/gen/rust/host/bitmask.rs
- bootstrap/src/host/bitmask.rs
- bootstrap/src/host/mod.rs
- .trinity/seals/host_HostBitmask.json
User Scenarios
- Given the hand file
bootstrap/src/host/bitmask.rsand the generatedbootstrap/gen/rust/host/bitmask.rs, when both are compiled side by side and every function is called over a large input set, then the results are identical, so the port changes no behaviour. - Given the
t27ccrate withhost/mod.rsmounting the generated file as modulebitmask, whencargo check -p t27candcargo test -p t27c host::run, then both pass and thepub use bitmask::{...}line compiles unchanged. - Given the merge base and this branch, when the own-language foreign-line budget reads the numstat of the diff, then it returns rc 0 because the hand lines removed are at least the hand lines added.
Requirements
- FR-001: The spec
specs/host/bitmask.t27MUST carry every function of the hand file and its 14 tests astestblocks, andt27c test-reportMUST pass them all with 0 vacuous passes. - FR-002: The generated
bootstrap/gen/rust/host/bitmask.rsMUST be the unedited output oft27c gen-ruston the spec, andhost/mod.rsMUST mount it as modulebitmaskso that no caller changes. - FR-003: The pull request MUST state every public item whose name or type differs between the hand file and the generated file (for example
const fnand theFieldDescmethods), and MUST NOT proceed if a caller in the repository needs a change. - FR-004: The pull request MUST NOT edit
docs/reports/t27b_expectations.json; the steward adds the ledger row for a new spec.
Success Criteria
bootstrap/src/host/bitmask.rsis deleted and the own-language budget run from the merge base on the numstat of the diff exits 0 with at most 1 hand line added and at least 170 removed.t27c test-report specs/host/bitmask.t27passes all 26 tests (the 14 of the hand file, 1 negative control, 11 oracle tests) with 0 vacuous, andt27c seal --verifyof the spec exits 0.- A side-by-side run of the hand file and the generated file makes at least 60,000 comparisons with 0 disagreements, and
cargo test -p t27c host::exits 0.
Activity
t27o golden port 1: bootstrap/src/host/bitmask.rs becomes specs/host/…