Add Zstd GPU CI test infrastructure (Phase 1)#108
Merged
brohan203 merged 8 commits intoJul 9, 2026
Merged
Conversation
5115e9b to
1456908
Compare
Add zstdgpu_ci_tests: a thin GTest wrapper that shells out to zstdgpu_demo.exe for correctness and performance validation of GPU Zstd decompression. Tests are parameterized over .zst content files discovered at runtime via --content-path. Test cases: - SimulationCheck (--chk-gpu --chk-cpu --sim-gpu) - D3D12DebugLayer (--d3d-dbg) - ExternalMemory (--ext-mem) - GraphicsQueue (--d3d-gfx) - OverallThroughput (--prf-lvl 0) - PerStageTiming (--prf-lvl 2) Also adds scripts/generate_histogram.py for converting performance CSV output into histogram PNGs suitable for CI reporting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ames Content-path validation warnings when --content-path is empty, missing, non-directory, or contains no .zst files (avoids user confusion with silent 'zero tests' gtest output). Test name sanitization now uses path relative to --content-path instead of just filename stem, so same-leaf-name files across different subdirectories (e.g. firefly_albedo.DDS.zst under BC1/, BC1mip0/, block4K_*, etc.) don't collide and trigger a fatal gtest assertion at startup. Extracted from the original commit '9266056e/aefb212b' which also included demo-side exit-code mechanism (dropped in favor of ATG's upcoming upstream PR).
…icro) Six groups of fixes to the CI test infrastructure: A. Validate all required inputs in main() with hard exit codes instead of silently skipping tests. Also use the non-throwing overload of std::filesystem::recursive_directory_iterator so a single unreadable subdirectory logs a warning and continues instead of aborting the entire process before any test runs. B. Cache the discovered .zst file list on TestConfig in main(); reuse in GetTestFiles(). Avoids walking the content tree twice. C. Remove result.stdOut from ASSERT_EQ / EXPECT_EQ failure messages - it was already printed unconditionally as the [DEMO OUT] block above, which caused each failing test's stdout to appear twice in the log. D. Remove GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ZstdGpuDemoTests). Group A now hard-fails if the content path has zero .zst files, so empty instantiation can no longer happen at test time. Keeping the macro would let a mis-typed --content-path silently pass green with zero coverage. E. Call CancelIoEx(hReadPipe, nullptr) after TerminateProcess on the timeout path so any pending ReadFile in the drain thread returns and readerThread.join() cannot hang the test runner indefinitely. Trust that CancelIoEx alone unblocks the reader; no bounded-wait fallback. F. Replace placeholder GUID {A1B2C3D4-...} in zstd.sln with a real one: {17F60A53-4A7F-4107-AF0A-914497018D67}. G. Nits: drop the "Spec implies a global" and "Spec inlines the args" comments in the header, and the stray blank line. Regression tested locally on RTX 2080 against a 20-file fuzz subset with --run-count 5 (all 6 scenarios per file): Flavor Before wall After wall Pass/fail counts ------------- ----------- ---------- ---------------- r1+fflush 223.6s 225.5s unchanged (58/125) vanilla+fflush 543.1s 528.2s unchanged (58/125) Wall time within run-to-run noise (+/-0.8%). Marker-count reductions ([FAIL] -50%, [INFO] -14.5%) are the expected consequence of Group C removing the duplicate stdout print on failure - same content, half the log lines when tests fail.
ee9e029 to
7a5d8f2
Compare
added 2 commits
July 7, 2026 18:24
…omparison failure
Per DirectStorage team spec (2026-07-07): GBV validation is expensive and
most tests pass reference comparison without needing any GBV diagnostic.
Skip the GBV cost for passing tests and only re-run with --d3d-dbg when
the reference comparison actually fails.
Behavior:
Phase 1: spawn zstdgpu_demo.exe with just [--chk-gpu] (reference
comparison only, no --d3d-dbg).
If phase 1 exits 0 -> test passes, done. GBV cost skipped.
If phase 1 fails -> spawn again with [--chk-gpu, --d3d-dbg] and
append the GBV output to the same log block
under a "--- PHASE 2 (--d3d-dbg diagnostic
re-run) ---" marker.
The gtest pass/fail verdict is based on phase 1's exit code only; the
second run is diagnostic. Preserves the "one log block per gtest case"
contract so downstream log consumers don't need to know about the
two-phase flow.
Escape hatch: --force-gbv on the wrapper CLI bypasses the gate and runs
every D3D12DebugLayer test with --d3d-dbg up front (matches pre-gating
behavior). Useful for stress runs when you want unconditional GBV output
on all tests, not just failing ones.
Metrics: file-scope counter prints
[D3D12DebugLayer] N of M test(s) re-ran with --d3d-dbg for GBV diagnostics.
at program exit, so operators can eyeball whether the gate is doing
meaningful work. Suppressed in --force-gbv mode.
Expected wall-time savings on the D3D12DebugLayer scenario: ~30% (skips
GBV overhead on the ~65% of tests that pass reference comparison).
Overall wrapper savings: ~5-6% (D3D12DebugLayer is 1 of 6 scenarios).
Bigger win is diagnostic clarity: GBV output only appears for genuinely
failing tests instead of being buried in every passing test's log.
Zero demo changes. Zero YAML changes. Wrapper-only. Fits ATG's "no demo
touches from us" constraint since --d3d-dbg is a demo flag they already
own.
Files:
zstd/zstdgpu_ci_tests/zstdgpu_ci_tests.h +1 (forceGbv TestConfig field)
zstd/zstdgpu_ci_tests/main.cpp +7 (--force-gbv arg + usage)
zstd/zstdgpu_ci_tests/zstdgpu_ci_tests.cpp +~95 (helpers + counters + gated body)
Verified locally on RTX 2080 (2 fuzz files, D3D12DebugLayer scenario
only): gated mode fires phase 2 on both failing files with clean log
markers + counter output; --force-gbv mode bypasses gate cleanly and
suppresses the summary line.
…erence-comparison failure" This reverts commit a3b1cb5.
chmann-micro
approved these changes
Jul 9, 2026
pm4rtx
requested changes
Jul 9, 2026
6d54ad2 to
d93ec9f
Compare
…ified Split the CSV-open path in two so automated callers and interactive users get what they each expect: - When --out-csv <path> is passed explicitly (csvFilePathStorage != NULL), open exactly that path. Automated callers can then verify the CSV exists at the requested location. - When --out-csv is not passed, keep the auto-naming behavior (append the .zst stem and a timestamp to the default "perf.csv") so repeated interactive runs don't clobber each other.
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.
Adds a thin GTest wrapper (
zstdgpu_ci_tests) that shells out tozstdgpu_demo.exeto validate Zstd GPU decompression shaders in CI. Also adds pipeline YAML and a histogram generation script for perf results.What's here
zstd/zstdgpu_ci_tests/— GTest parameterized test fileszstd/scripts/generate_histogram.py— Generates histogram PNGs from perf CSV output. This can probably be improvedTesting
Testing was executed both on local GPUs (dev box and lab machines) and with the full YAML pipeline