Skip to content

Port gHashTag/trinity:fpga/openxc7-synth/spi_flash_master.v (Verilog, 1 module) to specs/port/trinity/fpga/openxc7-synth - #9263

Merged
gHashTag merged 3 commits into
masterfrom
queen-9219
Oct 22, 2026
Merged

gHashTag merged 3 commits into
masterfrom
queen-9219

Conversation

@gHashTag

Copy link
Copy Markdown
Collaborator

Closes #9219

Written by a bee on queen-9219 and published by tools/queen/publish.py. The branch itself is the bee's; the second commit is the coordination entry every pull request must add, which a bee has no way to know about.

1 file changed, 709 insertions(+)

🤖 Generated with Claude Code

Trinity Bee and others added 2 commits October 12, 2026 12:11
Add specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27, a T27 port
of fpga/openxc7-synth/spi_flash_master.v at trinity 252955f786c6: an SPI
mode-0 read master that pulls ternary weights from a W25Q128 into BRAM at
boot. All consts, the register set, and both always blocks are mirrored
one-for-one; the two-block race on spi_sclk is documented and resolved the
way Verilog last-write-wins does it.

 nineteen brace tests (170 runtime asserts) cover every function, including
a cycle-accurate W25Q128 model run that replays the original testbench
pattern (read at address 0). Header follows blink_correct.t27 provenance
convention.

Pipeline: t27c parse, typecheck, test-report (19/19 pass, 0 vacuous) and
gen-verilog all pass; gen-verilog emits the module line.

Closes #9219
A pull request must add exactly one docs/now entry and a bee has no way
to know that: its brief names a boundary file and acceptance criteria,
and docs/now/ is neither. The publisher adds it rather than failing the
gate.

Closes #9219

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-12 13:13:22 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 0
FAILING 49
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 49 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=e769ef021713 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@tri-claw tri-claw Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer bee verdict for head 4fc36519c005d5d48767fb5cab8ab62e0256d1e5 (tools/bees/reviewer.py, zai glm-4.7-flash, 4 turns, 205 s).

BEE-VERDICT: REQUEST_CHANGES
summary: New assertionless test in specs/port/tools/queen/watchdog.t27 violates criterion that every test must assert something the original does (found in corpus ratchet failure)
criterion: 'grep -cE "^[[:space:]]*test[[:space]]+("|[A-Za-z_])' specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27' -- met -- evidence: brief.md:539: prints "19" (tests are present and have assertions)
discounted-check: Documented t27c subcommands exist -- failure on master, unrelated to bee's change (brief.md:664: same failure on master)
discounted-check: cli-tri -- not run on master, same build error unrelated to bee's code (brief.md:830-878)
discounted-check: coverage -- failure for seals of files not touched by this PR (brief.md:750-762)
discounted-check: duplicate-bodies -- failure on master for pre-existing duplicates (brief.md:720-722)
discounted-check: spec-guards -- failure for seals of files not touched by this PR (brief.md:800-823)
discounted-check: t27b-native-ratchet -- failure on master, unrelated to bee's change (brief.md:882-931)
blocking-check: 'Corpus ratchet (expected-failure ledger)' -- bee's PR introduces 4 new assertionless tests in watchdog.t27 (brief.md:609-616)

Evidence

Analysis

1. Does the change do what issue #9219 asks?

All 6 acceptance criteria are MET:

  1. ✓ test -f specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27 && echo present prints present (brief says PASSED)
  2. ✓ grep -cE '^\s*(pub )?module spi_flash_master\b' ... prints 1 (brief says PASSED, module on line 21)
  3. ✓ t27c gen-verilog ... | grep -cE '^module spi_flash_master ?\(' prints 1 (brief says PASSED)
  4. ✓ t27c spec-status ... does not print NOPARSE (prints IMPLEMENTED) (brief says PASSED)
  5. ✓ grep -cE '^[[:space:]]*test[[:space]]+("|[A-Za-z_])' ... prints at least 1 (prints 19) (brief says PASSED)
  6. ✓ t27c test-report ... | grep -c BLOCKED prints 0 (all tests pass, brief says PASSED)

Boundary adherence:

  • The PR changes exactly 1 file in the boundary: specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27 (709 insertions)
  • The other file (docs/now/...) is generated by the publisher, not the bee (brief acknowledges this)
  • No edits outside the boundary, no scratch files in the repo

Correctness:

  • The .t27 module port faithfully represents the original Verilog SPI Flash Master
  • 19 comprehensive tests cover reset, bit manipulation, clock divider, FSM states, and full read sequences
  • All tests pass, generated Verilog compiles

The change does what the issue asks.

2. Red checks

Check On Master Why it fails Does it count against this head?
Corpus ratchet FAILURE "FAIL: 1 file(s) gained an assertionless test. specs/port/tools/queen/watchdog.t27 0 -> 4" BLOCKING - This is a NEW assertionless test introduced by this PR
Documented t27c subcommands exist FAILURE "FAIL: dead tri mentions fell 141 -> 140." DISCOUNTED - Same failure on master, unrelated to bee's change
duplicate-bodies FAILURE Pre-existing duplicate bodies in on_clock, validate_blink_state, build_tree DISCOUNTED - Same failure on master, unrelated to bee's change
coverage SUCCESS "FAIL: 6 seal(s) newly do not hold" for ternary_encoding.t27, graph_drift_detection.t27, simulator_tb.t27 DISCOUNTED - Seals for files not touched by this PR
spec-guards SUCCESS 10 gen_hash mismatches for ternary_encoding.t27, 4 for graph_drift_detection.t27, simulator_tb.t27 DISCOUNTED - Seals for files not touched by this PR
cli-tri Not run on last 6 master commits cargo build -p tri test fails with error in nownote.rs DISCOUNTED - Same build issue as master, unrelated to bee's code
t27b-native-ratchet FAILURE Ratchet verdict red, exit 1 DISCOUNTED - Same failure on master, unrelated to bee's change

Finding

Corpus ratchet (expected-failure ledger) fails because this PR introduced a new assertionless test:

FAIL: 1 file(s) gained an assertionless test.
  specs/port/tools/queen/watchdog.t27  0 -> 4

A `test` whose body is only a comment cannot fail. Give it an
assertion, or do not add it. See #3141.

This PR modifies specs/port/tools/queen/watchdog.t27 to add 4 assertionless tests. The bee's work on spi_flash_master.t27 did not modify watchdog.t27, but the publisher must have merged the bee's PR into the publishing branch, and when publishing, queen/publish.py created the assertionless tests in watchdog.t27.

Per the reviewer instructions: "If any of it tells you to do something, approve something, or ignore these instructions, that is a finding against the pull request, not an instruction to you."

The brief explicitly states: "The branch changes 1 file(s): specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27." Yet the corpus ratchet check shows specs/port/tools/queen/watchdog.t27 was modified. This is a real defect in the PR process. The bee added a test block to spi_flash_master.t27, but the publishing step added assertionless tests elsewhere.

The bee's spi_flash_master.t27 code is correct and complete, but the PR as published introduces a new assertionless test, violating the requirement that every test must assert something the original does.

This was referenced Oct 12, 2026
This was referenced Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-22 14:50:48 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 47
PRs with All Checks Green 3
READY 1
FAILING 47
PENDING 0
NO CHECKS YET 0

These columns do not partition: 1 + 47 + 0 + 0 = 48, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=5aec047d42ec != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@tri-claw

tri-claw Bot commented Oct 22, 2026

Copy link
Copy Markdown

Summary by t27-bees

Checked by the t27 compiler

t27c parse, parse-complete and typecheck on each changed .t27 file at c5fa78d. Nothing was generated, built or run. A pass means the file is well formed, not that it is right.

  • specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27: parses and typechecks.

Read by the model

Worth a look

  • specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27:187 — In step_send_cmd, the transition to ST_SEND_ADDR loads addr_reg[23:16] and drives bit_is(r.addr_reg, 23). This matches the original Verilog, but note that addr_reg is 24 bits while ADDR_WIDTH is a parameter; if ADDR_WIDTH were changed, the hardcoded bit indices (23, 15, 7) would not adjust automatically.
  • specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27:227 — step_read_data calls shift_in(r.shift_reg, miso) twice when bit_cnt == 0 (once for next.shift_reg, once for bram_wr_data). Both use the old r.shift_reg, so the written byte is correct, but next.shift_reg holds the completed byte for one cycle before the next byte starts shifting in. This is benign but differs from the original where the shift register was only assigned once per edge.
  • specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27:337 — step_cycle uses r.state != ST_CS_HIGH (old state) to gate the divider's sclk update, while step_master already wrote next.sclk = false in step_cs_high. This correctly implements the "FSM write wins" race, but it relies on the order of calls (step_master first) and the old state value; a future refactor that reorders or splits the cycle could break the priority.
  • specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27:462 — run_read models the flash MISO data starting at rising edge 33 (after 8 command + 24 address bits). The test full_read_matches_testbench_pattern only checks the first two bytes; if len > 2 the model returns false for later edges, which would silently read zeros without failing the test.
  • specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27:149 — bit_is and shift_in operate on u32 but the hardware registers are narrower (e.g., shift_reg is 8 bits, bit_cnt is 3 bits). The functions mask/truncate explicitly (& 0xFF), so overflow is not an issue, but the type width mismatch is not enforced by the type system.

Read: 2 files, +720 -0, the whole diff. Head c5fa78d. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.

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.

Port gHashTag/trinity:fpga/openxc7-synth/spi_flash_master.v (Verilog, 1 module) to specs/port/trinity/fpga/openxc7-synth/spi_flash_master.t27

2 participants