Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .trinity/seals/t27f_T27fFormulaTable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"built_by": "t27c-bootstrap@0.5.2+72ddaf7ac",
"closure": [],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:6634050ae732df97c0f82b12dc33507bbaad64e0f756a483a01f0ee3b895142a",
"gen_hash_rust": "sha256:4c55e68190df1eac153777d665ed137da934bc782eb27c920b5a33db796a8627",
"gen_hash_verilog": "sha256:b1512da42459deb04c3eef8a612e1f1f6140d7158cfb5fb194fe34303c8065a7",
"gen_hash_zig": "sha256:f97bf28a419159210910c0de2174d662b9a135a3b4c8d73d9a5f4a642ecf8261",
"module": "T27fFormulaTable",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-20T17:35:40Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:86fa1a3bdbc03a80e988e9f5417f16ed01a868d0634d6815d8dd57fb38a2b84b",
"spec_path": "specs/t27f/formula_table.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 9,
"total": 9,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:8512b80da533b79289110fca4a65f3336abd7a059ca4b72ea595d5e33ff8ad10",
"zig": "0.16.0"
}
}
18 changes: 9 additions & 9 deletions .trinity/seals/t27os_T27osOrbitView.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@
},
{
"spec": "specs/t27f/formula_table.t27",
"spec_hash": "sha256:59d968f6cfd27ba742a07208fd7f0cb25c1cabf4052c9526f8fd9058e1721053"
"spec_hash": "sha256:86fa1a3bdbc03a80e988e9f5417f16ed01a868d0634d6815d8dd57fb38a2b84b"
},
{
"spec": "specs/t27os/lanes_view.t27",
"spec_hash": "sha256:41cf6b34d5ef8bd27c5e8f471cd4a08797cad9eea96833f2c301d42d8dfcfd6a"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:c2b1381bc6b2b2221f83af364002486db06ef77ad188b9643304e005777fa016",
"gen_hash_rust": "sha256:9f0309d52837cc73ade2f9f740e688b7c3813a682d2c4189260736e64e977e47",
"gen_hash_verilog": "sha256:82ec427976d9d02dbf454147ba713f83ba4f66395fc7ac8c92484318822a31f8",
"gen_hash_zig": "sha256:62ac52e15bc276614fb59ffcdf60cb688454f02183cb7b6393438ac8639ec215",
"gen_hash_c": "sha256:960027342e19795cd625d4dbde86c152cb75e508d87555a7441eb0bd290b099f",
"gen_hash_rust": "sha256:68a5142ac223bd3c6a3416d6eb3b3641cc7e8fd4f9af27eb3c97c5fb428583fb",
"gen_hash_verilog": "sha256:01b1aa964c2ad8d0fa5392a971aad42d7e63d1d0a3f11e79f5c6124f6ec3bb14",
"gen_hash_zig": "sha256:e7f27f968326b00002f83170724c71c5a68037c126306f16bafc92b43ee7d296",
"module": "T27osOrbitView",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-20T17:11:19Z",
"sealed_at": "2026-10-20T17:35:29Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:b8a41ef1b4d052045fc52b25536c7edeca99cfadf32fb2c53f85d79313d43c66",
"spec_hash": "sha256:92912f044a00945a9443479d367b83ad0f7a60be0290f59edaa03ac4cac42d8c",
"spec_path": "specs/t27os/orbit_view.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 10,
"total": 10,
"passed": 12,
"total": 12,
"vacuous": 1
},
"toolchain": {
Expand Down
768 changes: 748 additions & 20 deletions specs/t27f/formula_table.t27

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions specs/t27os/orbit_view.t27
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ use t27f::formula_table::FORMULA_TEXT;
use t27f::formula_table::formula_field_start;
use t27f::formula_table::formula_field_len;
use t27f::formula_table::err_milli_pct;
use t27f::formula_table::ROW_COUNT;
use t27f::formula_table::TAG_VERIFIED;
use t27f::formula_table::TAG_CANDIDATE;
use t27f::formula_table::CLOSE_MILLI_PCT;
use t27f::formula_table::tag_of;
use t27f::formula_table::repro_milli_pct;

pub const OV_MAX : usize = 32;
/// A frame that took longer than this is clamped (the window was asleep or dragged), so the labels never jump.
Expand Down Expand Up @@ -78,6 +84,29 @@ pub fn ov_animates(visible: bool, reduce: bool, placed: usize) -> bool {
return visible and reduce == false and placed > 0;
}

// ---- which rows the orbit may show, and how bright (owner 2026-10-21: VERIFIED and candidate rows, |err| <= 1 percent, candidates a little dimmer) ----
// formula_table.t27 now holds every close hit (ROW_COUNT rows) with a TAG and the error recomputed against the cited measured value. The rule is here;
// the window still draws the first FORMULA_COUNT = OV_MAX = 32 rows (glass_window.t27 sizes its arrays by 32), so wiring the rule into the draw loop and
// raising that cap is the next step. Conjectures never show; a row whose recomputed error is beyond 1 percent never shows, whatever its tag says.
pub const OV_ALPHA_VERIFIED : i64 = 1000;
pub const OV_ALPHA_CANDIDATE : i64 = 720;

/// The alpha (permille) of a row from its tag and its recomputed error in thousandths of a percent; 0 = not shown.
pub fn ov_row_alpha_permille(tag: u32, repro_milli: i64) -> i64 {
var m : i64 = repro_milli;
if (m < 0) { m = 0 - m; }
if (m > CLOSE_MILLI_PCT) { return 0; }
if (tag == TAG_VERIFIED) { return OV_ALPHA_VERIFIED; }
if (tag == TAG_CANDIDATE) { return OV_ALPHA_CANDIDATE; }
return 0;
}

/// The alpha of row i of the table (0 = hidden).
pub fn ov_row_alpha(i: u32) -> i64 {
if (i >= ROW_COUNT) { return 0; }
return ov_row_alpha_permille(tag_of(i), repro_milli_pct(i));
}

/// Field f (OF_*) of formula i copied into out; the length.
pub fn ov_field(i: u32, f: u32, out: []u8) -> usize {
if (i >= FORMULA_COUNT) { return 0; }
Expand Down Expand Up @@ -677,3 +706,33 @@ test phi_pi_and_exponents_are_drawn_as_math_with_utf8_bytes_from_a_table {
i = i + 1;
}
}

test the_orbit_shows_verified_and_candidate_rows_within_1_percent_candidates_dimmer {
assert ov_row_alpha_permille(0, 620) == 1000;
assert ov_row_alpha_permille(0, 0 - 620) == 1000;
assert ov_row_alpha_permille(1, 999) == 720;
assert ov_row_alpha_permille(1, 1000) == 720;
assert ov_row_alpha_permille(1, 1001) == 0;
assert ov_row_alpha_permille(0, 1360) == 0;
assert ov_row_alpha_permille(2, 0) == 0;
assert OV_ALPHA_CANDIDATE < OV_ALPHA_VERIFIED and OV_ALPHA_CANDIDATE > 0;
}

test the_rule_on_the_table_hides_far_registry_rows_and_every_conjecture {
assert ov_row_alpha(0) == 1000;
assert ov_row_alpha(8) == 0;
assert ov_row_alpha(32) == 720;
assert ov_row_alpha(ROW_COUNT - 1) == 0;
assert ov_row_alpha(ROW_COUNT) == 0;
var shown : u32 = 0;
var bright : u32 = 0;
var i : u32 = 0;
while (i < ROW_COUNT) {
const a : i64 = ov_row_alpha(i);
if (a > 0) { shown = shown + 1; }
if (a == OV_ALPHA_VERIFIED) { bright = bright + 1; }
i = i + 1;
}
assert bright == 20;
assert shown == 91;
}
Loading