Skip to content

gpu-gates: reject incomplete references after worker panics - #364

Merged
juliankang4 merged 2 commits into
midagedev:mainfrom
Burntgogi:fix/gemm-reference-panic
Oct 16, 2026
Merged

juliankang4 merged 2 commits into
midagedev:mainfrom
Burntgogi:fix/gemm-reference-panic

Conversation

@Burntgogi

@Burntgogi Burntgogi commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Fixes #346. A reference worker panic was converted into a fabricated Checked with zero checked/band/bits counts and host_bad=1. Several consumers ignored host_bad and could report PASS; checking only checked>0 would still miss partial-reference failure.

Change

  • par_slots joins every worker and returns a GateError on any panic, including initializer failure; no intermediate result buffer is added.
  • check and gemv_cmp propagate that error instead of inventing a partial success record. All dense/routed/IQ4_NL/remap/packed-Q5_0 consumers use ?.
  • Existing check_ref already propagated panics and stays unchanged.
  • Three meaningful reference regressions are run by gate-gpu-gemm before the device gate. They exercise real reference functions, partial/all/initializer panic and the actual exit_with failure result, plus numeric/untouched controls.
  • No kernel, rounding formula, band, count pin or lint level changed.

Exercised verification

  • Metadata-only cargo check --target x86_64-unknown-linux-gnu ... --features gpu --bin gate_gemm --tests passes. This is NOT PTX/device execution.
  • Separate host executable using the exact source bodies of par_slots, check, row_dot and row_checked, and the actual host quantizer/dot library and exit_with: clean reference checks 6 outputs and exits 0; panic after partial work exits 1; all-work panic exits 1, both with the named reference error. No substitute reference implementation or GPU output is used.
  • Format check passes.

In-flight #344 compatibility

Prepared Burntgogi/bloomery:support/gemm346-on344 at 7eaf697, based on exact #344 head 0097d4977138f1797dda20727e806a088ef1ab39. It preserves the generic dot closure and NVFP4 arithmetic, propagates errors at both additional NVFP4 consumers, and adapts the regression call. That combined source and its tests pass metadata-only checking too. This PR itself does not bundle #344's kernels.

NVIDIA acceptance still required

This workstation has RX7900GRE only and no configured GPU SSH hosts. The actual default destination in tools/box.sh is ws; a BatchMode SSH probe failed with hostname resolution error (exit 255). The actual NVIDIA gate and device-consumer panic mutants were not run. Maintainer lane: just gate-gpu-gemm through the configured box, or BLOOMERY_BOX_LOCAL=1 just gate-gpu-gemm on a correctly configured NVIDIA contributor host, then all-/partial-reference panic mutants against the individual dense, routed, IQ4_NL, remap and packed-Q5_0 cases. I am requesting that lane rather than equating host/static checks with CUDA acceptance.

Return GateError from every 32-value reference aggregation instead of fabricating numeric counters; propagate it through dense, routed, IQ4_NL, remap and packed-Q5_0 consumers. Keep check_ref's existing hard error and cover it alongside the slot reducers.

Add real host-reference regressions for completed work followed by panic, all-work and initializer panics, unchanged band/bits/host-slot controls, and the final failing ExitCode. Run these from gate-gpu-gemm before the device gate.

Verification intentionally unrun in this worker: parent owns static, host-reference, NVIDIA and panic-mutant evidence. No numeric bands or kernels changed.
@github-actions github-actions Bot added documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Oct 16, 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: Worker panics now propagate through every affected consumer to the gate's failing exit.

Non-blocking

⚠ FAIL-first evidence: justfile:1234. The PR reports an extracted host executable, but no FAIL-first output from the actual regression target. Run the filtered tests with Err(_) => panicked = false, then restore the code and attach both outputs. This establishes that the committed tests catch discarded worker failures.

⚠ Failure context: crates/gpu-gates/src/bin/gate_gemm.rs:2987. Every worker panic caught here returns reference thread panicked. The callers propagate it before printing the current case, layout or shape. Retain those inputs through the existing diagnostic path, or identify a retained probe that reports them. Adding that context while these callers change makes later failures easier to reproduce.

Checked

Duplicates: 4 new functions checked against existing reference and failure helpers; no duplicate owner found. No dryer pairs were supplied.

Complexity: remap_case 76→77, dense_case 45→46, iq4nl_case 40→41, q5_0p_case 40→41, routed_case 24→25. Each increase is error propagation with ?.

Silent failure: 3 worker-result sites followed; both fabricated-result fallbacks are removed, and all 5 consumers propagate the error to exit_with.

Tests: static mutation check only. Ignoring the panic at line 2983 would fail both new 32-value tests' error assertions. Returning an empty success at line 714 would fail the K-quant test's error assertions. Making exit_with return success on errors would fail the shared assertion. Tests were not executed during this review.

Adversarial checks: partial work, all-work and initializer panics return errors; successful joins cannot mask a later panic. Zero slots retain the explicit empty-result contract. The recipe filter matches all 3 tests and preserves failure status.

Gates: no bands, thresholds, count pins or existing cases changed. Hot path: none; the changes affect gate reference work.

Escape catalog: C1–C4 do not match the added command or documentation.

Notes

Dryer did not run; diagnostics incorrectly reports no changed Rust file under crates/.

NVIDIA acceptance and device-consumer panic mutants remain unrun, as the PR states. No qualifying GPU evidence was supplied.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_gemm.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)

@Burntgogi

Copy link
Copy Markdown
Contributor Author

Immutable evidence and applicable panic mutants are now published:
https://github.com/Burntgogi/bloomery/tree/ce8398216da51ae2d1e0b2c42ddb8dfda76c7460/docs/contrib/evidence/native-roadmap-20261015/refresh-20261016/gemm-346

Additional executed host boundary: the actual #344 generic check / worker owner plus its dot32_nv host transcription gives clean exit 0, partial-work panic exit 1, all-work panic exit 1. This proves error propagation on that host boundary, not NVIDIA arithmetic/device acceptance. The exact #344 integration remains support/gemm346-on344 at 7eaf697 and passed a fresh isolated-target metadata check.

For real device-consumer mutant verification:

  • Main fix f11aaee: place only all-reference-panic.patch and partial-reference-panic.patch in the mutant directory; cases g32_dense, g32_routed, g38_iq4nl, g32_remap, q5_0p_is_the_gemv.
  • gpu: gemm_nvfp4p — the NVFP4 planes in the 32-value GEMM #344 integration 7eaf697: place only generic-all-reference-panic.patch and generic-partial-reference-panic.patch in a separate mutant directory; cases g32_nvfp4_dense, g32_nvfp4_routed. The main row_dot mutations do not reach the independent NVFP4 dot callback.
  • Both patch pairs passed git apply --check on their stated source. Device execution is still not run here.
  • Use tools/mutant-run.sh around oxide build plus the compiled binary through tools/gpu-gate.sh gate_gemm --case CASE; require nonzero and ^gate_gemm: reference thread panicked$ for both mutants and success after restoration. Do not run the updated whole recipe as the mutant command: its new unit tests can consume the injection before a device consumer runs.

Normal owner gate remains just gate-gpu-gemm. No bands, count pins or lint levels were changed.

@juliankang4
juliankang4 merged commit 4a7c056 into midagedev:main Oct 16, 2026
7 checks passed
@juliankang4

Copy link
Copy Markdown
Collaborator

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

@Burntgogi

Burntgogi commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Source f11aaeea0fdd634d0e735f9cc9f684e70304e0f8 is now merged as 4a7c056a7d7d6acce9435931aa1d9c0b028ec5e7.

Host execution over the actual reference owners still distinguishes clean/partial/all-worker paths with exits 0/1/1. The #344 generic/NVFP4 host boundary independently gives 0/1/1. These are host error-propagation proofs, not CUDA arithmetic or native gate execution.

Additional requested actual-test negative control is retained at:
https://github.com/Burntgogi/bloomery/blob/8d1b286236e566d2938540d4acde81c964d9f2ab/docs/contrib/evidence/native-roadmap-20261015/refresh-20261016/gemm-346/ignored-worker-panic-reference-tests.patch
It changes only Err(_) => panicked = true to false and passed git apply --check on the stated source. Actual filtered CUDA regression FAIL-first/restored runs remain unrun, alongside the already-supplied device-consumer mutant pairs. Please use the A6000 lane; no local NVIDIA or reachable configured GPU SSH host is available.

The retained consumer handoff pins source head, the explicit --case selector and each applicable mutation; capture that invocation with its output to retain the reproducible input context. The generic panic message itself is unchanged; no extra telemetry or numeric-band changes are mixed into this fix.

Full immutable evidence, including both host probes and the four consumer patches:
https://github.com/Burntgogi/bloomery/tree/8d1b286236e566d2938540d4acde81c964d9f2ab/docs/contrib/evidence/native-roadmap-20261015/refresh-20261016

Exact registered test command for that fail-first/restored run: bash tools/gate.sh --oxide --release -p bloomery-gpu-gates --features gpu --bin gate_gemm -- workers_must_complete. The local native-build prerequisite probe additionally exits 101 with error: no such command: oxide; the actual native CUDA test target is not replaced by plain cargo or a fake driver here.

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

Labels

documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gpu-gates: GEMM reference worker panics can still pass the gate

2 participants