Skip to content

Commit 1c674db

Browse files
LessUpCopilot
andcommitted
openspec: fix quality review issues in performance-teaching-hardening
- Resolve vectorization flag inconsistency: use -fopt-info-vec-optimized consistently across design.md, tasks.md, and simd-vectorization/spec.md, matching the existing docs/en/guides/learning-path.md content - Resolve dispatch_example ambiguity: add dispatch_example_main.cpp and dispatch_example executable target explicitly to the file surface table and tasks (was referenced in the Mermaid diagram but undefined elsewhere) - Remove prose hedging in design.md: replace 'Add a page (or expand an existing section)' with the concrete docs/en/guides/validation.md path that was already decided in the file surface table - Make SIMD test path concrete: tests/unit/simd/simd_dispatch_test.cpp (matching the existing tests/unit/simd/ layout); add note about compiling without -mavx2 to exercise the runtime guard - Clarify ci-quality-assurance tombstone: add comment block explaining the intentional omission so implementers do not question the empty delta Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9abee3f commit 1c674db

4 files changed

Lines changed: 18 additions & 10 deletions

File tree

openspec/changes/performance-teaching-hardening/design.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ graph TD
3939

4040
**Goal**: Make compiler vectorization reports reachable without reading CMakeLists.txt.
4141

42-
**Approach**: Add a "Vectorization Diagnostics" section to `examples/04-simd-vectorization/README.md` that shows the exact build commands (`cmake --preset=debug -DCMAKE_CXX_FLAGS="-fopt-info-vec"` / `-Rpass=loop-vectorize`) and how to read the output. Mirror a condensed version in `docs/` under the SIMD learning path entry.
42+
**Approach**: Add a "Vectorization Diagnostics" section to `examples/04-simd-vectorization/README.md` that shows the exact build commands (`cmake --preset=debug -DCMAKE_CXX_FLAGS="-fopt-info-vec-optimized"` / `-Rpass=loop-vectorize`) and how to read the output. Mirror a condensed version in `docs/` under the SIMD learning path entry.
43+
44+
**Flag note**: Use `-fopt-info-vec-optimized` (not the broader `-fopt-info-vec`) for GCC because it reports only successfully vectorized loops, which is more useful for teaching. The existing `docs/en/guides/learning-path.md` already uses `-fopt-info-vec-optimized`; this change must stay consistent with that.
4345

4446
**Trade-off**: We do not add a new CMake preset for this; a reader-visible flag override is sufficient and avoids preset sprawl.
4547

4648
### 3. Sanitizer workflow in reader-facing docs
4749

4850
**Goal**: A reader can find and run ASan/TSan/UBSan without knowing the preset names in advance.
4951

50-
**Approach**: Add a "Validation and Safety" page (or expand an existing section) in the VitePress docs site. Reference the three preset names (`asan`, `tsan`, `ubsan`) with copy-pasteable commands. Cross-link from the repository README quick-start.
52+
**Approach**: Add `docs/en/guides/validation.md` as a new VitePress page in the docs site. Reference the three preset names (`asan`, `tsan`, `ubsan`) with copy-pasteable commands. Cross-link from the repository README quick-start.
5153

5254
**Trade-off**: Keep this as documentation only. Do not add a new composite preset or script; the existing presets are complete.
5355

@@ -65,9 +67,10 @@ graph TD
6567

6668
| Path | Change |
6769
|------|--------|
68-
| `examples/04-simd-vectorization/src/runtime_dispatch.cpp` | New: runtime CPU dispatch example |
69-
| `examples/04-simd-vectorization/CMakeLists.txt` | Extend: add `simd_dispatch` STATIC library target |
70-
| `tests/` (simd subdir) | New: correctness test for `dispatch_add_arrays` |
70+
| `examples/04-simd-vectorization/src/runtime_dispatch.cpp` | New: runtime CPU dispatch implementation |
71+
| `examples/04-simd-vectorization/src/dispatch_example_main.cpp` | New: `dispatch_example` executable entry point |
72+
| `examples/04-simd-vectorization/CMakeLists.txt` | Extend: add `simd_dispatch` STATIC library target and `dispatch_example` executable target |
73+
| `tests/unit/simd/simd_dispatch_test.cpp` | New: correctness test for `dispatch_add_arrays` |
7174
| `examples/04-simd-vectorization/README.md` | Extend: vectorization diagnostics section |
7275
| `docs/en/guides/learning-path.md` | Extend: vectorization diagnostics, sanitizer cross-link |
7376
| `docs/en/guides/validation.md` | New: sanitizer preset workflow (asan/tsan/ubsan) |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# CI and Quality Assurance
22

3+
<!-- Intentional delta: no new requirements are added to this capability in this change. -->
4+
<!-- This file exists to confirm the omission was deliberate. The benchmark regression -->
5+
<!-- script smoke-test requirement is owned by the `benchmark-framework` capability. -->
6+
37
No new requirements added in this change. The benchmark regression script smoke-test requirement is owned by the `benchmark-framework` capability.

openspec/changes/performance-teaching-hardening/specs/simd-vectorization/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ THE Documentation SHALL document how to obtain compiler vectorization reports fo
2424

2525
#### Scenario: Reader enables vectorization diagnostics
2626

27-
- **WHEN** a reader builds the SIMD examples with GCC (`-fopt-info-vec`) or Clang (`-Rpass=loop-vectorize`)
27+
- **WHEN** a reader builds the SIMD examples with GCC (`-fopt-info-vec-optimized`) or Clang (`-Rpass=loop-vectorize`)
2828
- **THEN** the module README provides the exact command and an explanation of the output

openspec/changes/performance-teaching-hardening/tasks.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
- [ ] 1.1 Add `examples/04-simd-vectorization/src/runtime_dispatch.cpp` with `hpc::simd::dispatch_add_arrays` using `__builtin_cpu_supports` for AVX2/SSE2/scalar selection
66
- [ ] 1.2 Add a `simd_dispatch` STATIC library target in `examples/04-simd-vectorization/CMakeLists.txt` (separate from the INTERFACE `simd_utils` target) that compiles `runtime_dispatch.cpp` and links `simd_utils` for headers
7-
- [ ] 1.3 Add a correctness test under `tests/` that calls `dispatch_add_arrays` and validates results against the scalar reference
8-
- [ ] 1.4 Verify `cmake --preset=debug && cmake --build build/debug && ctest --preset=debug` passes with the new target and test
7+
- [ ] 1.3 Add `examples/04-simd-vectorization/src/dispatch_example_main.cpp` and a `dispatch_example` executable target in `examples/04-simd-vectorization/CMakeLists.txt` that links `simd_dispatch` and demonstrates runtime dispatch
8+
- [ ] 1.4 Add `tests/unit/simd/simd_dispatch_test.cpp` (and wire it into `tests/unit/simd/CMakeLists.txt`) that calls `dispatch_add_arrays` and validates results against the scalar reference; note: the test must compile without `-mavx2` so the runtime guard is exercised on machines without AVX2
9+
- [ ] 1.5 Verify `cmake --preset=debug && cmake --build build/debug && ctest --preset=debug` passes with the new targets and test
910

1011
## 2. Vectorization diagnostics documentation
1112

12-
- [ ] 2.1 Add a "Vectorization Diagnostics" section to `examples/04-simd-vectorization/README.md` with GCC (`-fopt-info-vec`) and Clang (`-Rpass=loop-vectorize`) flag examples and sample output
13-
- [ ] 2.2 Extend `docs/en/guides/learning-path.md` (SIMD section) to surface the vectorization diagnostics workflow for readers
13+
- [ ] 2.1 Add a "Vectorization Diagnostics" section to `examples/04-simd-vectorization/README.md` with GCC (`-fopt-info-vec-optimized`) and Clang (`-Rpass=loop-vectorize`) flag examples and sample output
14+
- [ ] 2.2 Extend `docs/en/guides/learning-path.md` (SIMD section) to surface the vectorization diagnostics workflow for readers, using `-fopt-info-vec-optimized` to stay consistent with the existing content in that file
1415

1516
## 3. Sanitizer workflow documentation
1617

0 commit comments

Comments
 (0)