From 1e8312d1bf09ea917bab3fa97c1b94a085d072f7 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Sun, 18 Oct 2026 20:10:04 +0700 Subject: [PATCH] fix(dupe-bodies): token_floor and token_floor_scenes use pbr_sphere's clamp01 instead of copying it (Refs #10451) 7552b89d0 (#10452) left three byte-identical `clamp01` bodies, in specs/t27f/pbr_sphere.t27, token_floor.t27 and token_floor_scenes.t27. No ledger holds that group, so the Duplicate Body Ratchet has been red on master since 7552b89d0, and every open PR shows the red. pbr_sphere's `clamp01` becomes `pub`. token_floor and token_floor_scenes now say `use t27f::pbr_sphere::clamp01;` and drop their copies, the way token_floor already uses pbr_sphere's `shade`. Neither module imported anything that imports them back, so no cycle. The ledger is not touched. On the Railway lab at 982894c96: - dupe_scan: ok, 684 bodies in 196 groups, none new and none grown. - `t27c check`: ok for all four t27f token_floor specs. - `t27c test-report`: pbr_sphere 13, token_floor_scenes 11, token_floor 34 and token_floor_mux 14 tests pass, 0 vacuous. - Seals of pbr_sphere, token_floor_scenes and token_floor were re-saved through `t27c seal --save`. All four pass `seal --verify` (token_floor_mux needed no change). Co-Authored-By: Claude Opus 5.5 --- .trinity/seals/t27f_pbr_sphere.json | 8 ++++---- .trinity/seals/t27f_token_floor.json | 18 +++++++++--------- .trinity/seals/t27f_token_floor_scenes.json | 21 +++++++++++++-------- specs/t27f/pbr_sphere.t27 | 2 +- specs/t27f/token_floor.t27 | 7 +------ specs/t27f/token_floor_scenes.t27 | 8 ++------ 6 files changed, 30 insertions(+), 34 deletions(-) diff --git a/.trinity/seals/t27f_pbr_sphere.json b/.trinity/seals/t27f_pbr_sphere.json index 9c9e346aca..922a09f35c 100644 --- a/.trinity/seals/t27f_pbr_sphere.json +++ b/.trinity/seals/t27f_pbr_sphere.json @@ -1,17 +1,17 @@ { - "built_by": "t27c-bootstrap@0.5.2+9448ab4be", + "built_by": "t27c-bootstrap@0.5.2+89254d26a", "closure": [], "config": "gen=c,rust,verilog,zig;tests=zig", "gen_hash_c": "sha256:2f31d565d2c71e2d4d92894255a9bdef3222ac82ef1c7e49bd7245e1d203abb9", "gen_hash_rust": "sha256:e945517759c860b4ab1c45030cccc81125b900fe852ee9f9f386872af106be99", "gen_hash_verilog": "sha256:9196306f8144111fba605ad93b133846b49bc3130ca9e55dda246fc6581f04aa", - "gen_hash_zig": "sha256:a8856def731456b38f7486e526568c75f93c961eddd33185716419218458b58d", + "gen_hash_zig": "sha256:95eae42a6dbf95408dc9b1fe73c89297afeb411ee60316516350bdadb0186200", "module": "pbr_sphere", "ring": 12, "seal_schema": 2, - "sealed_at": "2026-10-18T12:14:32Z", + "sealed_at": "2026-10-18T13:09:24Z", "sealed_by": "t27c-bootstrap@0.5.2", - "spec_hash": "sha256:f3ca999dd227cac19751b0893e7c28bdff22990a115dedf1f039ca1752c2d1ad", + "spec_hash": "sha256:2d13f0e5ae9032c886b4d9e0d64446a2589a67198d60b35e20d2cdd0d7e1280c", "spec_path": "specs/t27f/pbr_sphere.t27", "tests": { "failed": 0, diff --git a/.trinity/seals/t27f_token_floor.json b/.trinity/seals/t27f_token_floor.json index 0ed69745c3..39fb229444 100644 --- a/.trinity/seals/t27f_token_floor.json +++ b/.trinity/seals/t27f_token_floor.json @@ -1,5 +1,5 @@ { - "built_by": "t27c-bootstrap@0.5.2+9448ab4be", + "built_by": "t27c-bootstrap@0.5.2+89254d26a", "closure": [ { "spec": "specs/physics/physical_limits.t27", @@ -15,7 +15,7 @@ }, { "spec": "specs/t27f/pbr_sphere.t27", - "spec_hash": "sha256:f3ca999dd227cac19751b0893e7c28bdff22990a115dedf1f039ca1752c2d1ad" + "spec_hash": "sha256:2d13f0e5ae9032c886b4d9e0d64446a2589a67198d60b35e20d2cdd0d7e1280c" }, { "spec": "specs/t27f/reel_particles.t27", @@ -23,20 +23,20 @@ }, { "spec": "specs/t27f/token_floor_scenes.t27", - "spec_hash": "sha256:0cdfbe9ca10442fe1f29d54a75d433ea60dafb399e45caae678838bc660d552e" + "spec_hash": "sha256:08649f4f6a892eb622eb22a5edf3222f4ee9ffc3cb678bf84e36cbaf4e47d966" } ], "config": "gen=c,rust,verilog,zig;tests=zig", - "gen_hash_c": "sha256:d5aea31005f78eb0d5d5b37c8fd9eb374a4eaa40869c79c116308ad2cd133c51", - "gen_hash_rust": "sha256:6bafe70fc1a9eb0c8a08047d4898b6b0cf75dd3035c862ba9439e0016a34770f", - "gen_hash_verilog": "sha256:4b19d1b78744c6a770c82b778f42265f6d6c3650d8ec6eeabf690ea66153cdd5", - "gen_hash_zig": "sha256:872a9851daa393c95e1b290fcc6c7f85b602c5493f5ddccf4e265637bc7977c6", + "gen_hash_c": "sha256:fb60769fe560b73407107b9900f288bea87433e63571cd455df65ec6e45faed6", + "gen_hash_rust": "sha256:4510fcfc7646dde1c47fe200db246b3ae36b328d0944b6246e49cc00b6facf10", + "gen_hash_verilog": "sha256:928f4b7b8119c37cd45f804a63f991318bc3f055269df989eb4889bba6b53720", + "gen_hash_zig": "sha256:1c70d762ffe8c28ea85a322d4ff23d0ea5d7c750e7699c8ef64653b385f4bb54", "module": "token_floor", "ring": 12, "seal_schema": 2, - "sealed_at": "2026-10-18T12:16:20Z", + "sealed_at": "2026-10-18T13:09:27Z", "sealed_by": "t27c-bootstrap@0.5.2", - "spec_hash": "sha256:af7ecb226097febe8c528424ccf5eb30fd30ef3d7350e485baac7cbd34521322", + "spec_hash": "sha256:e200c035ecabef82b0a36bbdcbb76130539e3c61bce784df2beea159a15b8a97", "spec_path": "specs/t27f/token_floor.t27", "tests": { "failed": 0, diff --git a/.trinity/seals/t27f_token_floor_scenes.json b/.trinity/seals/t27f_token_floor_scenes.json index f75f84de91..91d671c956 100644 --- a/.trinity/seals/t27f_token_floor_scenes.json +++ b/.trinity/seals/t27f_token_floor_scenes.json @@ -1,17 +1,22 @@ { - "built_by": "t27c-bootstrap@0.5.2+9448ab4be", - "closure": [], + "built_by": "t27c-bootstrap@0.5.2+89254d26a", + "closure": [ + { + "spec": "specs/t27f/pbr_sphere.t27", + "spec_hash": "sha256:2d13f0e5ae9032c886b4d9e0d64446a2589a67198d60b35e20d2cdd0d7e1280c" + } + ], "config": "gen=c,rust,verilog,zig;tests=zig", - "gen_hash_c": "sha256:0b13178692bc1a8cacc426ff975d81b3b1e6e8d228e1b045a00685f4139487f5", - "gen_hash_rust": "sha256:947642f7ab01247088201607ef4ed132c8b366766046d053dbcec84a57c48ecc", - "gen_hash_verilog": "sha256:f3ca1ecad2079d5b09b275d89920e6b688297ae3f3425fa701d580dca663c642", - "gen_hash_zig": "sha256:d4aa0250db25da21749e13d7127ce2c22b93d8f0cfa5daaa18eaddda4f032027", + "gen_hash_c": "sha256:d9e32346b1bf29ec43e0d29f823d9f8a3ec3adda874317b9f2834f93b1a82c28", + "gen_hash_rust": "sha256:06a2704d9ed92b0c12a3e1f14ede5ab62709da540ef5d565cad664f2240c868e", + "gen_hash_verilog": "sha256:0cb7607a53379caaeca94a755ec5dfcedbeea6184711e0af1b63add66fa65858", + "gen_hash_zig": "sha256:51b716d1220bd73840ae844579c27cdfc5af14b0808fb183379d85ced7f55dc2", "module": "token_floor_scenes", "ring": 12, "seal_schema": 2, - "sealed_at": "2026-10-18T12:14:34Z", + "sealed_at": "2026-10-18T13:09:26Z", "sealed_by": "t27c-bootstrap@0.5.2", - "spec_hash": "sha256:0cdfbe9ca10442fe1f29d54a75d433ea60dafb399e45caae678838bc660d552e", + "spec_hash": "sha256:08649f4f6a892eb622eb22a5edf3222f4ee9ffc3cb678bf84e36cbaf4e47d966", "spec_path": "specs/t27f/token_floor_scenes.t27", "tests": { "failed": 0, diff --git a/specs/t27f/pbr_sphere.t27 b/specs/t27f/pbr_sphere.t27 index 675419ec11..bddff40b3c 100644 --- a/specs/t27f/pbr_sphere.t27 +++ b/specs/t27f/pbr_sphere.t27 @@ -83,7 +83,7 @@ pub const SHUTTER : f64 = 0.5; // 180 degrees: the shutter is open // ---- small helpers ---- -fn clamp01(x: f64) -> f64 { +pub fn clamp01(x: f64) -> f64 { if (x < 0.0) { return 0.0; } if (x > 1.0) { return 1.0; } return x; diff --git a/specs/t27f/token_floor.t27 b/specs/t27f/token_floor.t27 index 315847ef2b..d3680ea90f 100644 --- a/specs/t27f/token_floor.t27 +++ b/specs/t27f/token_floor.t27 @@ -133,6 +133,7 @@ use t27f::pbr_sphere::swept_cover; use t27f::pbr_sphere::swept_mid; use t27f::pbr_sphere::SHUTTER; use t27f::pbr_sphere::NO_NB; +use t27f::pbr_sphere::clamp01; pub const ID : str = "token-floor"; pub const VERSION : u8 = 1; @@ -689,12 +690,6 @@ fn pd_closed(t: f64, x0: f64, g: f64) -> f64 { // ---- light ---- -fn clamp01(x: f64) -> f64 { - if (x < 0.0) { return 0.0; } - if (x > 1.0) { return 1.0; } - return x; -} - fn key_w(d: f64) -> f64 { return gauss(d * d, KEY_R); } diff --git a/specs/t27f/token_floor_scenes.t27 b/specs/t27f/token_floor_scenes.t27 index 1942bfec19..b1f27329f6 100644 --- a/specs/t27f/token_floor_scenes.t27 +++ b/specs/t27f/token_floor_scenes.t27 @@ -32,6 +32,8 @@ module token_floor_scenes; +use t27f::pbr_sphere::clamp01; + pub const ID : str = "token-floor-scenes"; pub const SCENE_FRAMES : i32 = 450; // token_floor's FRAMES; a test there holds them equal pub const SCENE_FPS : i32 = 30; @@ -102,12 +104,6 @@ fn cam_f(o: usize, s: usize, k: usize) -> f64 { return CAM[o * 48 + s * 6 + k]; } -fn clamp01(x: f64) -> f64 { - if (x < 0.0) { return 0.0; } - if (x > 1.0) { return 1.0; } - return x; -} - // 6 t^5 - 15 t^4 + 10 t^3: starts and stops with no speed and no acceleration. pub fn smoother(t: f64) -> f64 { const u = clamp01(t);