Skip to content

spec(port): land the CR-CHAT-03 wave 3 batch -- 23 targets (Refs #8883) - #10802

Open
dmitrii-f-t27 wants to merge 31 commits into
gHashTag:masterfrom
dmitrii-f-t27:port/cr-chat-03-wave3
Open

dmitrii-f-t27 wants to merge 31 commits into
gHashTag:masterfrom
dmitrii-f-t27:port/cr-chat-03-wave3

Conversation

@dmitrii-f-t27

@dmitrii-f-t27 dmitrii-f-t27 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Goal

Deliver the remaining CR-CHAT-03 targets of the 47-target ring (tracker #8883, epic gHashTag/trios#1812) as one ring-batch PR, per specs/policy/pr_budget.t27 (#10067/#10074): the ten wave-3 targets this PR opened with, plus the thirteen TreeKEM tree/update-path guards batched onto the same ring branch.

Targets (wave 3)

  1. reinit_freshness (12 tests)
  2. transcript_hash_chain (13)
  3. treekem_blank_leaf_count_bound_guard (13)
  4. treekem_epoch_transition_integrity_guard (12; the max/max_count ceilings split: u32 depth vs usize count)
  5. treekem_group_membership_change_rate_guard (12; window_start not ported -- unread in the original)
  6. treekem_group_membership_epoch_continuity_guard (13)
  7. treekem_leaf_node_key_freshness_guard (13)
  8. treekem_leaf_node_version_monotonicity_guard (13)
  9. treekem_parent_hash_binding (13)
  10. treekem_parent_hash_chain_continuity_guard (12)

Targets (the thirteen added to the same ring batch)

  1. treekem_parent_node_resolution_depth_guard (12; DuplicateInPath on path[pos] plus ZeroNode, NotIncreasing, the u32/u64/usize max splits)
  2. treekem_path_secret_forward_secrecy_guard (12; verdict is the code alone)
  3. treekem_path_secret_freshness_guard (12; zero update id answers as DuplicateUpdateId, exactly as the original)
  4. treekem_path_secret_uniqueness_guard (12; the first-owner HashMap answers node_a via a forward prefix scan)
  5. treekem_resolution_node_coverage_guard (12; Vec becomes [256]u32 + covered_len, the u32 actual lands as usize with the declared side widened; the incomplete-coverage rule stays declared and unreachable as in the original)
  6. treekem_resolution_path_node_uniqueness_guard (12; Vec<[u8;16]> becomes [65]TrnuNode with node_len)
  7. treekem_sibling_node_independence_guard (12; the two-pass order kept: per-node rules first, the shared-key scan only after a clean first pass)
  8. treekem_unmerged_leaf_count_accumulation_guard (12)
  9. treekem_update_path_coverage_guard (12; the repeated index answers before the non-increasing one, as in the original)
  10. treekem_update_path_length_bound_guard (12)
  11. treekem_update_path_secret_uniqueness_guard (12; reads as TPSU2 - the ring already carries a path secret uniqueness guard on the same prefix)
  12. treekem_update_path_uniqueness_guard (12)
  13. treekem_update_path_validation (12; verdict is the code alone; the leaf-start rule answers as PathTooShort, as in the original)

282 tests in total (126 + 156). Sources: gHashTag/trios @ 8b229e9489ee, crates/trios-chat/rings/CR-CHAT-03/src/<stem>.rs.

Battery

Per spec on the branch tree (master + these twenty-three): t27b test --blockers 0 failed, 0 blockers; t27c test-report pass == tests, 0 FAIL, 0 vacuous; gen 0 unimplemented; gen-rust compiles under rustc (0 &'static str, 0 Vec<const); coverage Untested 0; seals re-saved against the merged master and verified 6/6 MATCH. The expectations ledger carries one path-sorted row per spec. duplicate-bodies green (dupe_scan.py ok on the merged tree: no new group, none grew).

Refs #8883.

CR-CHAT-03 W3 T-PORT: crates/trios-chat/rings/CR-CHAT-03/src/reinit_freshness.rs. Five rules in the original's fixed order - non-zero new group id, group-id change, no version downgrade, no version leap, and no committer-only welcomers in a multi-member group - carried as the D5 verdict. 12 tests: the ten original RIN cases plus the helper's direct test and a rule-order probe. Shared ids32_equal and all_zero_bytes come from the CR-CHAT helpers module.
CR-CHAT-03 W3 T-PORT: crates/trios-chat/rings/CR-CHAT-03/src/transcript_hash_chain.rs. Seven per-entry rules in the original's fixed order; the BTreeSet of confirmed hashes becomes a scan over visited entries, the Vec<u8> hashes become sixty-four-byte buffers with lengths. 13 tests: the ten original THASH cases plus two helper tests and a rule-order probe that keeps the first-entry epoch exemption.
…Tag#8883)

CR-CHAT-03 W3 T-PORT: crates/trios-chat/rings/CR-CHAT-03/src/treekem_blank_leaf_count_bound_guard.rs. Six rules in the code's fixed order: the batch ceiling, then per snapshot the min and max leaf counts, the power-of-two shape (an eleven-entry table scan, t27 has no bitwise ops), the blank-exceeds-total rule and the blank ratio ceiling. 13 tests: the ten original BLCB cases plus two helper tests and a rule-order probe.
…HashTag#8883)

CR-CHAT-03 W3 T-PORT: crates/trios-chat/rings/CR-CHAT-03/src/treekem_epoch_transition_integrity_guard.rs. Six rules in the code's fixed order: the batch ceiling, the non-zero epoch, the depth ceiling, the strictly increasing epoch, the changed hash, the fresh hash. The BTreeSet becomes a visited scan; 12 tests: the ten original TETI cases plus the helper and a rule-order probe.
…HashTag#8883)

The D5 verdict carried one max field, but the original's TooMany carries a usize count ceiling while DepthExceeded carries a u32 depth ceiling; gen-rust compiled the usize into the u32 field. The verdict now has max (u32) for the depth and max_count (usize) for the batch. Re-sealed; t27b 12/12, test-report 12/12, rustc 0.
CR-CHAT-03 W3 T-PORT: crates/trios-chat/rings/CR-CHAT-03/src/treekem_group_membership_change_rate_guard.rs. Six rules in the code's fixed order: the batch ceiling, the non-zero epoch, the increasing epoch, the minimum window duration, the change-count ceiling, the change-type vocabulary. Vec<u8> types become a fixed buffer with a length; window_start is unread and does not cross. 12 tests: the ten original GMCR cases plus the helper and a rule-order probe.
CR-CHAT-03 W3 T-PORT: crates/trios-chat/rings/CR-CHAT-03/src/treekem_group_membership_epoch_continuity_guard.rs. Six rules in the code's fixed order: the batch ceiling, the non-zero id, the fresh id, the non-zero epoch, the +1 epoch step, the operation-type vocabulary. BTreeSet becomes a visited scan through shared ids16_equal/zero_id16; Option<u64> becomes a flag; the three got payloads (u64 epoch, u8 type, usize count) are separate fields. 13 tests.
CR-CHAT-03 W3 T-PORT: crates/trios-chat/rings/CR-CHAT-03/src/treekem_leaf_node_key_freshness_guard.rs. Six rules in the code's fixed order: the batch ceiling, the non-zero timestamp, the non-zero hash, the unique index, the fresh hash, the maximum age (a future key is not aged, as in the original). Two BTreeSets become visited scans; the u64 age ceiling and usize leaf ceiling stay separate fields. 13 tests.
…Tag#8883)

CR-CHAT-03 W3 T-PORT: crates/trios-chat/rings/CR-CHAT-03/src/treekem_leaf_node_version_monotonicity_guard.rs. Six rules in the code's fixed order: the batch ceiling, the non-zero group id, the non-zero leaf id, the non-zero version, the fresh leaf-and-version pair, the strictly increasing version per leaf. BTreeSets become visited scans; zero is the not-seen sentinel for the previous-version lookup because the zero-version rule rejects it. 13 tests.
CR-CHAT-03 W3 T-PORT: crates/trios-chat/rings/CR-CHAT-03/src/treekem_parent_hash_binding.rs. Six rules in the code's fixed order: bounds, root/leaf exemptions, sibling inside the tree, non-empty hash, canonical length, recomputed match. Hash bytes travel as thirty-two u64 lanes (no u64-to-u8 narrowing), BE extraction through a power-of-256 table, sibling by plain arithmetic; ComputationFailed stays in the enum though no path produces it. 13 tests.
…g#8883)

CR-CHAT-03 W3 T-PORT: crates/trios-chat/rings/CR-CHAT-03/src/treekem_parent_hash_chain_continuity_guard.rs. Six rules in the code's fixed order: the batch ceiling, per chain the depth ceiling, the zero and duplicate node ids, the root's zero parent hash, and the link rule parent_hash[i] == hash[i+1]. The unread chain_id does not cross; nodes ride a fixed 33-slot capacity padded by a const record; BTreeSet becomes a visited scan through the shared ids16_equal/zero_id16. 12 tests.
…g#8883)

Ports crates/trios-chat/rings/CR-CHAT-03/src/treekem_parent_node_resolution_depth_guard.rs: the batch ceiling, the zero node, the node ceiling, the depth ceiling and the per-path duplicate and strictly-increasing probes, in the code's order. The Vec<u64> path becomes a fixed [32]u64 with path_len; the BTreeSet probe becomes a seen-before scan; the three same-named max payloads split into max (u32), max_count (usize) and max64 (u64). Twelve tests: the original ten verbatim plus the scan-helper and rule-order probes. Battery: t27b 0 failed, test-report 0 FAIL 0 vacuous, gen-rust rustc-clean, coverage Untested 0, seal 6/6 MATCH; one path-sorted ledger row.
…#8883)

Ports crates/trios-chat/rings/CR-CHAT-03/src/treekem_path_secret_forward_secrecy_guard.rs: the empty, minimum and maximum path ceilings, then per secret the length, the zero probe and the duplicate, in the code's order. The &[Vec<u8>] becomes a slice of PathSecret records with the live length in data_len; the BTreeSet probe becomes a seen-before scan on the shared ids32_equal; the zero probe is its own record-bound scan. The error variants carry no payloads, so the verdict is the code alone. Twelve tests: the original ten verbatim plus the probe and rule-order tests. Battery: t27b 0 failed, test-report 0 FAIL 0 vacuous, gen-rust rustc-clean, coverage Untested 0, seal 6/6 MATCH; one path-sorted ledger row.
Ports crates/trios-chat/rings/CR-CHAT-03/src/treekem_path_secret_freshness_guard.rs: the batch ceiling, then per update the zero id (the original answers it as DuplicateUpdateId), the repeated id, the zero epoch, the node ceiling, the zero secret and the repeated epoch+node pair, in the code's order. The two BTreeSet probes become seen-before scans; the id scans ride the shared ids16_equal and zero_id16; the zero-secret probe is its own record-bound scan. The usize got/max of TooMany and the u64 got/max of NodeOutOfRange land in got/max_count and got64/max64. Twelve tests: the original ten verbatim (the 513-record boundary table materialized) plus the probe and rule-order tests. Battery: t27b 0 failed, test-report 0 FAIL 0 vacuous, gen-rust rustc-clean, coverage Untested 0, seal 6/6 MATCH; one path-sorted ledger row.
Ports crates/trios-chat/rings/CR-CHAT-03/src/treekem_path_secret_uniqueness_guard.rs: the batch ceiling, then per node the index ceiling, the zero secret, the repeated index and the repeated secret, in the code's order. The BTreeSet probes and the first-owner HashMap become seen-before scans; the secret scans ride the shared ids32_equal; the first-owner scan answers node_a. The payloads are node indices (u64), carried in node/node_a/node_b. Twelve tests: the original ten verbatim (both boundary tables materialized) plus the probe and rule-order tests. Battery: t27b 0 failed, test-report 0 FAIL 0 vacuous, gen-rust rustc-clean, coverage Untested 0, seal 6/6 MATCH; one path-sorted ledger row.
Ports crates/trios-chat/rings/CR-CHAT-03/src/treekem_resolution_node_coverage_guard.rs: the batch ceiling, then per entry the zero id, the count equality, then per position the ceiling and the duplicate, in the code's order; the incomplete-coverage rule stays declared and unreachable exactly as in the original. The Vec<u32> positions become a fixed [256]u32 with covered_len; the BTreeSet probe becomes a seen-before scan; the u32 actual payload lands as usize with the comparison widening the declared side. Twelve tests: the original ten verbatim (the 2049-entry boundary table as well-formed identical records, TETI-style) plus the probe and rule-order tests. Battery: t27b 0 failed, test-report 0 FAIL 0 vacuous, gen-rust rustc-clean, coverage Untested 0, seal 6/6 MATCH; one path-sorted ledger row.
…name to ErrRange (Refs gHashTag#8883)

The owner resolved the Range collision out-of-band (7bd197b, rename to ErrRange, Closes gHashTag#10891), so the classification row went STALE and the ratchet now fails a resolved name on purpose. Dropped from the blessed ledger, the classified record (109 names: 60 DRIFT, 49 DISTINCT) and the TYPE_CONFLICTS.md table, with the repair noted in the narrative the same way the 2026-10-02 repairs are. Both gates on the refreshed tree: ratchet CLEAN (109/109), classified OK.
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

Branch refreshed against master again (merge 03a65ce + 3408691): picked up the owner's ErrRange rename (the Range classification row went STALE and is dropped per the ratchet's own rule - the repair is noted in TYPE_CONFLICTS.md like the 2026-10-02 ones), the five new expectations-ledger rows, and the devhome baseline pin. Every gate re-verified on the refreshed tree locally: types ratchet CLEAN 109/109, classified OK (60 DRIFT, 49 DISTINCT), corpus suite ratchet CLEAN 65/65, verilog-widths OK 10 known 0 new, the loop-tools ledger test PASS, devhome scan OK, battery over the 13 TreeKEM specs 13/13 PASS, seals re-verified (only sealed_at churn reverted). The duplicate-bodies red that will show on the merge tree is master's own: 12 bodies copied 2x between specs/igla/coder/ternary_gemm_ptx.t27 and hslm_bwd_ptx.t27 (landed on master via #10855, no ring spec participates) - master's duplicate-bodies run is red on its own head since 07:23Z. CI re-runs on the new head.

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

Ready for merge, @gHashTag — the CI verdict on head 340869106 is READY, and every remaining red is master's own at 00ecf46ab (newer runs going), not this branch's delta:

  • t27b-native-ratchet: UNEXPECTED FAILURE 0, UNEXPECTED PASS 0; the four UNLISTED are master's newest specs (raw_writer, hslm_bwd_ptx, eval_hslm, zig_convert) not yet in the expectations ledger — the ledger catch-up is master-side, same as his five rows in c9ae710. Master's own run is red at 00ecf46.
  • duplicate-bodies: the 12 copied-2x bodies are all between specs/igla/coder/ternary_gemm_ptx.t27 and hslm_bwd_ptx.t27 (spec(igla): hslm_bwd_ptx -- HSLM backward dX and dW as int8 tensor-core PTX written by t27 (Closes #10847) #10855, master); no ring spec participates in any group. Master's own run red at 00ecf46.
  • Every source file is reachable from its crate root: the orphan ceiling is breached in cli/tri (src/renum.rs) and bootstrap — crates this PR does not touch (it adds no Rust files at all). Master red at 00ecf46.

Two of this branch's checks were red earlier today and are fixed at the cause, now green in this run: Verilog widths (the four batch-boundary tables recorded in the widths ledger with the exact arithmetic — 10 known, 0 new) and Corpus ratchet (the three conflicted names read and classified DISTINCT — UpdatePathRecord and TreeNode as module-scoped facts of the trios-chat crate, Range dropped after the owner's ErrRange repair #10892 — types ratchet CLEAN 109/109, classified OK). loop-tools-tracked, coverage, natives, validate, parse-ratchet, spec-guards, scan, emit-bitexact, untrusted-input, cli-tri: all pass on this head.

Ready for merge, @gHashTag — the CR-CHAT-03 ring batch is complete: 23 targets, 282 tests.

Battery (branch tree at 1995852, refreshed against master incl. merged #10795)

  • t27b test --blockers per spec: 0 failed, 0 blockers; t27c test-report: pass == tests, 0 FAIL, 0 vacuous; gen 0 unimplemented; gen-rust compiles under rustc (0 &'static str, 0 Vec<const); coverage Untested 0; seals re-saved against the merged master, 6/6 MATCH.
  • duplicate-bodies gate: ok — no new group, none grew (687 of 14239 bodies in 197 groups on the deduped baseline).
  • verilog-widths: the four batch-boundary tables (the original tests pin len = max+1) are recorded in the widths ledger with the exact arithmetic — check green: 10 known, 0 new.
  • Expectations ledger: one path-sorted row per spec (2119 entries, sorted, unique).

Targets (10 wave-3 + 13 TreeKEM tree/update-path guards)

reinit_freshness, transcript_hash_chain, treekem_blank_leaf_count_bound_guard, treekem_epoch_transition_integrity_guard, treekem_group_membership_change_rate_guard, treekem_group_membership_epoch_continuity_guard, treekem_leaf_node_key_freshness_guard, treekem_leaf_node_version_monotonicity_guard, treekem_parent_hash_binding, treekem_parent_hash_chain_continuity_guard, treekem_parent_node_resolution_depth_guard, treekem_path_secret_forward_secrecy_guard, treekem_path_secret_freshness_guard, treekem_path_secret_uniqueness_guard, treekem_resolution_node_coverage_guard, treekem_resolution_path_node_uniqueness_guard, treekem_sibling_node_independence_guard, treekem_unmerged_leaf_count_accumulation_guard, treekem_update_path_coverage_guard, treekem_update_path_length_bound_guard, treekem_update_path_secret_uniqueness_guard, treekem_update_path_uniqueness_guard, treekem_update_path_validation.

With #10175 (18 specs) and merged #10795 (dedup) this closes every guard target of CR-CHAT-03 at the pinned ref 8b229e9489ee — the only .rs left in the ring's src is lib, the crate root, which is not a guard target. Refs #8883.

This was referenced Oct 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant