From 997bc787a6aa9f5a70bf1eb3fb661b3aa736f6e2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 18 Oct 2026 23:45:52 +0700 Subject: [PATCH] analog: linear_zoh.t27 -- rename struct Ring to RingPeak, it collided with another type named Ring and moved the types ratchet 107 -> 108 (Closes #10503) PR #10528 merged specs/analog/linear_zoh.t27 with `pub struct Ring`. The corpus-ratchet job ran `tri types ratchet` and failed: ledger 107 names, observed 108, "+ Ring NEW conflict" -- a type name with two definitions in the corpus. The job is not a required check, so the merge went through; master is red on it until this lands. The struct holds the peak amplitude of the scheme and the analytic one in the tank test. Renamed to RingPeak (no other definition of that name). Nothing else changes: the same 15 tests pass with 0 vacuous, the seal is re-saved (15/15), `tri types ratchet` is CLEAN at 107/107, dupe_scan says ok. Co-Authored-By: Claude Sonnet 5.5 --- .trinity/seals/analog_AnalogLinearZoh.json | 12 ++++++------ specs/analog/linear_zoh.t27 | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.trinity/seals/analog_AnalogLinearZoh.json b/.trinity/seals/analog_AnalogLinearZoh.json index b329f1ff7f..e35145d552 100644 --- a/.trinity/seals/analog_AnalogLinearZoh.json +++ b/.trinity/seals/analog_AnalogLinearZoh.json @@ -7,16 +7,16 @@ } ], "config": "gen=c,rust,verilog,zig;tests=zig", - "gen_hash_c": "sha256:cfe65aeacc84e2ef7c4f413af9af6efcd2e822d94077b346f0cf98d3ac2e79fb", - "gen_hash_rust": "sha256:a8f9123547ada3c60d11b510199af61813a635716162b47e1a6881dcf4cf144b", - "gen_hash_verilog": "sha256:36bd6536290b5b4d43aba8e3486c19cbf0260d34ce12d62f12ac4ebf2012b27c", - "gen_hash_zig": "sha256:2be378a1b5e61863821678240b494a8163b054b58ff4d67af5f0cabb7ad2c5d2", + "gen_hash_c": "sha256:4f6838fc8b2add48d0ca906b05928493b2d7646db681bc53bfc4a598ee4fc713", + "gen_hash_rust": "sha256:22317f456376ca9cc1a83402bc38dfaa3b97dc4fb36948e7742f314debe00cec", + "gen_hash_verilog": "sha256:3e34a405e67336f5bf99cd169a6f45c1c71ba38f18e40857a12861205db9a64b", + "gen_hash_zig": "sha256:d5a8816e44b48a2b4dda1ccb0dad9632a7f0a7cd739d381465a821179195351d", "module": "AnalogLinearZoh", "ring": 12, "seal_schema": 2, - "sealed_at": "2026-10-18T16:38:16Z", + "sealed_at": "2026-10-18T16:45:46Z", "sealed_by": "t27c-bootstrap@0.5.2", - "spec_hash": "sha256:b1dde6dbbfb691939c803847318166635d0e5b709510f527200b9ad2d796f64a", + "spec_hash": "sha256:ed6796c7410e7717271fc1074c278e8d6f8eb68aad519f5997700d9e41375b1b", "spec_path": "specs/analog/linear_zoh.t27", "tests": { "failed": 0, diff --git a/specs/analog/linear_zoh.t27 b/specs/analog/linear_zoh.t27 index 1ffb14aca4..b644ccd8c1 100644 --- a/specs/analog/linear_zoh.t27 +++ b/specs/analog/linear_zoh.t27 @@ -473,7 +473,7 @@ pub fn rc_ex_err(j: u32, steps: u32) -> GridErr { ; --- the ring: amplitude after 100 periods ------------------------------------------------------------- -pub struct Ring { scheme: f64, analytic: f64 } +pub struct RingPeak { scheme: f64, analytic: f64 } /// Steps per damped period of the series RLC of resistance r at step dt. pub fn period_steps(r: f64, dt: f64) -> f64 { @@ -492,7 +492,7 @@ pub fn ring_w(r: f64, dt: f64) -> u32 { /// The f64 scheme (dense pair mn of n states, capacitor voltage in state iv) on the step input for PERIODS periods: /// the largest |1 - v_C| in the closing window, beside the analytic one over the same steps. -pub fn ring_f64(n: usize, mn: []const f64, iv: usize, r: f64, dt: f64) -> Ring { +pub fn ring_f64(n: usize, mn: []const f64, iv: usize, r: f64, dt: f64) -> RingPeak { const k : u32 = ring_k(r, dt); const w : u32 = ring_w(r, dt); var x : [5]f64 = [0.0] ** 5; @@ -525,11 +525,11 @@ pub fn ring_f64(n: usize, mn: []const f64, iv: usize, r: f64, dt: f64) -> Ring { } t = t + 1; } - return Ring { scheme: ps, analytic: pa }; + return RingPeak { scheme: ps, analytic: pa }; } /// The same with the integer step of M1 (sign-magnitude words, d and nv the stored constants), u = 1 V throughout. -pub fn ring_fixed(n: usize, d: []const u32, nv: []const u32, iv: usize, r: f64, dt: f64) -> Ring { +pub fn ring_fixed(n: usize, d: []const u32, nv: []const u32, iv: usize, r: f64, dt: f64) -> RingPeak { const k : u32 = ring_k(r, dt); const w : u32 = ring_w(r, dt); var x : [5]u32 = [0] ** 5; @@ -551,7 +551,7 @@ pub fn ring_fixed(n: usize, d: []const u32, nv: []const u32, iv: usize, r: f64, } t = t + 1; } - return Ring { scheme: ps, analytic: pa }; + return RingPeak { scheme: ps, analytic: pa }; } ; --- the tests ---------------------------------------------------------------------------------- @@ -1014,20 +1014,20 @@ test the_lc_tank_keeps_its_amplitude_after_100_periods_and_backward_euler_does_n assert_eq(ring_w(R_TANK, dt), 127); // the exact scheme, f64 const me : [30]f64 = rlc_zoh(R_TANK, dt, PADE_ORDER); - const re : Ring = ring_f64(2, &me, 0, R_TANK, dt); + const re : RingPeak = ring_f64(2, &me, 0, R_TANK, dt); assert(re.analytic > 0.2111); assert(re.analytic < 0.2112); assert(near(re.scheme / re.analytic, 1.0, GRID_TOL)); assert(near(re.scheme / re.analytic, 1.0, 0.01)); // the exact scheme, Q.24 constants and the integer step - const rf : Ring = ring_fixed(2, &ZTK_D, &ZTK_NV, 0, R_TANK, dt); + const rf : RingPeak = ring_fixed(2, &ZTK_D, &ZTK_NV, 0, R_TANK, dt); assert(near(rf.analytic, re.analytic, 0.0000000000001)); assert(near(rf.scheme / rf.analytic, 1.0, 0.01)); assert(rf.scheme / rf.analytic > 1.0002); assert(rf.scheme / rf.analytic < 1.0004); // backward Euler, f64: 3.75e-8 of 0.2111 const mb : [30]f64 = be_rlc(R_TANK, dt); - const rb : Ring = ring_f64(3, &mb, 1, R_TANK, dt); + const rb : RingPeak = ring_f64(3, &mb, 1, R_TANK, dt); assert(near(rb.analytic, re.analytic, 0.0000000000001)); const loss : f64 = rb.scheme / rb.analytic; assert(loss > 0.00000017);