test(apr-cpu-vs-gpu-output-parity-v1): add WGPU_FALLBACK_LOG_PREFIX + drift-prevention tests#1435
Merged
Merged
Conversation
… drift-prevention tests Closes the contract drift between v1.2.0's prediction and the actual code: contract `apr-cpu-vs-gpu-output-parity-v1` v1.2.0 (PR #1430) said the wgpu rejection log should emit `[apr-cpu-vs-gpu-output-parity-v1] wgpu path rejected, attempting fallback: ...` symmetric to the CUDA tag, but #1430 only made the existing `[GH-559]`/`Backend:` logs unconditional — the contract-tagged wgpu rejection log itself was missing. Mirror of the FALSIFY-CPU-GPU-003 chain (#1428 visibility + #1429 drift test) for FALSIFY-CPU-GPU-005: - Adds `pub(crate) const WGPU_FALLBACK_LOG_PREFIX = "[apr-cpu-vs-gpu-output-parity-v1] wgpu path rejected"` - Updates `try_apr_wgpu_inference` to emit it on `GpuDevice::new()` failure (alongside the existing `[GH-559]` runbook tag — both, not either) - 3 new unit tests: * `wgpu_fallback_log_prefix_is_contract_tagged` (symmetric to the CUDA test) * `cuda_and_wgpu_fallback_log_prefixes_share_contract_tag` (symmetry guard: both prefixes must start with the same contract ID and end with "path rejected" so grep recipes work uniformly across backends) Five Whys: 1. Why was this gap in v1.2.0? PR #1430 conflated "make existing wgpu log visible" (done) with "add contract-tagged rejection log" (deferred). The contract's prediction text wrote the second; the code shipped only the first. 2. Why catch it now? `--features hub` build healthy across PRs #1432-#1434 means the test surface is reliable; this is the natural follow-up. 3. Why the symmetry test? `cuda_and_wgpu_fallback_log_prefixes_share_contract_tag` locks in that BOTH backends use the same `[CONTRACT_ID] <backend> path rejected` shape. Without it a future PR could drift one but not the other and grep recipes would silently skip backends. 4. Why keep `[GH-559]` alongside the new contract tag? Runbook continuity — humans tracking that issue tag in logs over time shouldn't lose it. 5. Why no contract version bump? v1.2.0 already specifies this tag in FALSIFY-CPU-GPU-005's prediction; this PR closes the implementation gap. Bumping again would imply a contract semantic change, which isn't happening — only the code catches up to the contract. Verified locally: - `cargo test -p aprender-serve --features cuda --lib --release fallback_log_prefix` → 3/3 pass (cuda + wgpu + symmetry) - `cargo fmt --all -- --check` → no diff in touched file Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4 tasks
noahgift
added a commit
that referenced
this pull request
May 3, 2026
…line distill falsifier-parity (#1437) Canonical record of today's MODEL-2-side hygiene cycle (PRs #1432-#1436). Pre-cycle: --features hub unbuildable (E0425 in quantize_to_gguf_bytes), masking 11 pre-existing test failures. Chain landed: - #1432: bind match result; build works → 7975/7986 (11 pre-existing surfaced) - #1433: empty-input early-return → 7977/7986 (3 contract-drift fixed) - #1434: GGUF alignment-padding skip in 2 test helpers → 7986/7986 ✅ - #1435: WGPU_FALLBACK_LOG_PREFIX + 3 drift-prevention tests (matches v1.2.0) - #1436: 4 hf_pipeline distill falsifier-parity tests → 7990/7990 §42 documents: what landed (table), net hub health progression, why for MODEL-2 (parallel-impl drift-protection), Five Whys (build masked pre-existing failures), coverage update (15+33 unchanged; parallel-impl uplift), ship % effects (MODEL-1 87→88, MODEL-2 50→54), and next-session pickup options (CPU-GPU-005 part b OR distill-train precompute determinism). Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
[apr-cpu-vs-gpu-output-parity-v1] wgpu path rejectedsymmetric to the CUDA tag, but contract(apr-cpu-vs-gpu-output-parity-v1): v1.2.0 — FALSIFY-CPU-GPU-005 wgpu visibility + parity-gate entry #1430 only made existing[GH-559]/Backend:logs unconditional.pub(crate) const WGPU_FALLBACK_LOG_PREFIXand emits it on wgpu init failure.cuda_and_wgpu_fallback_log_prefixes_share_contract_tag).Five Whys
--features hubis healthy across fix(aprender-train): bind quantize_to_gguf_bytes match result so --features hub builds #1432-fix(aprender-train): account for GGUF tensor-data alignment padding in test helpers #1434, the test surface is reliable.[CONTRACT_ID] <backend> path rejectedshape uniformly so grep recipes work.[GH-559]? Runbook continuity — humans tracking that issue tag shouldn't lose it.Test plan
cargo test -p aprender-serve --features cuda --lib --release fallback_log_prefix→ 3/3 passcargo fmt --all -- --check→ no diff in touched fileapr runon a host without Vulkan should now stderr-emit both tags on stderr without--verbose🤖 Generated with Claude Code