bfp/softmax: PR6 review hygiene batch (R-S6 pin test, SR edge vectors, shift-mode fail-fast, guard-message hints)

Open
#442 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
c

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.

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

Dominant language
C
Stars
2
Forks
3
Avg merge
13h 6m
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from es-ude/OnDeviceTraining

All issues in es-ude/OnDeviceTraining

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.