Skip to content

fix(bench): generate compile-time TUs into the build tree - #48

Merged
sentomk merged 1 commit into
mainfrom
fix/bench-ct-tu-out-of-tree
Aug 1, 2026
Merged

fix(bench): generate compile-time TUs into the build tree#48
sentomk merged 1 commit into
mainfrom
fix/bench-ct-tu-out-of-tree

Conversation

@sentomk

@sentomk sentomk commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

_ptn_ct_add_lit_tu wrote ct_bench_lit_{8,16,32,64,128}.cpp into the source tree on every CMake configure, dirtying the working tree each time. Worse, the generated files were committed to the repo, and their committed (clang-formatted) content never matched the generator output — so every configure produced spurious diffs.

Changes

  • Generate the literal-match compile-time TUs into CMAKE_CURRENT_BINARY_DIR instead of CMAKE_CURRENT_SOURCE_DIR, with a comment recording why.
  • Remove the five generated files from version control. Hand-written TUs (ct_bench_variant_32, ct_bench_compound, ct_bench_lit_rdense) are unaffected.

Testing

  • Verified locally: fresh reconfigure + cmake --build build --target ptn_bench_ct compiles all generated TUs from the build tree, and git status stays clean afterwards.
  • No behavior change to benchmark semantics — same generated code, new location.

Problem
- _ptn_ct_add_lit_tu wrote ct_bench_lit_{8..128}.cpp into the
  source tree on every CMake configure, so each configure dirtied
  the working tree with regenerated files.
- The generated files were also committed, and their committed
  formatting never matched the generator output.

Implementation
- Write the generated translation units to
  CMAKE_CURRENT_BINARY_DIR instead of CMAKE_CURRENT_SOURCE_DIR.
- Remove the five generated files from version control; the
  hand-written TUs (variant, compound, rdense) are unaffected.

Tests
- Reconfigured and built ptn_bench_ct: all generated TUs compile
  from the build tree and the working tree stays clean.
@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sentomk
sentomk merged commit eb6764e into main Aug 1, 2026
22 checks passed
@sentomk
sentomk deleted the fix/bench-ct-tu-out-of-tree branch August 1, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant