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
18 changes: 9 additions & 9 deletions .trinity/seals/t27os_T27osLanesView.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"built_by": "t27c-bootstrap@0.5.2+69eef64da",
"built_by": "t27c-bootstrap@0.5.2+7d83327e5",
"closure": [
{
"spec": "specs/t27os/agents.t27",
Expand All @@ -15,23 +15,23 @@
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:80addc45c320545c62052700530a65e36714d066aaa820c85d88a49a3294670c",
"gen_hash_rust": "sha256:4b9426ab1fcec614f0eb54af2fa8835d66da36b22336bd360b58ba8001b565d1",
"gen_hash_verilog": "sha256:2a0305d40d7f9d957cd73a43aacc22a21b7923775688a1b52394c58dae8d7b45",
"gen_hash_zig": "sha256:c845b85ca710b13e369bb51b57138972a19dee90f773254aec47ca116e458bf4",
"gen_hash_c": "sha256:64a4959435eb90ce40f5823f531d6e1c2aa0a01241e43a77d8ad86c9774f8a90",
"gen_hash_rust": "sha256:d3fa17e6d5097c06f69311fe93ece154a5910bee8f5bd2d978dc72326cbb4a2b",
"gen_hash_verilog": "sha256:381d71ddebf8ab5f7b88d6842d01df1c2dec009cbd05e6c186fe4e3245470989",
"gen_hash_zig": "sha256:27cdd3529fc6e57f8e079a858a45b0707bc5020b5fb79f601ef69e3a92abb206",
"module": "T27osLanesView",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-24T16:49:37Z",
"sealed_at": "2026-10-24T18:48:03Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:3466d553ab57406af0965fe96faa0078a2c52d28df04a1361452efbb756d9680",
"spec_hash": "sha256:7844df92d0477427af306fce15aace05c1962f92177d24b0dc6d4b5d0c39edad",
"spec_path": "specs/t27os/lanes_view.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 33,
"total": 33,
"passed": 34,
"total": 34,
"vacuous": 0
},
"toolchain": {
Expand Down
24 changes: 22 additions & 2 deletions specs/t27os/lanes_view.t27
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,17 @@ pub fn lv_rank(src: u32, state: u32) -> u32 {
return LVR_OTHER;
}

/// Copy row `a` over row `b` (fields and bytes).
/// Copy row `a` over row `b` (fields and bytes). Only the row's LVF_TLEN bytes are copied: lv_add writes no
/// more, and the rest of the LV_LINE slot is memory nobody wrote.
fn lv_copy_row(tab: []u32, txt: []u8, a: u32, b: u32) -> void {
const len : usize = @as(usize, tab[@as(usize, a) * LV_F + LVF_TLEN]);
var f : usize = 0;
while (f < LV_F) {
tab[@as(usize, b) * LV_F + f] = tab[@as(usize, a) * LV_F + f];
f = f + 1;
}
var i : usize = 0;
while (i < LV_LINE) {
while (i < len) {
txt[@as(usize, b) * LV_LINE + i] = txt[@as(usize, a) * LV_LINE + i];
i = i + 1;
}
Expand Down Expand Up @@ -1123,6 +1125,24 @@ test rows_are_ordered_by_importance {
assert tab[LVF_ISSUE] == 12 and tab[LV_F + LVF_ISSUE] == 11;
}

test a_row_copy_moves_only_the_written_bytes {
var tab : [576]u32 = undefined;
var txt : [5200]u8 = undefined;
var k : usize = 0;
while (k < 2 * LV_LINE) {
txt[k] = 48;
if (k >= LV_LINE) { txt[k] = 35; }
k = k + 1;
}
var n : u32 = 0;
n = lv_add(tab[0..576], txt[0..5200], n, LV_SCRIPT, 7, 0, L_NONE, LVS_RUNNING, 0, 0, "ab");
n = lv_add(tab[0..576], txt[0..5200], n, LV_SCRIPT, 8, 0, L_NONE, LVS_RUNNING, 0, 0, "x");
lv_copy_row(tab[0..576], txt[0..5200], 0, 1);
assert lv_row_text(txt[0..5200], tab[0..576], 1) == "ab";
assert tab[LV_F + LVF_ISSUE] == 7;
assert txt[LV_LINE + 2] == 35 and txt[2 * LV_LINE - 1] == 35;
}

test the_sort_is_stable_for_equal_ranks {
var tab : [576]u32 = undefined;
var txt : [5200]u8 = undefined;
Expand Down
Loading