es-ude / es-ude/OnDeviceTraining
bfp/softmax: PR6 review hygiene batch (R-S6 pin test, SR edge vectors, shift-mode fail-fast, guard-message hints)
- Dominant language
- C
- Stars
- 1
- Forks
- 3
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 8
Description
Follow-up from BFP epic PR6 (#439): the deferred-minor hygiene batch from the task/final reviews. Small, independent, one PR.
- [ ] **R-S6 forward-hatch pin test**: no test currently pins the forward escape hatch (`forwardMath = ARITH_FLOAT32` pinned on BFP wires ⇒ fake-quant runs, no fail-fast) — the asymmetry twin (backward pin fail-fasts) IS pinned. Add the missing direction so a regression that extends the fail-fast to the forward is caught (docs/conventions/arithmetic-bfp.md §5.9 R-S6).
- [ ] **SR shift vectors at negative floorQ + large k**: `bfpShiftRightRounded` SR mode is untested where `floorQ` is negative with `k` near 31. Add `SR(INT32_MIN, 31) == -1` and `SR(-2^29, 31) ∈ {-1, 0}` (with the seeded-draw pin idiom from UnitTestBfpSoftmaxExp).
- [ ] **`bfpShiftRightRounded` switch fallback**: an out-of-range `bfpShiftRounding_t` silently returns 0 today — make it fail fast like every other dispatch default in the BFP code (explicit-switch convention, docs/conventions/arithmetic-bfp.md).
- [ ] **Guard-message hints**: the `bfpWireAnchor` unification (PR6 Task 1) dropped the pool anchors' richer got-NULL vs got-non-BFP message suffix (same exit behavior, less actionable message). Restore the distinction in the shared helper's message.
Part of the #410 epic hygiene trail.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Contributor guide
Research direction
Start with docs/conventions/arithmetic-bfp.md §5.9 and locate bfpShiftRightRounded, bfpWireAnchor, and UnitTestBfpSoftmaxExp. Add the forward R-S6 pin and negative-floorQ SR vectors, make the rounding-mode fallback fail fast, and restore the got-NULL versus got-non-BFP guard hints; run the relevant BFP softmax tests to verify the pins and messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- machine-learning, testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100