Skip to content

gpu-gates: reuse shared rounding bounds in chain FFN gate - #276

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
Burntgogi:fix/chain-ffn-rounding-owner
Oct 15, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
Burntgogi:fix/chain-ffn-rounding-owner

Conversation

@Burntgogi

Copy link
Copy Markdown
Contributor

What and why

Closes #239. Import bloomery_gpu_gates::rounding::{U, gamma} in the chain FFN gate and remove its two duplicate definitions, following the existing chain-glue convention.

Release notes: Under the hood — chain FFN error bounds use the existing shared rounding owner; numerical bands and arithmetic are unchanged.

Code shape

  • No second copy. Use the existing shared owner and the existing chain-glue import convention.
  • Model code holds only architecture facts. No model code changes.
  • Dead code is gone. Remove both local definitions; no forwarding wrapper.
  • No silent failure. Arithmetic and its singular boundary are unchanged.
  • Comments state what is true now.
  • No relaxed gate. No kernel, launch, band, tolerance or lint change.
  • cargo fmt and cargo clippy clean: formatting and actual-target type-check pass; strict integrated lint is blocked as described below.

Duplication removed: gate-local U and gamma in gate_deepseek41_chain_ffn.rs; the owner is crates/gpu-gates/src/rounding.rs.

What I ran

Base 22c65407; independent fix branch.

A standalone executable calls the production shared rounding module and compares it bit-for-bit with the removed expression: U and 100,005 gamma counts match, including zero, model widths, the singular boundary and usize::MAX. This is arithmetic equivalence, not a timing claim. No permanent forwarding/copy test was added.

The actual feature-enabled target passes static checking:

cargo check --locked --offline --target x86_64-unknown-linux-gnu -p bloomery-gpu-gates --features deepseek41 --bin gate_deepseek41_chain_ffn

Formatting passed. This is metadata/type-check evidence with CUDA headers; no device executable was linked with plain cargo. NVIDIA execution of the owning gate and PTX identity were not run here and remain maintainer evidence before landing.

Strict integrated host lint (changed host library packages, --no-default-features --lib -- -D warnings) exits 101 on unchanged refset/src/nemotron.rs:213 (chunks_exact_to_as_chunks) and model/src/ops.rs:5546 (collapsible_if). It does not complete the gate target's lint. No allowances or unrelated fixes were added.

bash tools/affected-gates.sh origin/main..fix/chain-ffn-rounding-owner --no-box selects only gate-gpu-ds41-chain-ffn plus always-static checks, with no weekly trigger and no unmapped path.

Integrated host verification

On combined validation commit 573d1e3a (all five independent fixes and their fixture corrections), LC_ALL=C bash tools/contrib-check.sh --tier t0 exits 0:

DONE tier=t0 total=83 red=0 wall=306s

Includes whole-tree formatting, all T0 host packages/tool self-tests, check-arch, check-comments, check-emb2, check-recipes and check-records. This is one combined run, not five independent full T0 runs. It does not establish CUDA execution or a clean strict Clippy run.

Fixes midagedev#239. Import rounding::{U, gamma} and delete the gate's duplicate definitions. A standalone smoke matched the removed arithmetic bit-for-bit over 100005 counts; the actual feature-enabled gate type-checks. No gate band changes.
@github-actions github-actions Bot added gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card labels Oct 15, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: CLEAN: The shared definitions preserve the gate's arithmetic and checks.

Non-blocking

⚠ Missing move evidence: crates/gpu-gates/src/bin/gate_deepseek41_chain_ffn.rs:127. The PR reports no PTX identity scan or owning GPU gate run.
Attach matching base/head no-JIT just ptx-scan tables and just gate-gpu-ds41-chain-ffn output with the card evidence required by CONTRIBUTING.md. Capture this evidence before landing to verify the feature-enabled device program.

Checked

Duplicates: 0 new definitions; both imported items reuse the existing rounding owner. No dryer pairs were available.
Complexity: crapper flagged no functions; no branching was added.
Silent failure: 0 new fallback sites; rounding bounds still reach the existing waiver and failure checks.
Tests: none added or changed; mutation review is not applicable. Source comparison verified identical gamma bodies and unchanged consumers; no build or GPU execution was performed.
Gates: no bands, clauses, cases or pins changed. Both U definitions are exactly 2^-24; zero, the singular boundary and large counts retain the same arithmetic.
Escape catalog: C1–C4 do not match. The shared module is public and unconditional; the bin retains its required feature.

Notes

Dryer did not run, as reported by diagnostics.md.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_deepseek41_chain_ffn.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

Filed outside this PR: #279

@juliankang4

Copy link
Copy Markdown
Collaborator

@Burntgogi Thanks for the contribution. The review is done, so I'm merging this.

@juliankang4
juliankang4 merged commit 9955886 into midagedev:main Oct 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gpu-gates: chain FFN gate duplicates the shared rounding model

2 participants