Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
build/
**/build/
*.build/
**/_build_ci/

# VitePress
node_modules/
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@
**贡献类型**:🎨 📝
**贡献渠道**:微信
**贡献说明**:指导文档站 UI 设计,提供阅读体验改进意见

### [Nyuudoukumo](https://github.com/Nyuudoukumo)

**贡献类型**:🐛 💡
**贡献渠道**:GitHub
**贡献说明**:反馈卷一「Cache 机制与内存层次」示例与解释不一致的问题(#67),促成量纲修正
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
---

<!-- COVERAGE_START -->
![English Coverage](https://img.shields.io/badge/en_coverage-99%25-green.svg) 491/494 docs translated
![English Coverage](https://img.shields.io/badge/en_coverage-100%25-green.svg) 494/494 docs translated
<!-- COVERAGE_END -->

## 这是什么项目
Expand Down Expand Up @@ -103,12 +103,12 @@ cmake -S code/examples/chapter05/06_array_vs_stdarray -B build && cmake --build
|----|------|:----:|--------|
| 卷一 | 基础入门(含 C 速通) | 87 | ✅ 成型 |
| 卷二 | 现代特性(RAII / 智能指针 / 移动 / lambda) | 44 | ✅ 成型 |
| 卷三 | 标准库深入 | 8 | 🔨 在建 |
| 卷四 | 高级主题(concepts / 协程 / 模板) | 8 | 🔨 在建 |
| 卷三 | 标准库深入 | 40 | ✅ 成型 |
| 卷四 | 高级主题(concepts / 协程 / 模板 / 设计模式) | 29 | 🔨 在建 |
| 卷五 | 并发编程 | 44 | ✅ 成型 |
| 卷六 | 性能优化 | 3 | 🔨 在建 |
| 卷六 | 性能优化 | 6 | 🔨 在建 |
| 卷七 | 工程实践(CMake / 工具链 / 调试) | 8 | 🔨 在建 |
| 卷八 | 领域应用(嵌入式 / 网络 / GUI / 存储) | 63 | ✅ 成型 |
| 卷八 | 领域应用(嵌入式 / GUI / 存储等) | 63 | ✅ 成型 |
| 卷九 | 开源项目研读(Chromium 等) | 16 | 📚 持续更新 |
| 卷十 | 课程与演讲笔记(CppCon 等) | 17 | 📚 持续更新 |

Expand Down
80 changes: 80 additions & 0 deletions changelogs/v0.7.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# v0.7.0 (2026-06-25)

内容主线里程碑:卷三「标准库」全面成型、卷四补齐 GoF 设计模式系列、卷六补齐内存安全与 sanitizer 三部曲、卷五并发 Lab 重设计为 TDD 工程;平台层落地代码折叠与字号开关,部署链路切换为 GitHub Pages artifact 方式;英文翻译覆盖率达 100%。

## 卷三:标准库全面成型

按 v0.6.0 路线图「012 卷三全面重建」收尾。本轮把容器以外的标准库全部写完,并把扁平结构重组为 6 个子目录,每篇均带本机 GCC 16.1.1 真实终端输出,零 stub:

- **containers/(13 篇)** — v0.6.0 里程碑内容,本轮仅作目录迁移,确认完整无损坏。
- **iterators-algorithms/(7 篇 40–46)** — 迭代器适配器、STL 算法总览(上/下)、数值算法、ranges 与 C++23 新件(`fold`/`contains`/新适配器)、并行算法(`-ltbb`、`par` / `par_unseq` 编译命令)。
- **strings/(6 篇)** — `char8_t` 与 UTF-8、`string_view`、`charconv`、`format`、`print`、`regex`(按 C++20/23 标注支持度)。
- **error-utils/(8 篇 61–68)** — `optional`、`variant`、`any`、`expected`(monadic 链 + 与异常的性能实测,频繁失败路径快近两个数量级)、`functional`、`error_code`、`stacktrace`、`source_location`。
- **io/(3 篇 55–57)** — `iostream`(为何慢、怎么用才不慢)、`fstream`(RAII + 二进制可移植性)、`filesystem`(真实遍历 `/usr/include` 21173 条目 benchmark,冷热页缓存差 ~20×,`directory_entry` 缓存 vs 自由函数重 stat 实测)。
- **time-numeric/(3 篇 58–60)** — `chrono`(实测 `high_resolution_clock` 在 libstdc++ 是 `system_clock` 别名,纠正老资料说是 `steady_clock` 的说法;C++20 日历/时区/`parse`)、`cmath`(精度陷阱)、`random`(为什么别用 `rand`)。

v0.6.0 changelog 标记的卷三待办基本清零;唯一留作可选深化项的是独立的「libc++ 源码阅读」专题——但多篇 deep-dive(`vector`/`string`/`map`/`unordered_map`/`charconv`/`regex` 等)已内嵌实现级源码分析,故该专题文章的缺失不等于内容缺失。

## 卷四:GoF 设计模式系列

从笔者旧博客迁移 **21 篇 GoF 设计模式**([01-singleton … 21-mediator](documents/vol4-advanced/vol4-generics-patterns/)),一次性补齐 `vol4-generics-patterns` 子区。按创造型(4)/结构型(7)/行为型(10)分组,统一走「朴素写法 → 逐步改进 → 终端实测验证 → 决策表 → 小结」骨架,是现代 C++ 写法而非朴素 OOP:

- **Visitor** 贴 `-O2` 汇编看 `std::visit` 判别式分派 + 500 万次虚函数 vs variant 实测,带诚实的「variant 并不总是更快」caveat。
- **Singleton** 用 500 线程实测证 C++11 magic-statics 线程安全,对比 DCLP 的 acquire/release。
- **Observer** 用 `weak_ptr` 防悬挂 + ASan 复现 use-after-free。

21 篇均有配套 CMake 工程([`code/volumn_codes/vol4/design-patterns/`](code/volumn_codes/vol4/design-patterns/)),中英双语对齐。index 另标「规划中」的模板级模式(Policy-Based Design / CRTP / type erasure / Mixin 等)作为未来路线。

## 卷六:内存安全与 sanitizer

新增内存安全三部曲(#80,迁移自作者 `*sans` 笔记):

- **ASan 家族**(compile-time instrumentation / 1:8 影子内存 / quarantine)+ Heartbleed(CVE-2014-0160)越界读框架;五 sanitizer(ASan/LSan/MSan/TSan/UBSan)对比,ASan↔TSan 互斥用真实编译错误演示。
- **Valgrind vs ASan**——DBT/JIT(20–50× 慢、免重编译、memcheck A-bit/V-bit 双影子表)vs CTI(~2×、须重编译、影子内存)两条路线对比;五工具分解(memcheck/callgrind/cachegrind/helgrind+drd/massif),六种错误(uninit/UAF/OOB/leak/malloc-delete 错配/double-free)带 GCC 16.1.1 + valgrind 3.25.1 真实输出。
- **sanitizer 工具链全景**——用户态 `-fsanitize=*` ↔ 内核 KASAN/KMSAN/UBSAN/KCSAN/KFENCE/DAMON(含合并版本),三层防御(开发期全插桩 / 预发布采样 / 生产轻量)。


## 卷五:并发 Lab 重设计

并发 Lab(#70)重设计为 TDD 工程:新增 [`code/volumn_codes/vol5-labs/`](code/volumn_codes/vol5-labs/)(standalone FetchContent + Catch2 v3.7.1),`templates/`(空骨架,学习者拷贝去做)/ `examples/`(参考实现)双轨,每个 lab 独立可构建。

- **Lab 0(线程生命周期)** 完整:MS1–4 渐进测试 + TSan 友好的并发文件扫描器参考实现(递归收集 → 分片 → `JoiningThread` worker → 归约)。
- **Lab 1(阻塞队列 / 并发缓存 / 同步原语)** 模板与 MS1–6 测试就绪;参考实现标注「⚠️ 正在开发中」,目前只有空声明,完成后作为对照。

两份 lab 手册(`exercises/00-thread-lifecycle.md`、`01-bounded-queue.md`)大改重写

## 卷八:领域归属整理

`networking` 子区内容下线(挪至 `.claude/drafts/networking/` 待重写,gitignored),卷八回归嵌入式 / GUI / 存储 / 算法 / C++ 深入五个已成型子领域(中英 index 与全仓引用同步清理,零死链)。

## 平台与站点

- **长代码折叠**(#72,对应 issue #71):构建期 markdown-it 插件,把超阈值行数的代码块整段包进原生 `<details>`——零 FOUC(静态即折叠态)、无 JS 原生可展开、打印友好;`code-group` 内子块豁免。代码放在 `<details>` 外、纯 CSS `:has(details[open])` 控展开。
- **字号开关**(#69):正文五档缩放(超小 / 小 / 正常 / 大 / 超大),桌面 + 移动端导航均有,A-/A+ 步进,localStorage 持久化,首屏由 `<head>` 内联脚本提前应用防闪烁。
- **部署链路优化**(#78):`gh-pages` 分支部署 → `actions/deploy-pages` artifact 部署。根治了 search 索引 chunk 每次构建换 hash 被 commit 进 gh-pages、致仓库膨胀至 437MB(86% 是 `.git`)的问题;main 分支保持干净,站点已上线。
- **构建/校验基础设施**:
- `tags.py` 抽为 `VALID_TAGS` 单一数据源(`validate_frontmatter.py` + `check_quality.py` 共用),根治 vol4 设计模式迁移时两套白名单分叉导致 CI 挂的坑;本轮补全 GoF 设计模式 + 内存安全 + 调试/测试等新标签。
- 新增 `build_examples.py`:host / STM32 分离 + CTest 支持,CI 接入,发现 113 个 host 工程。
- `translate.py` 两处加固:`normalize_translated_title` 剥离 LLM 重新加回的 `<>`(v-html 吃裸尖括号)+ `yaml.dump width` 防长标题折行被侧边栏截断。

## 内容修复

- **卷一 Cache 步长实验量纲错误**(总耗时 → 每次访问耗时),#68 —— 源自 [@Nyuudoukumo](https://github.com/Nyuudoukumo) 的反馈 issue #67。
- **`std::inplace_vector` 代码示例改进**,#73,@YukunJ。
- **`std::is_trivially_copyable_v` 代码示例错误表述修正**,#75,@YukunJ。
- **`std::pmr::vector` 仅用栈缓冲、不落堆的实测佐证**,#77,@YukunJ。

## 翻译

- 英文全量对齐;卷六内存安全 3 篇补译,英文覆盖率 **99% → 100%(494/494)**,所有卷全部双语对齐。
- README 状态表全量刷新:卷三 8→40 篇(翻为「✅ 成型」)、卷四 8→29 篇(标注含设计模式)、卷六 3→6 篇、卷八描述去掉已下线的「网络」;coverage 徽章由 `coverage.py --update` 自动更新为 100%。

## 贡献者

Charliechen114514、YukunJ(代码与内容);

感谢反馈者 **[@Nyuudoukumo](https://github.com/Nyuudoukumo)**(issue #67 卷一 Cache 内容勘误,促成 #68 量纲修正)。已同步进 CONTRIBUTORS.md 与中英 team 页。

本版合并 PR #68–#80(#71/#74 为 issue,未计入)

贡献者 Charliechen114514、YukunJ,反馈者 Nyuudoukumo。
9 changes: 9 additions & 0 deletions documents/en/team/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ The valuable feedback from these folks is equally worth recording. It is your fe
<p class="card-desc">Reported compilation failure in the expected example</p>
</div>
</a>
<a href="https://github.com/Nyuudoukumo" target="_blank" rel="noopener noreferrer" class="contributor-card">
<img src="https://github.com/Nyuudoukumo.png?size=96" alt="Nyuudoukumo" class="card-avatar" />
<div class="card-body">
<span class="card-name">Nyuudoukumo <span class="card-badge issue">Issue</span></span>
<p class="card-role">Bug Report · Content Errata</p>
<p class="card-types">🐛 💡</p>
<p class="card-desc">Reported an inconsistency between the example and explanation in Vol.1 "Cache and Memory Hierarchy" (#67), leading to a units fix</p>
</div>
</a>
</div>

## How to Become a Contributor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Upon completion, you should have muscle memory for the mutex + condition_variabl

## Project Scaffold (Get this running first)

Each Lab has two versions under `vol5-labs/`: **`templates/lab1_bounded_queue/`** is the empty implementation skeleton (copy this one to work on), and **`examples/lab1_bounded_queue/`** is the reference implementation (use this to compare if you get stuck, but don't copy it upfront). Both are standalone projects. You will be working on the `templates` version:
Each Lab has two versions under `vol5-labs/`: **`templates/lab1_bounded_queue/`** is the empty implementation skeleton (copy this one to work on), and **`examples/lab1_bounded_queue/`** is the reference implementation (⚠️ under development — currently only empty declarations, no complete reference yet; once complete, use it to compare if you get stuck, but don't copy it upfront). Both are standalone projects. You will be working on the `templates` version:

```text
templates/lab1_bounded_queue/
Expand Down
Loading
Loading