docs: SYM_INT32 compute-vs-storage honesty + conventions → path-scoped docs#263
Merged
Conversation
…ed docs Honesty fixes: - Quantization.h: drop the stale "grad accumulators are value-sums, int16" comment -- weightGrad is a sum of products; grad storage-type is under #261. - QuantizationApi.h: fix the quantizationInitSymInt32WithBits docstring -- the plain initializer uses the int12 operand default (not "hardcodes 16"), and drop the "32 bits for full int32 range" over-promise (not cast-safe, #202). - CONVENTIONS.md: correct the value-sums claim for grad accumulators. Conventions reorg: - Split docs/CONVENTIONS.md into per-subsystem docs/conventions/*.md (verbatim moves); CONVENTIONS.md becomes a thin index + the memory-over-accuracy vision. - Add the "SYM_INT32 is a compute format, not storage (#261)" convention. No behavior change. Build clean; 63/63 unit tests pass. Relates to #261. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
What
Two related, no-behavior-change cleanups from a #210 SYM-completeness review session.
Honesty fixes (comments/docstrings only)
Quantization.h— drop the stale "grad accumulators are value-sums, int16" comment. weightGrad is a sum of products (int32 accumulate → requantize), not a value-sum; and whether grads should be stored SYM_INT32 at all is under redesign (optimizer: gradients should not be stored as SYM_INT32 (compute-format ≠ storage-format) #261).QuantizationApi.h— fix thequantizationInitSymInt32WithBitsdocstring: the plainquantizationInitSymInt32(rm)uses the int12 operand default (ODT_SYM_OPERAND_QMAXBITS), not "hardcodes 16"; and drop the "32 bits for full int32 range" claim (b=32 is not cast-safe in the converters, tensor: qMaxBits=32 advertised but UB in convertFloatTensorToSymInt32Tensor (float clamp bound rounds to 2^31) #202).CONVENTIONS.md— correct the same value-sums claim.Conventions reorganization
docs/CONVENTIONS.mdinto per-subsystem docs underdocs/conventions/(tensor, arithmetic-sym, loss, allocation, testing, data-shape) — verbatim moves, no rewriting.CONVENTIONS.mdis now a thin index + the memory-over-accuracy vision.docs/conventions/tensor.md.(Path-scoped
.claude/rules/*.mdwere also added locally to auto-surface each subsystem's conventions when working in that subtree, but.claude/is gitignored so they are not part of this PR.)Why
Comments/docstrings had drifted out of sync with the code (the #227 int12 operand default; the #261 grad-storage direction) and were actively misleading. Splitting the monolithic conventions file makes it navigable and lets subsystem rules load on demand.
Testing
cmake --build --preset unit_test_debug— clean (238/238)ctest --preset unit_test_debug— 63/63 passRelates to #261.
🤖 Generated with Claude Code