Repository navigation
Conversation
…art of #3130, meta #3127) First extraction in the fixed_point.cpp split (#3130). Moves the misc section (lines 4818-5226) into its own file: - Fixed-point scalar type alignment tests - Constexpr scalar multiply/divide tests (s0x32, u0x32) - Integer constructor tests (PR #2197 int width portability) - pow boundary regression tests (#2969) Also extends ci/hooks/check_test_file_pairing.py to allow sibling-split test files. The original 1:1 pairing rule rejected fixed_point_misc.cpp because there is no src/fl/math/fixed_point_misc.h. The new sibling-split allowance walks back the base name via underscore separators and allows the write when the longest base prefix has both an existing paired test file and a matching src header. This unblocks the rest of #3127's splits without weakening the convention for genuinely unpaired test files. Tests pass: bash test fl_math_fixed_point --cpp (1/1, 17/17 build steps). fixed_point.cpp: 5,230 -> 4,816 LOC fixed_point_misc.cpp (new): 440 LOC Part of #3130. Meta tracking issue: #3127. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…pp (part of #3130) Second extraction in #3130. Moves the constexpr validation section (original lines 811-1129 + the constexpr_raw_check helper at 120-124) into its own file: - constexpr raw() compile-time check (all 13 types) - constexpr from_raw compile-time check - constexpr arithmetic operators - constexpr comparisons - constexpr conversions - constexpr math functions (mod, floor, ceil, fract, abs, sign, lerp, clamp, step, sqrt, rsqrt) - constexpr value verification (concrete value computations) Plus the 23 constexpr_*_check<T>(...) helper templates that the tests use; they were only referenced by the moved test cases. The original section header "Concrete Bit-Exact Tests (All Types)" now correctly introduces the bit-exact tests that remain in fixed_point.cpp. Tests pass: bash test fl_math_fixed_point --cpp (1/1, 0.27s test time). fixed_point.cpp: 4,816 -> 4,488 LOC fixed_point_constexpr.cpp (new): 343 LOC Stacked on top of feat/3130-fixed-point-misc-extract (PR #3135) because both PRs depend on the same ci/hooks/check_test_file_pairing.py sibling- split allowance that #3135 introduces. Part of #3130. Meta tracking issue: #3127. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…3130) Third extraction in #3130, the keystone for the remaining four per-type PRs. Moves the accuracy_bounds<T> template specialization table (original lines 126-331 = 6 specializations + their out-of-line definitions) into a new shared header. Include pattern: each consumer .cpp file includes fixed_point_bounds.h from WITHIN its anonymous namespace, so each translation unit gets its own private copy. This avoids ODR concerns with the out-of-line constexpr static member definitions, which are still required for C++11/C++14 compatibility on this codebase. Header uses fully-qualified fl::s4x12 etc., so it works regardless of whether the consumer has 'using namespace fl;' in scope. Unblocks the upcoming per-type extractions: - fixed_point_signed_types.cpp - fixed_point_u4x12_u8x8.cpp - fixed_point_u12x4_u16x16.cpp - fixed_point_u8x24_u24x8.cpp Tests pass: bash test fl_math_fixed_point --cpp (1/1, 0.28s test time, 69.5s build). fixed_point.cpp: 4,488 -> 4,277 LOC fixed_point_bounds.h (new): 230 LOC Stacked on feat/3130-fixed-point-constexpr-extract (PR #3136), which is stacked on feat/3130-fixed-point-misc-extract (PR #3135). Both predecessors are required because they introduce the ci/hooks/check_test_file_pairing.py sibling-split allowance. Part of #3130. Meta tracking issue: #3127. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Jun 16, 2026
Closed
zackees
force-pushed
the
feat/3130-fixed-point-constexpr-extract
branch
from
June 16, 2026 04:38
6337db6 to
0b220b5
Compare
zackees
added a commit
that referenced
this pull request
Jun 16, 2026
…cpp (part of #3130) Fourth extraction in #3130. Moves the u4x12 + u8x8 unsigned type tests into their own file. Both share a section because they share the file-local approx_equal() helper (used only within these two sections). Content moved: - 28 FL_TEST_CASE u4x12 tests (construction, arithmetic, math ops, edge cases, precision, compound operations) - 60+ FL_TEST_CASE u8x8 tests (construction variants, addition/sub/ mul/div, shifts, comparisons, math ops, sqrt/rsqrt/pow, edge cases) - approx_equal() static helper (lines 1644-1646 of original) Tests pass: bash test fl_math_fixed_point --cpp (1/1, 0.23s test time, 44s build). fixed_point.cpp: 4,277 -> 3,404 LOC fixed_point_u4x12_u8x8.cpp (new): 896 LOC Stacked on feat/3130-fixed-point-bounds-header (PR #3138). Predecessors: - feat/3130-fixed-point-misc-extract (PR #3135 — hook + misc) - feat/3130-fixed-point-constexpr-extract (PR #3136 — constexpr) - feat/3130-fixed-point-bounds-header (PR #3138 — bounds.h) Part of #3130. Meta tracking issue: #3127. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
zackees
added a commit
that referenced
this pull request
Jun 16, 2026
…cpp (part of #3130) (#3161) Fourth extraction in #3130. Moves the u4x12 + u8x8 unsigned type tests into their own file. Both share a section because they share the file-local approx_equal() helper (used only within these two sections). Content moved: - 28 FL_TEST_CASE u4x12 tests (construction, arithmetic, math ops, edge cases, precision, compound operations) - 60+ FL_TEST_CASE u8x8 tests (construction variants, addition/sub/ mul/div, shifts, comparisons, math ops, sqrt/rsqrt/pow, edge cases) - approx_equal() static helper (lines 1644-1646 of original) Tests pass: bash test fl_math_fixed_point --cpp (1/1, 0.23s test time, 44s build). fixed_point.cpp: 4,277 -> 3,404 LOC fixed_point_u4x12_u8x8.cpp (new): 896 LOC Stacked on feat/3130-fixed-point-bounds-header (PR #3138). Predecessors: - feat/3130-fixed-point-misc-extract (PR #3135 — hook + misc) - feat/3130-fixed-point-constexpr-extract (PR #3136 — constexpr) - feat/3130-fixed-point-bounds-header (PR #3138 — bounds.h) Part of #3130. Meta tracking issue: #3127. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees
added a commit
that referenced
this pull request
Jun 16, 2026
…rt of #3130) — closes the loop Seventh extraction in #3130. Moves all the test infrastructure templates into a shared header. With this PR, fixed_point.cpp drops to 613 LOC — under the meta 1K-LOC target. Together with PRs #3135, #3136, #3138, #3139, #3142, #3143, the original 5,230-LOC monolith is fully decomposed. Content moved (1053 LOC of helpers from 5 non-contiguous ranges): - test_*_impl<T> bit-exact helpers (original lines 131-585) - AccuracyResult struct + non-templated measure_* helpers + print_row helpers (original lines 838-1054) - measure_*_t<T> templated helpers + run_type_accuracy<T> (original lines 1120-1356) - test_bit_exact_equivalence<Tmpl, Conc> (original lines 1369-1430) - check_all_accuracy_bounds<T> regression gate (original lines 1456-1515) Same include pattern as fixed_point_bounds.h: each consumer .cpp file includes from WITHIN its anonymous namespace, after bounds.h. Tests pass: bash test fl_math_fixed_point --cpp (1/1, 0.37s test time, 117s build). fixed_point.cpp: 1,643 -> 613 LOC (under 1K target) fixed_point_test_helpers.h (new): 1053 LOC (header, no LOC cap) After this PR, fixed_point.cpp contains only: - includes + FL_TEST_FILE wrapper + namespace + raw_t + check_near + FP_TYPES macro + includes to bounds.h and test_helpers.h - Bit-exact test cases (CHECK_EQ-based) - Transcendental test cases (CHECK_CLOSE with bounds) - s16x16 accuracy report - multi-type accuracy report - fixed_point<N,M> vs sNxM bit-exact tests - per-type accuracy bounds tests - GitHub #2174 regression test - to_float comprehensive test Stacked on feat/3130-fixed-point-u8x24-u24x8-extract (PR #3143). Closes #3130 once all 7 stacked PRs merge. Meta tracking issue: #3127. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
zackees
added a commit
that referenced
this pull request
Jun 16, 2026
…rt of #3130) — closes the loop (#3164) Seventh extraction in #3130. Moves all the test infrastructure templates into a shared header. With this PR, fixed_point.cpp drops to 613 LOC — under the meta 1K-LOC target. Together with PRs #3135, #3136, #3138, #3139, #3142, #3143, the original 5,230-LOC monolith is fully decomposed. Content moved (1053 LOC of helpers from 5 non-contiguous ranges): - test_*_impl<T> bit-exact helpers (original lines 131-585) - AccuracyResult struct + non-templated measure_* helpers + print_row helpers (original lines 838-1054) - measure_*_t<T> templated helpers + run_type_accuracy<T> (original lines 1120-1356) - test_bit_exact_equivalence<Tmpl, Conc> (original lines 1369-1430) - check_all_accuracy_bounds<T> regression gate (original lines 1456-1515) Same include pattern as fixed_point_bounds.h: each consumer .cpp file includes from WITHIN its anonymous namespace, after bounds.h. Tests pass: bash test fl_math_fixed_point --cpp (1/1, 0.37s test time, 117s build). fixed_point.cpp: 1,643 -> 613 LOC (under 1K target) fixed_point_test_helpers.h (new): 1053 LOC (header, no LOC cap) After this PR, fixed_point.cpp contains only: - includes + FL_TEST_FILE wrapper + namespace + raw_t + check_near + FP_TYPES macro + includes to bounds.h and test_helpers.h - Bit-exact test cases (CHECK_EQ-based) - Transcendental test cases (CHECK_CLOSE with bounds) - s16x16 accuracy report - multi-type accuracy report - fixed_point<N,M> vs sNxM bit-exact tests - per-type accuracy bounds tests - GitHub #2174 regression test - to_float comprehensive test Stacked on feat/3130-fixed-point-u8x24-u24x8-extract (PR #3143). Closes #3130 once all 7 stacked PRs merge. Meta tracking issue: #3127. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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
Keystone extraction in
tests/fl/math/fixed_point.cppsplit (#3130). Moves theaccuracy_bounds<T>template specialization table — 6 specializations + their out-of-line constexpr static member definitions — into a new shared headertests/fl/math/fixed_point_bounds.h.Stacked on: PR #3136 → PR #3135 (chain of three).
Include pattern
Each consumer .cpp file includes the header from within its anonymous namespace:
This gives each translation unit its own private copy of the bounds table and avoids ODR concerns with the out-of-line
constexpr float accuracy_bounds<X>::Y;definitions, which remain required for C++11/C++14 compatibility on this codebase. Memory overhead per TU is tiny (~80 floats in static storage).Why not a named namespace? A named
fl::test::fp_detail::accuracy_bounds<T>would require renaming every existing use site (~100+ edits across the upcoming per-type files). The anonymous-namespace-include pattern matches the original file's design and is fully self-contained.Header uses fully-qualified
fl::s4x12etc., so it works regardless of whether the consumer hasusing namespace fl;in scope.Unblocks
Four remaining per-type PRs for #3130 — all need to include this bounds table:
fixed_point_signed_types.cpp(signed type bit-exact + accuracy bounds tests)fixed_point_u4x12_u8x8.cppfixed_point_u12x4_u16x16.cppfixed_point_u8x24_u24x8.cppLOC delta
tests/fl/math/fixed_point.cpp: 4,488 → 4,277 LOCtests/fl/math/fixed_point_bounds.h(new): 230 LOCTest plan
bash test fl_math_fixed_point --cpp— green (1/1 passed, 0.28s test time, 69.5s build)FL_TEST_CASElost: same tests run against the included boundsfl::types)bash test --cppmatrixFollow-up
PR 3 of 8 for #3130. Remaining:
fixed_point_bit_exact.cpp(lines 1131-1970 of original)fixed_point_signed_types.cpp(depends on bounds.h — now ready)fixed_point_u4x12_u8x8.cpp(depends on bounds.h)fixed_point_u12x4_u16x16.cpp(depends on bounds.h)fixed_point_u8x24_u24x8.cpp(depends on bounds.h)fixed_point.cppafter final extraction)Refs #3130. Tracked by #3127. Stacked on #3136 (which is stacked on #3135).
Generated with Claude Code.