Repository navigation
feat(clara-gap4): restraint_ctrl hard-wired (DARPA TA1.4 bounded rationality) - #60
Merged
Merged
Conversation
CLARA Gap-4 restraint controller. Forces K_UNKNOWN when: - phi_drift > 164 (0.5% in Q1.15, threshold from CROWN47 §3.4) - step_count > 10 (CLARA bounded rationality MAX_STEPS=10) - receipt_ok == 0 (receipt/packet integrity failure) Sticky until rst_n. reason[2:0] one-hot encodes which condition tripped. R-SI-1 clean (only is sensitivity list ). ~91 lines pure Verilog-2005. t27 spec: gHashTag/t27/specs/ar/restraint.t27 DARPA CLARA TA1.4 bounded rationality. DOI: 10.5281/zenodo.19227877
Scenario 1: happy path (no trigger) Scenario 2: phi_drift trigger (165 > 164) Scenario 3: step_count overflow (11 > 10) Scenario 4: receipt failure (receipt_ok=0) All scenarios check force_unknown, halt_mac, reason bits, and sticky. R-SI-1 clean. Verilog-2005. iverilog 9/9 PASS.
Instantiate restraint_ctrl (CLARA Gap-4) in top module: - phi_drift <- phi_dist from phi_distance_oracle (already in GAMMA) - step_count <- fsm_step_count (counts host_in_valid && host_in_ready pulses) - receipt_ok <- mesh_rcpt_valid | rcpt_valid_d from crc32_receipt path - force_unknown -> uio[4] (debug observability, does not gate MAC yet) halt_mac and reason[2:0] routed to _unused for first safe integration. R-SI-1 clean. Verilog-2005. DOI: 10.5281/zenodo.19227877
…4] pinout - Add restraint_ctrl.v to source_files list - Update uio[4] pinout description: CLARA Gap-4 debug bit Gap-4 CLARA restraint controller (force K_UNKNOWN on drift/overflow/receipt)
- Fix sim/tb_canonical.v: Split 'reg stable = 1' into declaration + assignment - Fix src/bitnet_encoder.v: - Replace indexed part-select x[2*i +: 2] with shift/mask approach - Remove size casts (10'(), 16'sd1) - Replace indexed part-select y_out[8*j +: 8] with case statement - Add newline at end of file Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix src/gf16_popcount.v: Replace a_row[2*k +: 2] with shift/mask - Fix src/gf16_popcount16.v: Replace a_row[2*k +: 2] with shift/mask - Fix src/blake3_anchor.v: Replace m_in[32*i +: 32] with shift/mask - Fix src/vsa_matmul_8x8.v: Replace indexed part-select with intermediate wires and case statement - Fix src/vsa_matmul_16x16.v: Replace indexed part-select with intermediate wires and case statement Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts: # info.yaml # src/tt_um_trinity_max_true.v
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLARA Gap-4 — restraint_ctrl hard-wired (DARPA TA1.4 bounded rationality)
Overview
Implements CLARA Gap-4 from
CROWN47_DARPA_DRONE_ANALYSIS.md §3.4:t27 spec:
gHashTag/t27/specs/ar/restraint.t27(RestraintType::UNKNOWN_TO_FALSE, threshold 0.5)Files Changed
src/restraint_ctrl.vtest/restraint_ctrl_tb.vsrc/tt_um_trinity_max_true.vu_restraint, wirephi_dist,fsm_step_count,restraint_rcpt_ok;force_unknown → uio[4]info.yamlrestraint_ctrl.vto source_files; updateuio[4]pinoutModule: restraint_ctrl
Threshold math: 0.5% × 2^15 = 163.84 →
16'd164(ceiling).Sticky: once tripped, stays high until
rst_nde-asserted.Testbench Results (iverilog, Verilog-2005)
9/9 assertions PASS.
DARPA CLARA TA1.4 Compliance
This module closes CROWN47 §3.4 Gap 4:
restraint_preserves_truerestraint_transforms_unknownbounded_rationality MAX_STEPS=10receipt_integrityIntegration Strategy (first PR — observability only)
force_unknown→uio[4]for debug observability (readable by external logic analyzer)halt_macsilenced to_unused— not yet gating MAC clock (too risky for first integration)R-SI-1 Verification
restraint_ctrl.v: zero arithmetic*operators (onlyalways @(*)sensitivity list — compliant)tt_um_trinity_max_true.v: no new*addedCell Budget Estimate
~100 cells: 3 comparators (16-bit, 4-bit, 1-bit) + 3 sticky FFs + 1 step counter FF + combinational OR = ~8 FFs + ~92 logic cells. GAMMA 5×4 current utilization ~60% → ~0.2% additional.
Anchor
φ² + φ⁻² = 3 · DOI 10.5281/zenodo.19227877
DO NOT MERGE until CI (gds + precheck + gl_test + viewer) all green.