chore: 标杆开源化最终收尾——中文注释、测试自注册、clang-tidy 进 CI、基准防优化、发版 4.2.0 - #6
Merged
Conversation
统一 include/tests/examples/benchmarks 下全部源码注释语言为中文, 保留 AVX2/loadu/storeu/if consteval 等技术术语原文。与 README/NOTES/ CHANGELOG 的全中文文档口径一致,消除英中混用的视觉不一致。
test_macros.hpp 增加零动态分配的静态链表注册表(函数局部静态头指针), BITCAL_TEST_CASE(name) 展开为前置声明 + 静态注册器 + 函数定义,测试一经 定义即被登记。49 个测试函数改为宏形式,main() 缩为调用 run_all_registered, 消除新测试漏注册静默不跑的风险。测试函数从 external linkage 收敛为 static。
新增根 .clang-tidy 作为 tidy 规则唯一事实源(CI job 与 clangd 共同拾取, .clangd 删除内联 ClangTidy 块);CI 新增 clang-tidy job,configure 导出 compile_commands.json 后 run-clang-tidy 全量检查并 --warnings-as-errors。 根 CMakeLists 默认 CMAKE_EXPORT_COMPILE_COMMANDS=ON,使 clangd 开箱即用。 本机 clang-tidy-19 对 4 个 TU 零诊断。
被测内核的输入(bit_block / std::bitset)此前未被消费,编译器可能把计算 提升为循环不变式或做常量传播,弱化测量。在每次迭代的操作调用前对称 pin 输入:二元操作 pin lhs+rhs,一元操作 pin lhs,BitCal 与 std::bitset 两侧 一致保证对比公平。开销为空 asm volatile,可忽略。
… WarningsAsErrors)
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.
概述
面向「标杆开源项目」的最终收尾,聚焦六个改动维度,按小步提交拆分,每项均带测试/文档闭环。
改动清单
docs: 源码注释统一为中文BITCAL_TEST_CASE宏 + 静态链表注册表,main()从 95 行缩到一行,49 用例全自发现test: 引入 BITCAL_TEST_CASE 自注册.clang-tidy唯一事实源 + 新增 CI job,4 个 TU 零诊断ci: clang-tidy 配置落地do_not_optimize,BitCal 与 std::bitset 双侧对称,防常量传播bench: 基准输入加入 do_not_optimizerelease: 4.2.0 版本号与 CHANGELOG/AGENTS 收尾验证
说明
v4.2.0tag 并创建 GitHub Release