Skip to content

Port gHashTag/trinity:src/brain/angular_gyrus.zig (Zig, 4 functions) to specs/port/trinity/src/brain/angular_gyrus.t27 - #8735

Merged
gHashTag merged 2 commits into
masterfrom
queen-8727
Oct 12, 2026
Merged

gHashTag merged 2 commits into
masterfrom
queen-8727

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Closes #8727

Written by a bee on queen-8727 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, 106 insertions(+)

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-10 18:16:59 UTC

Summary

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=465abf513dc2 != 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 6a10895faa2b65d0961775ac50dea5cf717a2ac1 (tools/bees/reviewer.py, zai glm-4.7-flash, 6 turns, 84 s).

BEE-VERDICT: REQUEST_CHANGES
summary: The change correctly ports all 4 functions and meets all 6 acceptance criteria, but introduces a CLI census movement (fetches: 48→49) that wasn't documented in the PR body, violating the "no census moved without saying so" rule.
criterion: "Create this one file and nothing else" -- met -- specs/port/trinity/src/brain/angular_gyrus.t27:1-106 (the bee's work); docs/now/2026-10-10-published-port-ghashtag-trinity-src-brain-angular-gyrus-zig-zig-4-func.md:1-11 (added by publisher, not the bee)
blocking-check: "cli-tri" -- FAILURE is caused by this PR; the log shows FAIL: fetches moved: was: files read 48 now: files read 49 and the brief states "No census moved without saying so"

Evidence

Now I have all the information I need to make my decision.

Analysis

1. Does the change meet the issue's acceptance criteria?

Yes, all 6 acceptance criteria are met according to the runner's facts:

  • Criterion 1: test -f specs/port/trinity/src/brain/angular_gyrus.t27 && echo present prints present -- PASSED
  • Criterion 2: grep -cE '^\s*(pub )?fn (phiDistance|goldenPct|formatTable|autoSelectFormat)\(' specs/port/trinity/src/brain/angular_gyrus.t27 prints 4 -- PASSED
  • Criterion 3: t27c gen specs/port/trinity/src/brain/angular_gyrus.t27 | wc -l prints at least 13 (89 lines) -- PASSED
  • Criterion 4: t27c spec-status specs/port/trinity/src/brain/angular_gyrus.t27 does not print NOPARSE (prints IMPLEMENTED) -- PASSED
  • Criterion 5: grep -cE '^[[:space:]]*test[[:space:]]+("|[A-Za-z_])' specs/port/trinity/src/brain/angular_gyrus.t27 prints at least 4 (prints 5) -- PASSED
  • Criterion 6: t27c test-report specs/port/trinity/src/brain/angular_gyrus.t27 2>&1 | grep -c BLOCKED prints 0 -- PASSED

The change implements all 4 required functions from the original Zig code:

  • phiDistance (lines 49-56)
  • goldenPct (lines 58-61)
  • formatTable (lines 63-65, body is undefined; as required)
  • autoSelectFormat (lines 67-72)

The 5 tests cover the original's test cases:

  • test phi_distance_GF16 (lines 74-78)
  • test phi_distance_GF16_is_closest (lines 80-86)
  • test golden_pct_GF16 (lines 88-91)
  • test auto_select_format (lines 93-96)
  • test trinity_identity (lines 99-106)

All requirements (FR-001 through FR-004) are satisfied.

2. Do the red checks count against this head?

5 red checks, but only 1 needs to be discounted:

The brief shows 5 red checks:

  1. Corpus ratchet (expected-failure ledger) -- RED on master, FAILURE is unrelated to this PR

    • The failure lists other specs that are failing (a/b_c.t27, a_b/c.t27, compiler/optimizer.t27, memory/graph/ingest.t27, port/trinity/src/tri/orchestrator_bench.t27)
    • None of these are angular_gyrus.t27
    • This is a pre-existing issue with the corpus, not caused by this PR
  2. duplicate-bodies -- RED on master, FAILURE is unrelated to this PR

    • The failure is about duplicate bodies across the entire codebase
    • No indication this PR introduced new duplicates
  3. emit-bitexact -- NOT RED on master (not run on last 6 commits), FAILURE is unrelated to this PR

    • Master's last 6 commits don't run this check
    • The failure is about specs/memory/graph/ingest.t27 not generating
    • This is not caused by this PR
  4. cli-tri -- RED on master, FAILURE is caused by this PR

    • Log shows: FAIL: fetches moved: was: files read 48 now: files read 49
    • This is a census movement, and the PR did not mention this in the body
    • The brief says: "No census moved without saying so"
    • This counts against the head
  5. t27b-native-ratchet -- RED on master, FAILURE is unrelated to this PR

    • The failure is about the ratchet verdict
    • No indication this PR introduced a new ratchet failure

Summary

The change successfully ports the angular_gyrus.zig functions to angular_gyrus.t27, meets all acceptance criteria, and generates working code. However, it introduced a CLI census movement that wasn't documented in the PR body.

This was referenced Oct 10, 2026
This was referenced Oct 12, 2026
Trinity Bee and others added 2 commits October 12, 2026 17:12
…ty/src/brain/angular_gyrus.t27

- Port 4 functions: phiDistance, goldenPct, formatTable, autoSelectFormat
- Add 5 test blocks covering all functions and edge cases
- FormatTable uses undefined; body as it only moves data
- Generated code compiles and all tests pass

Closes #8727
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 #8727

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-12 10:17:11 UTC

Summary

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

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 f24ba8dbb2d0e9e15528a2e3a5e515bd89b7ade4 (tools/bees/reviewer.py, zai glm-4.5-flash, 4 turns, 218 s; then glm-4.7-flash, 6 turns, 321 s).

BEE-VERDICT: APPROVE
summary: Successfully ported 4 functions from gHashTag/trinity:src/brain/angular_gyrus.zig to specs/port/trinity/src/brain/angular_gyrus.t27 with all acceptance criteria met
criterion: file existence and "present" output -- met -- specs/port/trinity/src/brain/angular_gyrus.t27:1
criterion: exactly 4 functions with correct names -- met -- grep count returned 4
criterion: generated code has no "not yet implemented" and sufficient lines -- met -- 0 markers found, 89 lines generated
criterion: file parses successfully -- met -- spec-status returned IMPLEMENTED
criterion: at least 4 tests present -- met -- 5 tests found
criterion: no BLOCKED tests -- met -- test-report returned 0 BLOCKED
discounted-check: Corpus ratchet (expected-failure ledger) -- does not count against this head; failure is in unrelated file specs/port/trinity/src/tri/gen_lru_cache_impl.t27
discounted-check: Documented t27c subcommands exist -- does not count against this head; change in dead tri mentions count is unrelated to this port
discounted-check: cli-tri -- does not count against this head; build failures are in cli/tri code unrelated to this port
discounted-check: t27b-native-linux -- does not count against this head; build errors are in t27b library code unrelated to this port
discounted-check: t27b-native-macos -- does not count against this head; build errors are in t27b library code unrelated to this port
discounted-check: t27b-native-ratchet -- does not count against this head; build errors are in t27b library code unrelated to this port

Evidence

Based on my analysis of the pull request and the ported file, here's my review:

Evidence Analysis

Acceptance Criteria Verification (All Met)

  1. File existence: ✓ The file specs/port/trinity/src/brain/angular_gyrus.t27 exists and prints "present"

  2. Functions ported: ✓ All 4 required functions are present:

    • pub fn phiDistance(exp_bits: u8, mant_bits: u8) f64
    • pub fn goldenPct(exp_bits: u8, mant_bits: u8) f64
    • pub fn formatTable(writer: anytype) void (with undefined; body as required)
    • pub fn autoSelectFormat(layer_idx: usize, total_layers: usize) FormatInfo
  3. Generated code quality: ✓ Generated Zig has:

    • 0 "not yet implemented" markers
    • 89 lines (exceeds the 12-line minimum)
  4. File parses: ✓ t27c spec-status returns "IMPLEMENTED" (not NOPARSE)

  5. Tests present: ✓ 5 tests found, exceeding the minimum of 4:

    • phi_distance_GF16
    • phi_distance_GF16_is_closest
    • golden_pct_GF16
    • auto_select_format
    • trinity_identity
  6. No BLOCKED tests: ✓ t27c test-report shows 0 BLOCKED tests

Red Check Analysis

All 6 red checks are unrelated to this PR:

  • Corpus ratchet: Failure due to unrelated file specs/port/trinity/src/tri/gen_lru_cache_impl.t27
  • Documented t27c subcommands exist: Dead tri mentions count change
  • cli-tri: Build warnings/errors in CLI code
  • t27b-native-*: Build errors in T27B library (same error on all platforms)

These failures existed on master before this PR and are not caused by the porting work.

Code Quality Assessment

The port correctly:

  • Preserves all mathematical constants (PHI, PHI_INV, etc.)
  • Implements phiDistance correctly using absolute value logic
  • Implements goldenPct with proper percentage calculation
  • Handles formatTable correctly with undefined; body (as required for functions with external dependencies)
  • Implements autoSelectFormat with the same conditional logic as original
  • Includes comprehensive tests covering edge cases and assertions
  • Uses proper T27 syntax and language constructs

The port meets all requirements from issue #8727, staying within the specified boundary and only modifying the required file.

Second, independent review (glm-4.7-flash): APPROVE -- All 6 acceptance criteria are met, generated code compiles cleanly with 0 "not yet implemented" errors, and no blocking defects introduced

@tri-claw tri-claw Bot added the bee-reviewed A reviewer bee reviewed and verified this PR at its current head; the only merge signal (#5525) label Oct 12, 2026
@gHashTag
gHashTag enabled auto-merge (squash) October 12, 2026 11:47
@gHashTag
gHashTag merged commit 760b189 into master Oct 12, 2026
27 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bee-reviewed A reviewer bee reviewed and verified this PR at its current head; the only merge signal (#5525)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port gHashTag/trinity:src/brain/angular_gyrus.zig (Zig, 4 functions) to specs/port/trinity/src/brain/angular_gyrus.t27

2 participants