feat(tools): add standalone Rust synthetic benchmark suite #322

Open
github-bot wants to merge 73 commits from github-bot/gh-322 into main AGit
Owner

@⁠tommiehansen on GitHub · 2026-12-03 13:55 UTC · original
tommiehansen:tools/benchmark-suite → main · +20782 −104 · 68 files · 73 commits · open

Optional Vulkan and Nextgen integration

Upstream integration alternative #568 combines this scoped foundation with the reviewed fork #6–13 and scoped policy compatibility. It preserves this PR as the smaller first-merge option. Do not merge overlapping versions blindly.

Validation at fork source cf40ea3 Result
Hosted benchmark/policy jobs 7/7 passed
Nextgen subgroup and bindless execution Both passed (software Vulkan)
Production DXIL → SPIR-V → execution 4/4 raw arms exact
Wrong-oracle negative control Rejected
Separate #467 exact shader audit 8/8 arms exact
Physical AMD performance, complete mesh/HWRT execution Not established

Nextgen · Production Vulkan · Standard CPU audit across 14 PRs (13 jobs completed successfully, #467 failed byte equivalence; unsupported workloads are not evidence of correctness).

These are results of the fork implementation, not a new verification claim for this head. The integration alternative has its own CI.


What this does

Add standalone Rust synthetic benchmark suite.

Checks

  • N/A: standalone opt-in development tool; not intended to change normal gameplay. Production adapters still need default-path/build parity.
  • N/A: no new gameplay switch; benchmark CLI and usage documented.
  • No unrelated cleanup: Removed root agent guidance to archive branch; benchmark harness, workloads, CI and supporting adapters remain one tool subject. Review policy changes with maintainer.
  • A test must exercise the change: Historical CI and independent results below; 31 Rust tests reported on 5bd5534. New scope-only head requires CI and explicit policy rerun.
  • Queue checked on 2026-12-04: #502 covers agent guidance separately; #361 covers settings benchmarking; fork #6–9 are follow-ups, not prerequisites.
  • Run cargo xtask policy on the final revision; no new game assets or build output intended.

Verified

Current review head: cde5334d1976e57824369d0a852ccf24c9360ede. Existing measurements and commands are retained below at their original revisions. No fresh compile, policy or hardware test is claimed by this metadata review.

Cost

Build/test time, optional benchmark artifacts and dependencies; no intended frame-time cost.


Detailed implementation and historical validation

Benchmark Suite — test optimizations before launching the game

A standalone Rust benchmark suite for VIctory-xmem and compatible forks. It makes performance experiments repeatable and measurable without game files, proprietary game assets, recorded gameplay or a dedicated GPU for CPU workloads.

The goal is to shorten the development cycle: measure a change, refine it, measure again, and reserve expensive in-game testing for promising candidates. This is particularly useful for contributors and AI coding agents that cannot continuously launch and benchmark the game.

Quick start

# Run a quick CPU-only benchmark
./tools/benchmark-suite/run --quick --cpu-only

# Compare a pull request against its merge base
./tools/benchmark-suite/run --pr 305 --cpu-only

# Compare two revisions
./tools/benchmark-suite/run compare main HEAD --cpu-only

# Compare compatible forks
./tools/benchmark-suite/run compare-forks /path/to/fork-a /path/to/fork-b

# Discover available workloads and capabilities
./tools/benchmark-suite/run capabilities

PR mode resolves the exact GitHub revisions, selects relevant benchmark suites, builds isolated snapshots, detects known opt-in switches and runs interleaved baseline/candidate measurements. Explicit switches and suite selection are also supported.

Example results

The following examples summarize actual CPU-only runs on macOS ARM64, not projected gameplay FPS. They illustrate three different ways to evaluate an optimization: measured execution cost, generated code complexity and avoided work.

Example 1 — Shader translation and emitted code

Guest-load clustering (#305), baseline 842767a8e4a5 → candidate 44f5b82d2dff.

./tools/benchmark-suite/run --pr 305 --cpu-only --suite shaders
Metric Baseline Candidate Change
CPU translation time (paired estimate) 100% 80.69% −19.31%
Emitted DXIL instructions 510 180 −64.71%
Directory loads 15 3 −80.00%
Guest raw buffer loads 15 6 −60.00%
Heap handles 18 6 −66.67%
DXIL size (bytes) 10,868 8,756 −19.44%

Condensed example report (formatted for this description, using recorded results):

Workload       shaders/guest_load_clusters
Timing         -19.31% CPU translation time
95% CI         [-20.01%, -18.60%]
MDE (80%)      1.10%
Replication    4 A/B/B/A blocks
Activation     Verified: 4 eligible, 5 rejected fixtures
Fallback       Byte-identical rejected cases
Correctness    Structurally valid DXIL; GPU semantics unverified
Coverage       Partial

The timing is a paired estimate from the Standard profile. Instruction counts describe emitted code, not dynamically executed GPU instructions. The runtime shader-cache path and GPU execution are not covered by this example.

Example 2 — Avoided work in resource management

Synthetic workload Baseline Candidate Observed reduction
Texture refresh requests proceeding past the precheck (#248) 4,096 2,048 50.0%
Texture queue slots inspected (#313) 28,672 13,998 51.2%

These are operation counts from pinned historical revisions. The refresh fixture exercises the production GPU-written tracker and staging precheck; the queue fixture exercises the scan/order and cursor/budget functions across seven measured passes. Both have partial coverage. Neither measures the GPU time saved, actual present intervals or end-to-end rendering performance.

Example 3 — An inconclusive result is still useful

Uniform guest-load handles (#302):

Metric Baseline Candidate
Uniform handles 1 3
Nonuniform handles 2 0

CPU translation time was estimated at −1.39%, with a 95% confidence interval of −3.06% to +0.31%. The suite correctly reports the timing as inconclusive while providing evidence that the emitted-code optimization was activated. Rejected fixtures remain byte-identical; semantic GPU parity is unverified.

What it can measure

Area Workloads and evidence
Shader compiler Production translation, DXIL structure, resource/handle selection, instruction counts, qualifying and rejected cases
Textures Layout calculations at 4,096–50,000 descriptors, bit-exact tile/detile, bake candidate selection, indexed streaming and staging policies
Residency and memory Migration planning, access ranking, adaptive planning budgets, submission front plans, memory throughput, pointer chasing and pipeline cache
Descriptors Resource tracking, incremental span indexing and full-fold reference checks
Ray tracing Synthetic RDNA2 BVH construction and traversal, reference triangle hit checks, optional hardware node probe, freed-index invalidation layouts, and immutable BLAS remap snapshot caching
Synchronization and mapping Worker/fence contention, write-watch interval ranges and clean-bitmap checks, standalone C patch models for RADV patches/mesa.patch (partial / cpu_patch_model_only), and Windows D3D12.X / XTaskQueue primitives
Synthetic frames Repeated multi-subsystem CPU workloads, frame-time distributions and explicitly labelled FPS equivalents
GPU memory probe Revision-bound D3D12 dispatch timestamps and reference output checks on Windows hardware, WARP, Wine/Proton, or Lavapipe

Availability depends on the revision, adapter and host. Unsupported workloads are identified explicitly rather than simulated as successful production execution.

Reliable comparisons, not just numbers

  • Production fidelity: use real implementation code, including auditable extraction from historical snapshots where supported.
  • Comparable workloads: fixed seeds, fixture identities, operation counts and execution-stage plans. Reject incompatible comparisons and suppress misleading aggregate frame deltas.
  • Correctness first: ordered output hashes, independent references, fallback checks and explicit distinction between structural validity and semantic equivalence.
  • Verified activation and coverage: identify exercised changed functions where evidence exists; report inferred, partial and missing coverage separately.
  • Statistical confidence: paired A/B/B/A blocks, 95% confidence intervals, approximate minimum detectable effect, drift and outlier diagnostics. Use --quick for smoke/correctness validation (higher run-to-run variance) and --profile standard (4 A/B/B/A blocks) or higher for timing conclusions.
  • Fast iteration: content-addressed CPU snapshots, Cargo build reuse, offline replay, targeted suites, time limits and persistent checkpoints for completed runs.
  • Automation: optional correctness, regression, verified-coverage and GPU gates with distinct exit codes.

Reports and AI-assisted development

Each run produces artifacts suitable for both humans and automated analysis:

Output Purpose
summary.md GitHub-ready benchmark tables
results.json Versioned metrics, configuration, correctness, coverage and confidence
frametimes.csv Raw synthetic frame samples
analysis.md Results, stability, regressions and limitations
report.html Standalone visual report
checkpoints/ Completed comparison rounds retained during failures or interruptions

The intended development workflow is:

  1. Establish a deterministic baseline.
  2. Implement a change and run targeted benchmarks.
  3. Inspect the results, correctness and coverage; refine and repeat.
  4. Validate promising changes on supported GPU hardware.
  5. Confirm real FPS, frame times and visual quality in-game.

Project guidance in AGENTS.md, CLAUDE.md and GEMINI.md helps coding agents discover and use the suite during development.

A shared standard across forks

The benchmark protocol, workload definitions and measurement methodology are separated from fork-specific adapters. Compatible forks can implement BenchmarkAdapter against their own production code and compare results when the shared workload contract, toolchain, target and execution evidence match.

The long-term goal is to make optimizations easier to reproduce, compare and combine across the ecosystem. Standardized reports could also support future integration with PortWatch. Other fork adapters and PortWatch integration are not included in this PR.

Validation, CI, and current limitations

  • Upstream Actions (at 0669618): Workflow run 47220897854 passed both CPU Benchmark Smoke & Policy (3m30s: xtask -- switches, unit/correctness/smoke tests, release sensitivity, quick CPU smoke) and Windows Native Benchmark Smoke (19m16s: MSVC check/lint/tests, release smoke, --repo-root . compare HEAD HEAD, hardware & WARP capability probes, build-gpu.ps1).
  • Independent Windows 11 / MSVC + GPU validation (Kal0s-design at 4495c7b): 31 passing CPU workloads across two runs with identical correctness digests and 14 GPU workloads marked Unsupported in --cpu-only mode; 8/8 passing timestamped memory workloads across two runs on a physical NVIDIA GPU; verified process-tree deadline termination and PowerShell GPU probe builds. Follow-ups ab96332 (explicit Windows root paths without verbatim prefix + build-gpu.ps1 message), e3c74d3 (compact Windows snapshot keys for MASM), 0669618 (40-minute Windows job timeout), and 2ef6806 (atomic-PID timeout-test synchronization, redundant cargo check removal, README/PROGRESS alignment) resolved the remaining --repo-root . comparison and CI timeout issues.
  • RT invalidation layout coverage (at 3efbed0): Added rt_freed_index_phased_churn and rt_freed_index_iteration (using production AddressMap::visit when present) in src/suites/rt_freed_bench.rs and build.rs, recorded paired Standard and Full results for #429 (bb184d8) in PROGRESS.md, and verified cargo test --offline -p victory-benchmark-suite (20 unit, 9 correctness, 1 sensitivity, and 1 CPU smoke test passed).
  • RT remap snapshot reuse coverage (at 2e57371): Added 6 production-path workloads (rt_remap_unchanged, rt_remap_sparse_changes, rt_remap_streaming_invalidations, rt_remap_sustained_streaming, rt_remap_growth_shrinkage, rt_remap_overlapping_submissions) in src/suites/rt_remap_bench.rs validating BTreeMap live/removed/replaced key oracles, delayed indirect-arg reads, OOM preservation, and explicit modeled GPU proxy counters (modeled_gpu_patch_dispatches, modeled_gpu_extra_barriers); recorded Standard and Full opt-in (VICTORY_HW_RT_REMAP_SNAPSHOTS=1 vs =0) results on c49b6c8 in PROGRESS.md, and verified cargo test --offline -p victory-benchmark-suite --lib --test correctness --test smoke (20 unit, 9 correctness, 1 CPU smoke passed).
  • Current limitations: Coverage is not exhaustive: whole-shader GPU execution, live RADV page migration and aliasing, texture uploads, and GPU barrier timing remain unsupported on this harness. Mesa patches/mesa.patch benchmarks (mapping/radv_shown_cursor_model, mapping/radv_dirty_range_sort_model) are standalone CPU patch models explicitly classified partial (cpu_patch_model_only), not live RADV driver runs. Cross-OS timing and RSS numbers are not directly comparable because Windows links victory-gpu's 8 GiB virtual arena reservation.

Synthetic results are evidence for choosing and refining optimizations, not substitutes for actual gameplay benchmarks. No FPS improvement is claimed from instruction counts, avoided work or CPU translation timings alone.

Documentation

Native Windows quick start

cargo run --locked --release -p victory-benchmark-suite -- --repo-root . --quick --cpu-only --out local/benchmarks/windows-cpu
cargo run --locked --release -p victory-benchmark-suite -- --repo-root . compare main HEAD --cpu-only --time-limit 600
.\tools\benchmark-suite\build-gpu.ps1
cargo run --locked --release -p victory-benchmark-suite -- --repo-root . --suite memory --quick --require-gpu

Scope and follow-up stack — 2026-12-05

The current PR contains 68 changed files (not the earlier 110-file diff). Unrelated dead-code/config cleanup and root agent guidance are not part of this diff. The remaining production adapters and feature-gated hooks serve the benchmark harness. The benchmark integration stack is staged in fork #6–13; the current endpoint is #13. This foundation remains separately reviewable. The portable Vulkan source-policy allowance is upstream #539; the launcher switch checker is #528. Reconcile the stack against the landed foundation in dependency order, preserving tested revision pins and not importing unrelated optimizations.

The 2026-12-05 queue refresh intentionally did not rewrite this foundation or its dependent branches; the scope and integration work above are distinct from a new merge-base verification.

Reconciled foundation validation

Current head c5df42b is mergeable. Upstream CI 47554282446 passed Windows Native Benchmark Smoke and CPU Benchmark Smoke & Policy. Self-hosted GPU skipped. The reconciliation preserves current upstream policy and launcher regression coverage.

**@⁠tommiehansen** on GitHub · 2026-12-03 13:55 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322) `tommiehansen:tools/benchmark-suite` → `main` · +20782 −104 · 68 files · 73 commits · open ## Optional Vulkan and Nextgen integration **[Upstream integration alternative #568](https://git.gtahub.st/github/lobomfz--VIctory-xmem/pulls/568)** combines this scoped foundation with the reviewed fork #6–13 and scoped policy compatibility. It preserves this PR as the smaller first-merge option. Do not merge overlapping versions blindly. | Validation at fork source `cf40ea3` | Result | |---|---| | Hosted benchmark/policy jobs | 7/7 passed | | Nextgen subgroup and bindless execution | Both passed (software Vulkan) | | Production DXIL → SPIR-V → execution | 4/4 raw arms exact | | Wrong-oracle negative control | Rejected | | Separate #467 exact shader audit | 8/8 arms exact | | Physical AMD performance, complete mesh/HWRT execution | Not established | [Nextgen](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47503521097) · [Production Vulkan](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47503521093) · [Standard CPU audit across 14 PRs](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47503640056) (13 jobs completed successfully, #467 failed byte equivalence; unsupported workloads are not evidence of correctness). These are results of the fork implementation, not a new verification claim for this head. The integration alternative has its own CI. --- ## What this does Add standalone Rust synthetic benchmark suite. ## Checks - N/A: standalone opt-in development tool; not intended to change normal gameplay. Production adapters still need default-path/build parity. - N/A: no new gameplay switch; benchmark CLI and usage documented. - [ ] No unrelated cleanup: Removed root agent guidance to archive branch; benchmark harness, workloads, CI and supporting adapters remain one tool subject. Review policy changes with maintainer. - [ ] A test must exercise the change: Historical CI and independent results below; 31 Rust tests reported on `5bd5534`. New scope-only head requires CI and explicit policy rerun. - [x] Queue checked on 2026-12-04: #502 covers agent guidance separately; #361 covers settings benchmarking; fork #6–9 are follow-ups, not prerequisites. - [ ] Run `cargo xtask policy` on the final revision; no new game assets or build output intended. ## Verified Current review head: `cde5334d1976e57824369d0a852ccf24c9360ede`. Existing measurements and commands are retained below at their original revisions. No fresh compile, policy or hardware test is claimed by this metadata review. ## Cost Build/test time, optional benchmark artifacts and dependencies; no intended frame-time cost. --- ## Detailed implementation and historical validation ## Benchmark Suite — test optimizations before launching the game A standalone Rust benchmark suite for VIctory-xmem and compatible forks. It makes performance experiments repeatable and measurable **without game files, proprietary game assets, recorded gameplay or a dedicated GPU for CPU workloads**. The goal is to shorten the development cycle: measure a change, refine it, measure again, and reserve expensive in-game testing for promising candidates. This is particularly useful for contributors and AI coding agents that cannot continuously launch and benchmark the game. ## Quick start ```sh # Run a quick CPU-only benchmark ./tools/benchmark-suite/run --quick --cpu-only # Compare a pull request against its merge base ./tools/benchmark-suite/run --pr 305 --cpu-only # Compare two revisions ./tools/benchmark-suite/run compare main HEAD --cpu-only # Compare compatible forks ./tools/benchmark-suite/run compare-forks /path/to/fork-a /path/to/fork-b # Discover available workloads and capabilities ./tools/benchmark-suite/run capabilities ``` PR mode resolves the exact GitHub revisions, selects relevant benchmark suites, builds isolated snapshots, detects known opt-in switches and runs interleaved baseline/candidate measurements. Explicit switches and suite selection are also supported. ## Example results The following examples summarize **actual CPU-only runs on macOS ARM64**, not projected gameplay FPS. They illustrate three different ways to evaluate an optimization: measured execution cost, generated code complexity and avoided work. ### Example 1 — Shader translation and emitted code [Guest-load clustering (#305)](https://git.gtahub.st/github/lobomfz--VIctory-xmem/pulls/305), baseline `842767a8e4a5` → candidate `44f5b82d2dff`. ```sh ./tools/benchmark-suite/run --pr 305 --cpu-only --suite shaders ``` | Metric | Baseline | Candidate | Change | |---|---:|---:|---:| | CPU translation time (paired estimate) | 100% | 80.69% | **−19.31%** | | Emitted DXIL instructions | 510 | 180 | **−64.71%** | | Directory loads | 15 | 3 | **−80.00%** | | Guest raw buffer loads | 15 | 6 | **−60.00%** | | Heap handles | 18 | 6 | **−66.67%** | | DXIL size (bytes) | 10,868 | 8,756 | −19.44% | Condensed example report (formatted for this description, using recorded results): ```text Workload shaders/guest_load_clusters Timing -19.31% CPU translation time 95% CI [-20.01%, -18.60%] MDE (80%) 1.10% Replication 4 A/B/B/A blocks Activation Verified: 4 eligible, 5 rejected fixtures Fallback Byte-identical rejected cases Correctness Structurally valid DXIL; GPU semantics unverified Coverage Partial ``` The timing is a paired estimate from the Standard profile. Instruction counts describe emitted code, not dynamically executed GPU instructions. The runtime shader-cache path and GPU execution are not covered by this example. ### Example 2 — Avoided work in resource management | Synthetic workload | Baseline | Candidate | Observed reduction | |---|---:|---:|---:| | Texture refresh requests proceeding past the precheck ([#248](https://git.gtahub.st/github/lobomfz--VIctory-xmem/pulls/248)) | 4,096 | 2,048 | **50.0%** | | Texture queue slots inspected ([#313](https://git.gtahub.st/github/lobomfz--VIctory-xmem/pulls/313)) | 28,672 | 13,998 | **51.2%** | These are operation counts from pinned historical revisions. The refresh fixture exercises the production GPU-written tracker and staging precheck; the queue fixture exercises the scan/order and cursor/budget functions across seven measured passes. Both have partial coverage. Neither measures the GPU time saved, actual present intervals or end-to-end rendering performance. ### Example 3 — An inconclusive result is still useful [Uniform guest-load handles (#302)](https://git.gtahub.st/github/lobomfz--VIctory-xmem/pulls/302): | Metric | Baseline | Candidate | |---|---:|---:| | Uniform handles | 1 | 3 | | Nonuniform handles | 2 | 0 | CPU translation time was estimated at **−1.39%**, with a 95% confidence interval of **−3.06% to +0.31%**. The suite correctly reports the timing as inconclusive while providing evidence that the emitted-code optimization was activated. Rejected fixtures remain byte-identical; semantic GPU parity is unverified. ## What it can measure | Area | Workloads and evidence | |---|---| | Shader compiler | Production translation, DXIL structure, resource/handle selection, instruction counts, qualifying and rejected cases | | Textures | Layout calculations at 4,096–50,000 descriptors, bit-exact tile/detile, bake candidate selection, indexed streaming and staging policies | | Residency and memory | Migration planning, access ranking, adaptive planning budgets, submission front plans, memory throughput, pointer chasing and pipeline cache | | Descriptors | Resource tracking, incremental span indexing and full-fold reference checks | | Ray tracing | Synthetic RDNA2 BVH construction and traversal, reference triangle hit checks, optional hardware node probe, freed-index invalidation layouts, and immutable BLAS remap snapshot caching | | Synchronization and mapping | Worker/fence contention, write-watch interval ranges and clean-bitmap checks, standalone C patch models for RADV `patches/mesa.patch` (`partial` / `cpu_patch_model_only`), and Windows D3D12.X / `XTaskQueue` primitives | | Synthetic frames | Repeated multi-subsystem CPU workloads, frame-time distributions and explicitly labelled FPS equivalents | | GPU memory probe | Revision-bound D3D12 dispatch timestamps and reference output checks on Windows hardware, WARP, Wine/Proton, or Lavapipe | Availability depends on the revision, adapter and host. Unsupported workloads are identified explicitly rather than simulated as successful production execution. ## Reliable comparisons, not just numbers - **Production fidelity:** use real implementation code, including auditable extraction from historical snapshots where supported. - **Comparable workloads:** fixed seeds, fixture identities, operation counts and execution-stage plans. Reject incompatible comparisons and suppress misleading aggregate frame deltas. - **Correctness first:** ordered output hashes, independent references, fallback checks and explicit distinction between structural validity and semantic equivalence. - **Verified activation and coverage:** identify exercised changed functions where evidence exists; report inferred, partial and missing coverage separately. - **Statistical confidence:** paired A/B/B/A blocks, 95% confidence intervals, approximate minimum detectable effect, drift and outlier diagnostics. Use `--quick` for smoke/correctness validation (higher run-to-run variance) and `--profile standard` (4 A/B/B/A blocks) or higher for timing conclusions. - **Fast iteration:** content-addressed CPU snapshots, Cargo build reuse, offline replay, targeted suites, time limits and persistent checkpoints for completed runs. - **Automation:** optional correctness, regression, verified-coverage and GPU gates with distinct exit codes. ## Reports and AI-assisted development Each run produces artifacts suitable for both humans and automated analysis: | Output | Purpose | |---|---| | `summary.md` | GitHub-ready benchmark tables | | `results.json` | Versioned metrics, configuration, correctness, coverage and confidence | | `frametimes.csv` | Raw synthetic frame samples | | `analysis.md` | Results, stability, regressions and limitations | | `report.html` | Standalone visual report | | `checkpoints/` | Completed comparison rounds retained during failures or interruptions | The intended development workflow is: 1. Establish a deterministic baseline. 2. Implement a change and run targeted benchmarks. 3. Inspect the results, correctness and coverage; refine and repeat. 4. Validate promising changes on supported GPU hardware. 5. Confirm real FPS, frame times and visual quality in-game. Project guidance in `AGENTS.md`, `CLAUDE.md` and `GEMINI.md` helps coding agents discover and use the suite during development. ## A shared standard across forks The benchmark protocol, workload definitions and measurement methodology are separated from fork-specific adapters. Compatible forks can implement `BenchmarkAdapter` against their own production code and compare results when the shared workload contract, toolchain, target and execution evidence match. The long-term goal is to make optimizations easier to reproduce, compare and combine across the ecosystem. Standardized reports could also support future integration with [PortWatch](https://portwatch-vi.xyz/). Other fork adapters and PortWatch integration are not included in this PR. ## Validation, CI, and current limitations - **Upstream Actions (at [`0669618`](https://github.com/tommiehansen/VIctory-xmem/commit/0669618)):** [Workflow run 47220897854](https://github.com/lobomfz/VIctory-xmem/actions/runs/47220897854) passed both `CPU Benchmark Smoke & Policy` (`3m30s`: `xtask -- switches`, unit/correctness/smoke tests, release `sensitivity`, quick CPU smoke) and `Windows Native Benchmark Smoke` (`19m16s`: MSVC check/lint/tests, release smoke, `--repo-root . compare HEAD HEAD`, hardware & WARP capability probes, `build-gpu.ps1`). - **Independent Windows 11 / MSVC + GPU validation ([Kal0s-design](https://git.gtahub.st/github/lobomfz--VIctory-xmem/pulls/322) at `4495c7b`):** 31 passing CPU workloads across two runs with identical correctness digests and 14 GPU workloads marked `Unsupported` in `--cpu-only` mode; 8/8 passing timestamped memory workloads across two runs on a physical NVIDIA GPU; verified process-tree deadline termination and PowerShell GPU probe builds. Follow-ups `ab96332` (explicit Windows root paths without verbatim prefix + `build-gpu.ps1` message), `e3c74d3` (compact Windows snapshot keys for MASM), `0669618` (40-minute Windows job timeout), and `2ef6806` (atomic-PID timeout-test synchronization, redundant `cargo check` removal, README/PROGRESS alignment) resolved the remaining `--repo-root .` comparison and CI timeout issues. - **RT invalidation layout coverage (at [`3efbed0`](https://github.com/tommiehansen/VIctory-xmem/commit/3efbed0)):** Added `rt_freed_index_phased_churn` and `rt_freed_index_iteration` (using production `AddressMap::visit` when present) in `src/suites/rt_freed_bench.rs` and `build.rs`, recorded paired Standard and Full results for #429 (`bb184d8`) in `PROGRESS.md`, and verified `cargo test --offline -p victory-benchmark-suite` (20 unit, 9 correctness, 1 sensitivity, and 1 CPU smoke test passed). - **RT remap snapshot reuse coverage (at [`2e57371`](https://github.com/tommiehansen/VIctory-xmem/commit/2e57371)):** Added 6 production-path workloads (`rt_remap_unchanged`, `rt_remap_sparse_changes`, `rt_remap_streaming_invalidations`, `rt_remap_sustained_streaming`, `rt_remap_growth_shrinkage`, `rt_remap_overlapping_submissions`) in `src/suites/rt_remap_bench.rs` validating `BTreeMap` live/removed/replaced key oracles, delayed indirect-arg reads, OOM preservation, and explicit modeled GPU proxy counters (`modeled_gpu_patch_dispatches`, `modeled_gpu_extra_barriers`); recorded Standard and Full opt-in (`VICTORY_HW_RT_REMAP_SNAPSHOTS=1` vs `=0`) results on `c49b6c8` in `PROGRESS.md`, and verified `cargo test --offline -p victory-benchmark-suite --lib --test correctness --test smoke` (20 unit, 9 correctness, 1 CPU smoke passed). - **Current limitations:** Coverage is not exhaustive: whole-shader GPU execution, live RADV page migration and aliasing, texture uploads, and GPU barrier timing remain unsupported on this harness. Mesa `patches/mesa.patch` benchmarks (`mapping/radv_shown_cursor_model`, `mapping/radv_dirty_range_sort_model`) are standalone CPU patch models explicitly classified `partial` (`cpu_patch_model_only`), not live RADV driver runs. Cross-OS timing and RSS numbers are not directly comparable because Windows links `victory-gpu`'s 8 GiB virtual arena reservation. **Synthetic results are evidence for choosing and refining optimizations, not substitutes for actual gameplay benchmarks.** No FPS improvement is claimed from instruction counts, avoided work or CPU translation timings alone. ## Documentation - [Usage, methodology, reports and GPU setup](https://github.com/tommiehansen/VIctory-xmem/blob/tools/benchmark-suite/tools/benchmark-suite/README.md) - [Detailed validation matrix, historical results and remaining work](https://github.com/tommiehansen/VIctory-xmem/blob/tools/benchmark-suite/tools/benchmark-suite/PROGRESS.md) ## Native Windows quick start ```powershell cargo run --locked --release -p victory-benchmark-suite -- --repo-root . --quick --cpu-only --out local/benchmarks/windows-cpu cargo run --locked --release -p victory-benchmark-suite -- --repo-root . compare main HEAD --cpu-only --time-limit 600 .\tools\benchmark-suite\build-gpu.ps1 cargo run --locked --release -p victory-benchmark-suite -- --repo-root . --suite memory --quick --require-gpu ``` ### Scope and follow-up stack — 2026-12-05 The current PR contains 68 changed files (not the earlier 110-file diff). Unrelated dead-code/config cleanup and root agent guidance are not part of this diff. The remaining production adapters and feature-gated hooks serve the benchmark harness. The benchmark integration stack is staged in [fork #6–13](https://github.com/tommiehansen/VIctory-xmem/pulls); the current endpoint is [#13](https://github.com/tommiehansen/VIctory-xmem/pull/13). This foundation remains separately reviewable. The portable Vulkan source-policy allowance is upstream #539; the launcher switch checker is #528. Reconcile the stack against the landed foundation in dependency order, preserving tested revision pins and not importing unrelated optimizations. The 2026-12-05 queue refresh intentionally did not rewrite this foundation or its dependent branches; the scope and integration work above are distinct from a new merge-base verification. ### Reconciled foundation validation Current head `c5df42b` is mergeable. [Upstream CI 47554282446](https://github.com/lobomfz/VIctory-xmem/actions/runs/47554282446) passed Windows Native Benchmark Smoke and CPU Benchmark Smoke & Policy. Self-hosted GPU skipped. The reconciliation preserves current upstream policy and launcher regression coverage.
Add tools/benchmark-suite with deterministic CPU workloads, production crate adapters (xmem), isolated git worktree/archive revision comparison, Welch t-test statistical classification, HTML/CSV/Markdown/JSON reports, CI smoke workflow, and AGENTS.md/CLAUDE.md/GEMINI.md instructions.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 13:56:16 +00:00
Match GitHub PR metadata against the fetched base and head and retain a repository-scoped cache for explicit offline runs. Build both revisions with the same harness, strip ambient game feature overrides, and report actionable exit statuses for automation.
Keep run medians and aggregate secondary metrics across runs. Treat each complete ABBA block as one replicate, publish confidence intervals and estimated sensitivity, and refuse inference from incompatible or unreplicated measurements. Exercise the statistics with controlled changes in production tile and detile work.
Move the renderer’s bake candidate selection and texture prefetch cap into a Rust module shared with the benchmark. Check output against deterministic references and scale layout production calls to 4,096–50,000 descriptors. Mark historical revisions without the portable implementation unsupported.
Build the existing rtbench separately, verify its source revision and live DXGI adapter, and report queue timestamps only after checking shader output against a CPU reference. Provide explicit Lavapipe and WARP modes with their own workload size, enforce timeout and completeness checks, and expose an optional GPU CI run.
Share the residency worker’s weighted page selection, bounded coalescing and adaptive budget logic with a portable CPU workload. Validate the selected pages, run structure and budget thresholds while leaving live driver migration outside this test.
Fetch the exact GitHub object IDs when a PR points behind the current branch tips and freeze a single harness before materializing either checkout. Exercise machine-readable failure statuses and document the eight-PR matrix, including successful offline replay and explicit gaps in host coverage.
Compile the residency planning items directly from each historical snapshot, adjusting visibility only. Benchmark capped and all-candidates-fit migration plans with independent page and run validation.
Record explicit stages, fixture hashes and operation counts and reject mismatches before displaying aggregate timing. Hash ordered outputs and verify the actual emitted DXIL outside timed loops. Distinguish the portable worker fallback from production D3D12.X synchronization.
Associate diff ranges with changed Rust functions, keep file mappings explicitly inferred, and gate all runtime changes on verified function execution. Require matching rejected cases and optimization-specific signatures before reporting shader activation.
Compile the original range and collector bodies directly from each snapshot. Compare ordered candidate results across sparse and overflowing fixtures and validate the completeness marker on revisions that emit it.
Publish independent fingerprints and a JSON capability manifest. Permit compatible fork adapters with matching workload and output contracts, retain toolchain and production provenance, and reject incompatible workload definitions.
Use changed paths to select suites unless the caller overrides them. Skip historical builds for documentation-only PRs. Publish source snapshots atomically under a revision and harness content key so Cargo can reuse compatible builds on subsequent runs.
Apply an optional deadline to compilation and measurement processes. Write each completed round atomically into a persistent attempt directory and retain it if a later round fails. Test subprocess termination and checkpoint recovery.
Run the original GPU-written mask and staging precheck code with deterministic prior-list and boundary fixtures. Replay residency ranking against each revision’s real weight and migration functions, and validate the selected priority set and exact output digests.
Compare the production descriptor fold and index and exercise the historical queue selectors under deterministic pressure. Verify policy variants against independent references, batch short queue samples, and prevent unnecessary Cargo rebuilds when optional sources are absent.
Keep upstream's expanded RT diagnostic intact and isolate the revision-bound Benchmark Suite probe in its own test module. Report the newly indexed upstream texture queue as unsupported by the historical adapter until its required state is available.
Keep upstream draw.rs intact, including #310's overflow handling and preparation decisions. Prefer the existing historical bake extractor when the tested revision exposes those functions in draw.rs, while retaining the portable prefetch policy and fallback for older benchmark snapshots. No changes to unrelated branches.
Preserve the latest upstream residency fast paths in the portable planner, direct pool indexing and migration cadence, shader cache version and regression coverage.
Keep the Rust switch check and also recognize whole shell parameter names. Add regression coverage for defaults, exact names, escaped expansions and comments. Integrate the latest upstream cleanup of local symlinks.
Record the paired translation timing and DXIL counts for shifted and wide scalar loads with both guest-load switches held constant. Distinguish structural checks from GPU equivalence.
Preserve the measured trace overhead and the telemetry-fallback validation without inferring migration or frame-time benefits.
Correct the refresh length and miss handling, record each list once, and time four wide submissions with a partial cache miss. Check the folded output against upstream’s two-stage span semantics and report the matched cache-toggle result.
Interpret run differences as promotions and deferrals, retain the original selection in shadow mode, and hash complete run identities. Separate the measured ranking cost from migration outcomes and credit the existing outcome-tracking contribution.
Resolve stream policy modules relative to the selected production snapshot, adapt the ready index and count only due entries visited by upstream’s indexed scan. Validate membership, stamps and admission on both sides.
Keep the earlier interval timings separate from the independent native Windows correctness tests and identify the remaining Wine and hardware validation.
Record matched patch-model activation, lookup counts and interval digests for #217, and distinguish the standalone validation from a Mesa build or hardware test.
Record matched output with fewer synthetic sorts, the context for the separate C model, and the hunk offset adjustments required when #217 and #222 land together.
Compile the native benchmark adapter without importing the private victory-gpu This alias. Preserve the same pointer representation and keep the internal API private.
Remove the Windows-only needless return in the platform-specific GPU detection branch that native Clippy reported.
Compile and lint the MSVC-only adapter, run native correctness and smoke tests, then execute the release CPU-only runner directly and publish its result artifacts.
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-03 21:19 UTC · original

Gave this a try on native Windows 11 with MSVC (no Wine), head 2f34efa, offline and --locked. The three commits pushed since (up to 023d9f3) only touch docs and the texture queue fixtures, and the import below is unchanged there.

It doesn't build on Windows as submitted. cargo build --release -p victory-benchmark-suite fails with E0603 because tools/benchmark-suite/src/adapters/xmem.rs:52 imports victory_gpu::object::This, which is pub(crate) in crates/victory-gpu/src/object.rs:67 on main and at the merge base. The whole cfg(windows) win_runtime block (xmem.rs:44) sits behind that. CI only runs on ubuntu-latest (benchmark-smoke.yml:23) and victory-gpu/victory-hle are Windows-only deps of the bench, so CI never compiles this path, and the descriptors/d3d12x_heap_and_copy and sync/xasync_and_d3d12x_fence workloads haven't been built for a Windows target yet. Making This pub, or a local type This = *const victory_gpu::object::Object; in win_runtime, fixes it.

With that one-line workaround applied locally the release binary builds and cargo test -p victory-benchmark-suite --no-run builds all five test binaries. No new crates were needed. cargo check -p victory-gpu --tests (covers host/benchmark_rtbench.rs) is clean. Clippy shows one new warning in the bench crate, a needless return at tools/benchmark-suite/src/env.rs:76, and it only shows up on Windows. cargo test -p xtask -- switches passes on Windows, the new shell expansion test included. The full xtask run still fails repository_passes_policy, but only on files this PR doesn't touch, and the new run script passes the policy.

I didn't run the benchmarks themselves, so no timings or repeatability numbers from me. Besides the build error, one thing worth knowing for comparisons is that on Windows the bench links victory-gpu and so picks up its global allocator (port_heap.rs:182), which reserves an 8 GiB address range on the first allocation (port_heap.rs:12 and :54). That's existing victory-gpu behaviour and not something this PR changes, but it means Windows runs use a different allocator than the macOS numbers in the description, and even --list reserves that range. Probably worth a line in the README.

A few smaller Windows things. env.rs:74-84 reports the GPU as available with native D3D12 on Windows without probing anything, which doesn't quite match "no fabricated GPU results". The process group and /bin/kill in compare.rs:497 and :506 are unix only, so on Windows --time-limit only kills cargo and its children can keep running. run is a POSIX sh script, fine from Git Bash but not from cmd or PowerShell, and build-gpu.sh also needs jq, which a stock Windows setup won't have.

Happy to rerun the quick CPU mode once the Windows build is fixed.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-03 21:19 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322#issuecomment-7392607705) Gave this a try on native Windows 11 with MSVC (no Wine), head 2f34efa, offline and --locked. The three commits pushed since (up to 023d9f3) only touch docs and the texture queue fixtures, and the import below is unchanged there. It doesn't build on Windows as submitted. `cargo build --release -p victory-benchmark-suite` fails with E0603 because tools/benchmark-suite/src/adapters/xmem.rs:52 imports `victory_gpu::object::This`, which is `pub(crate)` in crates/victory-gpu/src/object.rs:67 on main and at the merge base. The whole `cfg(windows)` win_runtime block (xmem.rs:44) sits behind that. CI only runs on ubuntu-latest (benchmark-smoke.yml:23) and victory-gpu/victory-hle are Windows-only deps of the bench, so CI never compiles this path, and the descriptors/d3d12x_heap_and_copy and sync/xasync_and_d3d12x_fence workloads haven't been built for a Windows target yet. Making `This` pub, or a local `type This = *const victory_gpu::object::Object;` in win_runtime, fixes it. With that one-line workaround applied locally the release binary builds and `cargo test -p victory-benchmark-suite --no-run` builds all five test binaries. No new crates were needed. `cargo check -p victory-gpu --tests` (covers host/benchmark_rtbench.rs) is clean. Clippy shows one new warning in the bench crate, a needless return at tools/benchmark-suite/src/env.rs:76, and it only shows up on Windows. `cargo test -p xtask -- switches` passes on Windows, the new shell expansion test included. The full xtask run still fails repository_passes_policy, but only on files this PR doesn't touch, and the new `run` script passes the policy. I didn't run the benchmarks themselves, so no timings or repeatability numbers from me. Besides the build error, one thing worth knowing for comparisons is that on Windows the bench links victory-gpu and so picks up its global allocator (port_heap.rs:182), which reserves an 8 GiB address range on the first allocation (port_heap.rs:12 and :54). That's existing victory-gpu behaviour and not something this PR changes, but it means Windows runs use a different allocator than the macOS numbers in the description, and even `--list` reserves that range. Probably worth a line in the README. A few smaller Windows things. env.rs:74-84 reports the GPU as available with native D3D12 on Windows without probing anything, which doesn't quite match "no fabricated GPU results". The process group and `/bin/kill` in compare.rs:497 and :506 are unix only, so on Windows `--time-limit` only kills cargo and its children can keep running. `run` is a POSIX sh script, fine from Git Bash but not from cmd or PowerShell, and build-gpu.sh also needs jq, which a stock Windows setup won't have. Happy to rerun the quick CPU mode once the Windows build is fixed. AI-assisted: yes
Create and release a device for the selected hardware adapter or WARP, verify the adapter class, and report the device name or capability failure. CPU-only runs still bypass device creation.
Start bounded Windows commands suspended, assign them to a kill-on-close Job Object, and resume the initial thread only after containment. Exercise timeout cleanup with a native grandchild test.
Use native PowerShell JSON parsing to identify the Cargo test executable without Git Bash or jq. Exercise the builder and capture hardware and software capability reports in Windows CI.
Show direct Cargo and PowerShell commands, explain the virtual arena reservation separately from resident memory, and record the independent Windows review fixes and their validation status.
The hosted Windows smoke runner hit an access violation because recording a non-null SRV inspects the resource object. Exercise the supported null-resource path and add a focused native descriptor regression test while retaining CBV, sampler and copy coverage.
Link the native Actions run and record smoke workload counts, timeout cleanup, the descriptor fixture fix, and the reported hardware and WARP capabilities.
Author
Owner

@⁠tommiehansen on GitHub · 2026-12-03 21:44 UTC · original

@⁠Kal0s-design Thanks for running this on native Windows and tracing the visibility issue to This. I addressed the findings in your report:

  • The COM alias stays local and native Clippy is clean. Windows Actions now build, lint and run the suite. Alias · Clippy · CI
  • Windows now probes the selected D3D12 device. Bounded subprocesses start inside a Job Object, and the native test verifies that the timeout kills the grandchild. GPU detection · Timeouts
  • The new PowerShell builder reads Cargo JSON directly. The README documents the virtual 8 GiB reservation and native commands. The first Windows smoke run also caught an invalid synthetic SRV resource pointer, which now uses the supported null-resource path. PowerShell · Allocator notes · SRV fixture

Native Windows Actions passed. The release run passed 31 CPU workloads, including the native descriptor and XTaskQueue/fence workloads. Its capability output verified WARP device creation and reported hardware mode unavailable on the hosted runner. The PowerShell builder also passed. GPU performance was outside that validation.

From the repository root in PowerShell:

cargo test --locked -p victory-benchmark-suite --lib --test correctness --test smoke
cargo run --locked --release -p victory-benchmark-suite -- --repo-root . --quick --cpu-only --out local/benchmarks/windows-cpu
cargo run --locked --release -p victory-benchmark-suite -- --repo-root . compare main HEAD --cpu-only --time-limit 600

For the optional native GPU probe build, run .\tools\benchmark-suite\build-gpu.ps1. I’d welcome your independent CPU rerun on Windows 11.

**@⁠tommiehansen** on GitHub · 2026-12-03 21:44 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322#issuecomment-7393233796) @⁠Kal0s-design Thanks for running this on native Windows and tracing the visibility issue to `This`. I addressed the findings in [your report](https://git.gtahub.st/github/lobomfz--VIctory-xmem/pulls/322): - The COM alias stays local and native Clippy is clean. Windows Actions now build, lint and run the suite. [Alias](https://github.com/tommiehansen/VIctory-xmem/commit/eebe810) · [Clippy](https://github.com/tommiehansen/VIctory-xmem/commit/03201e9) · [CI](https://github.com/tommiehansen/VIctory-xmem/commit/ccd03bf) - Windows now probes the selected D3D12 device. Bounded subprocesses start inside a Job Object, and the native test verifies that the timeout kills the grandchild. [GPU detection](https://github.com/tommiehansen/VIctory-xmem/commit/d588cdb) · [Timeouts](https://github.com/tommiehansen/VIctory-xmem/commit/af7f67c) - The new PowerShell builder reads Cargo JSON directly. The README documents the virtual 8 GiB reservation and native commands. The first Windows smoke run also caught an invalid synthetic SRV resource pointer, which now uses the supported null-resource path. [PowerShell](https://github.com/tommiehansen/VIctory-xmem/commit/0d992f3) · [Allocator notes](https://github.com/tommiehansen/VIctory-xmem/commit/c8e20e7) · [SRV fixture](https://github.com/tommiehansen/VIctory-xmem/commit/4495c7b) [Native Windows Actions passed](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47207892157). The release run passed 31 CPU workloads, including the native descriptor and XTaskQueue/fence workloads. Its capability output verified WARP device creation and reported hardware mode unavailable on the hosted runner. The PowerShell builder also passed. GPU performance was outside that validation. From the repository root in PowerShell: ```powershell cargo test --locked -p victory-benchmark-suite --lib --test correctness --test smoke cargo run --locked --release -p victory-benchmark-suite -- --repo-root . --quick --cpu-only --out local/benchmarks/windows-cpu cargo run --locked --release -p victory-benchmark-suite -- --repo-root . compare main HEAD --cpu-only --time-limit 600 ``` For the optional native GPU probe build, run `.\tools\benchmark-suite\build-gpu.ps1`. I’d welcome your independent CPU rerun on Windows 11.
Extract the actual predicate and bitmap code from each revision. Measure clean and mixed wide ranges, verify the boundary oracle and missing-bit rejection, and report which implementation ran. Record the matched #381 results without attributing them to kernel or frame-time speedups.
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-03 21:53 UTC · original

Thanks for the quick turnaround. I reran things on native Windows 11 / MSVC at 4495c7b. The two commits since (up to 7d2ad97) add a write-watch bench and docs and leave main.rs:245 as it was, so the compare problem below still applies.

What's fixed from my earlier list

  • Build. The crate builds again on native Windows, the local This alias in xmem.rs is fine.
  • Clippy. cargo clippy -p victory-benchmark-suite --all-targets --no-deps is clean now, the env.rs return warning is gone.
  • CI. I read the new windows-latest job in benchmark-smoke.yml (check, clippy, tests, quick CPU run, probe build). Haven't looked at its runs, just the job definition.
  • GPU probe. env now reports the real adapter in hardware mode, WARP in software mode, and available=false with a clear reason for an unknown BENCH_GPU_MODE. --list and capabilities work too.
  • Process tree kill. timeout_terminates_the_native_process_tree passes here. I also ran a real compare HEAD HEAD --cpu-only --quick --offline --time-limit 25 from a fresh state. Mid build there were 4 cargo/rustc processes under the snapshot dir, it stopped at the deadline with "comparison time limit reached while running cargo", and afterwards none were left.
  • Shell scripts. run and build-gpu.sh are unchanged, but the README's direct cargo commands plus build-gpu.ps1 cover the native path. I ran build-gpu.ps1 under the default RemoteSigned policy, no policy change and no jq needed. It built the probe for the exact revision and the hardware memory suite picked it up.
  • Docs. The Windows section and the allocator note read fine to me.

Tests

  • cargo test -p victory-benchmark-suite passes (lib 19, correctness 9, sensitivity 1, smoke 1), including the two new Windows tests.
  • cargo test -p xtask -- switches passes (4).

Runs

--quick --cpu-only twice, about 1.5 s each. 31 workloads passed and 14 were reported unsupported as expected, with identical correctness digests across runs. Both native D3D12.X workloads pass here (descriptors/d3d12x_heap_and_copy and sync/xasync_and_d3d12x_fence).

Run to run, comparing the per workload median of run 2 against run 1, the median deviation was about 11%. 10 of 31 were within 5%, 14 within 10%, worst 0.67x and 1.35x (shaders/translate_corpus, descriptors/shader_resource_tracking). d3d12x_heap_and_copy was 0.98 with a few % CV, xasync_and_d3d12x_fence 1.15 with very high CV in both runs. So quick mode works as a smoke test, but I wouldn't read timing from it.

I also ran --suite memory --quick --require-gpu twice in hardware mode on one NVIDIA desktop card. 8 of 8 GPU workloads passed both times. Ratios were 0.94 to 1.03, and the two and eight copy cases stayed within 0.2%.

One problem left

The Windows compare example in the README fails when run with --repo-root .. main.rs:245 canonicalizes the root, which on Windows gives a \\?\ prefixed verbatim path, and the snapshot build started at compare.rs:471 then fails linking the first build script (LNK1181 cannot open input file '.obj') within a couple of seconds. The same compare without --repo-root (root found from the cwd) gets well past that point and only stops at the time limit. I tried both orders from a clean state and the failure follows the flag. That line isn't new in this PR, but the new README example runs straight into it. std::path::absolute or stripping the prefix (dunce style) should do. CI doesn't catch it because the Windows job never runs compare.

Small one. gpu_bridge.rs:82 still tells Windows users to run build-gpu.sh, it could mention build-gpu.ps1 too.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-03 21:53 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322#issuecomment-7393446352) Thanks for the quick turnaround. I reran things on native Windows 11 / MSVC at 4495c7b. The two commits since (up to 7d2ad97) add a write-watch bench and docs and leave main.rs:245 as it was, so the compare problem below still applies. What's fixed from my earlier list - Build. The crate builds again on native Windows, the local `This` alias in xmem.rs is fine. - Clippy. `cargo clippy -p victory-benchmark-suite --all-targets --no-deps` is clean now, the env.rs return warning is gone. - CI. I read the new windows-latest job in benchmark-smoke.yml (check, clippy, tests, quick CPU run, probe build). Haven't looked at its runs, just the job definition. - GPU probe. `env` now reports the real adapter in hardware mode, WARP in software mode, and `available=false` with a clear reason for an unknown `BENCH_GPU_MODE`. `--list` and `capabilities` work too. - Process tree kill. `timeout_terminates_the_native_process_tree` passes here. I also ran a real `compare HEAD HEAD --cpu-only --quick --offline --time-limit 25` from a fresh state. Mid build there were 4 cargo/rustc processes under the snapshot dir, it stopped at the deadline with "comparison time limit reached while running cargo", and afterwards none were left. - Shell scripts. `run` and build-gpu.sh are unchanged, but the README's direct cargo commands plus build-gpu.ps1 cover the native path. I ran build-gpu.ps1 under the default RemoteSigned policy, no policy change and no jq needed. It built the probe for the exact revision and the hardware memory suite picked it up. - Docs. The Windows section and the allocator note read fine to me. Tests - `cargo test -p victory-benchmark-suite` passes (lib 19, correctness 9, sensitivity 1, smoke 1), including the two new Windows tests. - `cargo test -p xtask -- switches` passes (4). Runs `--quick --cpu-only` twice, about 1.5 s each. 31 workloads passed and 14 were reported unsupported as expected, with identical correctness digests across runs. Both native D3D12.X workloads pass here (descriptors/d3d12x_heap_and_copy and sync/xasync_and_d3d12x_fence). Run to run, comparing the per workload median of run 2 against run 1, the median deviation was about 11%. 10 of 31 were within 5%, 14 within 10%, worst 0.67x and 1.35x (shaders/translate_corpus, descriptors/shader_resource_tracking). d3d12x_heap_and_copy was 0.98 with a few % CV, xasync_and_d3d12x_fence 1.15 with very high CV in both runs. So quick mode works as a smoke test, but I wouldn't read timing from it. I also ran `--suite memory --quick --require-gpu` twice in hardware mode on one NVIDIA desktop card. 8 of 8 GPU workloads passed both times. Ratios were 0.94 to 1.03, and the two and eight copy cases stayed within 0.2%. One problem left The Windows compare example in the README fails when run with `--repo-root .`. main.rs:245 canonicalizes the root, which on Windows gives a `\\?\` prefixed verbatim path, and the snapshot build started at compare.rs:471 then fails linking the first build script (`LNK1181 cannot open input file '.obj'`) within a couple of seconds. The same compare without `--repo-root` (root found from the cwd) gets well past that point and only stops at the time limit. I tried both orders from a clean state and the failure follows the flag. That line isn't new in this PR, but the new README example runs straight into it. `std::path::absolute` or stripping the prefix (dunce style) should do. CI doesn't catch it because the Windows job never runs `compare`. Small one. gpu_bridge.rs:82 still tells Windows users to run build-gpu.sh, it could mention build-gpu.ps1 too. AI-assisted: yes
Resolve Windows roots without introducing a verbatim prefix that breaks MSVC while preserving UNC paths and Unix canonicalization. Exercise an explicit-root self-comparison in native CI, point Windows users to the PowerShell GPU builder, and record independent validation.
Use a compact digest of the full production revision and benchmark harness for Windows snapshots. The same key shortens Cargo output paths so BLAKE3 object-file arguments stay within MASM limits on the hosted runner.
Author
Owner

@⁠tommiehansen on GitHub · 2026-12-03 22:12 UTC · original

@⁠Kal0s-design Thanks for reproducing this on native Windows. Explicit roots now resolve to absolute paths without canonicalization adding a verbatim prefix on Windows. The missing-probe message names build-gpu.ps1, and native CI now runs --repo-root . compare HEAD HEAD --cpu-only --quick --suite mapping --blocks 1 --offline --time-limit 600. Path, message, and CI fix

The first CI comparison got past the linker but exposed a second issue: MASM rejected BLAKE3’s long object path. The Windows snapshot key now hashes the full revision and harness into a shorter directory name. Local Cargo check passed, and the native rerun is in progress. MASM fix · Windows CI

PROGRESS.md now records your two runs with 31 passing CPU workloads and your two runs with all eight physical NVIDIA GPU workloads passing. It also records the quick-mode timing variation.

**@⁠tommiehansen** on GitHub · 2026-12-03 22:12 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322#issuecomment-7393889074) @⁠Kal0s-design Thanks for reproducing this on native Windows. Explicit roots now resolve to absolute paths without canonicalization adding a verbatim prefix on Windows. The missing-probe message names `build-gpu.ps1`, and native CI now runs `--repo-root . compare HEAD HEAD --cpu-only --quick --suite mapping --blocks 1 --offline --time-limit 600`. [Path, message, and CI fix](https://github.com/tommiehansen/VIctory-xmem/commit/ab96332) The first CI comparison got past the linker but exposed a second issue: MASM rejected BLAKE3’s long object path. The Windows snapshot key now hashes the full revision and harness into a shorter directory name. Local Cargo check passed, and the native rerun is in progress. [MASM fix](https://github.com/tommiehansen/VIctory-xmem/commit/e3c74d3) · [Windows CI](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47214845550) `PROGRESS.md` now records your two runs with 31 passing CPU workloads and your two runs with all eight physical NVIDIA GPU workloads passing. It also records the quick-mode timing variation.
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-03 22:36 UTC · original

Reran the Windows compare at e3c74d3 on native Windows with MSVC, using the README command plus --quick --offline, both with and without --repo-root ..

The LNK1181 is gone. With --repo-root . the snapshot paths now come out as plain C:\... paths with the short hash names, and the baseline snapshot built and linked fine, BLAKE3 assembly included. My first cold run then hit the 240s time limit while the candidate snapshot was still compiling, which is just build time on a cold cache.

Warm cache, both forms finished in about 2.5 to 3 minutes with the same result: 47 workloads, 31 timed and all marked inconclusive (expected for quick, 2 rounds), 30 with identical correctness digests, 16 GPU workloads unsupported in CPU-only mode. Both exit with code 3 on the compatibility warning for frame/synthetic_workload against main, the same either way.

The gpu_bridge message now names build-gpu.ps1. cargo test -p victory-benchmark-suite passes and clippy shows no warnings in the bench crate.

One small thing I noticed: the output folder is named unix-<secs>-compare on Windows too, and the printed path mixes / and \. It's cosmetic.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-03 22:36 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322#issuecomment-7394431027) Reran the Windows compare at e3c74d3 on native Windows with MSVC, using the README command plus `--quick --offline`, both with and without `--repo-root .`. The LNK1181 is gone. With `--repo-root .` the snapshot paths now come out as plain `C:\...` paths with the short hash names, and the baseline snapshot built and linked fine, BLAKE3 assembly included. My first cold run then hit the 240s time limit while the candidate snapshot was still compiling, which is just build time on a cold cache. Warm cache, both forms finished in about 2.5 to 3 minutes with the same result: 47 workloads, 31 timed and all marked inconclusive (expected for quick, 2 rounds), 30 with identical correctness digests, 16 GPU workloads unsupported in CPU-only mode. Both exit with code 3 on the compatibility warning for frame/synthetic_workload against main, the same either way. The gpu_bridge message now names build-gpu.ps1. `cargo test -p victory-benchmark-suite` passes and clippy shows no warnings in the bench crate. One small thing I noticed: the output folder is named `unix-<secs>-compare` on Windows too, and the printed path mixes `/` and `\`. It's cosmetic. AI-assisted: yes
Author
Owner

@⁠tommiehansen on GitHub · 2026-12-03 23:39 UTC · original

@⁠Kal0s-design Quick update following up on the native Windows runs:

  • Upstream Actions passed at 0669618: run 47220897854 completed both CPU Benchmark Smoke & Policy (3m30s) and Windows Native Benchmark Smoke (19m16s), including --repo-root . compare HEAD HEAD, hardware/WARP capability probes, and build-gpu.ps1.
  • Follow-up in 2ef6806:
    • Replaced fixed-sleep child synchronization in both the Unix (compare.rs) and Windows (windows_child.rs) timeout-termination tests with atomic PID readiness files before sending termination/closing the Job Object.
    • Dropped the redundant Windows cargo check --all-targets step before cargo clippy --all-targets.
    • Aligned README.md (sync clean-bitmap workloads, radv_um_alias name, and the --quick smoke/variance note) and updated PROGRESS.md and the PR description to match the verified state.
    • Verified locally on macOS ARM64 (Clippy clean, 20 unit + 9 correctness + smoke + 4 xtask -- switches) and cross-checked all targets against x86_64-pc-windows-msvc cleanly; upstream CI run 47228505885 is running now.
**@⁠tommiehansen** on GitHub · 2026-12-03 23:39 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322#issuecomment-7395831722) @⁠Kal0s-design Quick update following up on the native Windows runs: - **Upstream Actions passed at [`0669618`](https://github.com/tommiehansen/VIctory-xmem/commit/0669618):** [run 47220897854](https://github.com/lobomfz/VIctory-xmem/actions/runs/47220897854) completed both `CPU Benchmark Smoke & Policy` (`3m30s`) and `Windows Native Benchmark Smoke` (`19m16s`), including `--repo-root . compare HEAD HEAD`, hardware/WARP capability probes, and `build-gpu.ps1`. - **Follow-up in [`2ef6806`](https://github.com/tommiehansen/VIctory-xmem/commit/2ef6806):** - Replaced fixed-sleep child synchronization in both the Unix (`compare.rs`) and Windows (`windows_child.rs`) timeout-termination tests with atomic PID readiness files before sending termination/closing the Job Object. - Dropped the redundant Windows `cargo check --all-targets` step before `cargo clippy --all-targets`. - Aligned `README.md` (`sync` clean-bitmap workloads, `radv_um_alias` name, and the `--quick` smoke/variance note) and updated `PROGRESS.md` and the PR description to match the verified state. - Verified locally on macOS ARM64 (Clippy clean, 20 unit + 9 correctness + smoke + 4 `xtask -- switches`) and cross-checked all targets against `x86_64-pc-windows-msvc` cleanly; upstream CI run [47228505885](https://github.com/lobomfz/VIctory-xmem/actions/runs/47228505885) is running now.
Compile the revision’s barrier parser, scope preflight, host state predicate and thin decoder. Check an explicit synthetic dependency matrix against legacy waits and report predicted emissions, fallback reasons and paired CPU planning costs.
Use the compared revision’s production range collector and eviction loop to measure repeated versus batched scans across four representative tables. Verify all survivors against an independent range union and report traversals and CPU timing. Preserve historical RT texture queue census counters so those snapshots compile, and mark the new workload unsupported where the RT collector is absent.
Exercise the production address map on sparse and dense invalidations, empty build-overlap queries and lookup/replace/insert churn. Compare every surviving map with an independent fixture and report unsupported on older source snapshots. Record the paired results and reproduction steps in PROGRESS.md.
Run the historical mutex and current atomic gate with empty, contended and pending batches. Add scattered address churn alongside the existing sparse and dense index cases, and record paired before/after and index-only comparisons for the PR #429 review.
Add fragmented and wide-address dense cases, including verified eviction callbacks, reinsertion and subsequent lookup. Record all six dense cases against the flat hash control in the Standard and Full profiles, alongside the remaining insertion tradeoffs.
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 11:02 UTC · original

A concrete split, from the diff (main…tools/benchmark-suite, 110 files, +20,977/−2,172). It is not one PR about a benchmark suite — it is four unrelated things, and they have very different review costs:

1. refactor: delete the paths nothing reaches — ~950 deletions, no additions.
crates/victory-loader/src/vehicle_notch.rs (−297), ps5_rumble.rs (−124), crates/victory-gpu/src/pipeline/library/name_gate.rs (−146), crates/victory-shader/src/emit/mod.rs (−362), crates/victory-core/src/menu.rs (−76), apps/victory/src/warm.rs (−53), crates/victory-gpu/src/pull.rs (−74), tools/backup-saves.sh (−88). Deletions are the fastest review in the world and the easiest merge; keeping them inside a 20k-line PR is the worst possible place for them. Base main.

2. config: prune the switches the removal orphaned — run.conf.default (+140/−269) and the xtask/src/switches.rs change.
Separate because it is the only part where a reviewer has to agree that a documented switch is gone, and because it conflicts with every other PR that touches run.conf.default.

3. bench: the harness — tools/benchmark-suite/src/{main,protocol,env,stats,json,report,compare,pr,fixtures,dxil_inspect}.rs + Cargo.toml/Cargo.lock, ~9k lines.
No suites, no adapters: a runner, a protocol, a statistics layer, a reporter. This is the part that has to be right before anything measured with it means anything, and it can be reviewed without knowing what is being measured.

4. bench: the suites and the xmem adapter — src/suites/* (~10 files, residency 817, shaders 577, rt_freed_bench 552, rt_remap_bench 548, mapping 530, texture_queue 519, frame 421, front_plan_bench 393 …) + src/adapters/xmem.rs (698).
Each suite is an independent claim about what to measure; rt_freed_bench and rt_remap_bench in particular only make sense next to their respective PRs, not in a suite catalogue.

5. ci: a benchmark smoke run — .github/workflows/benchmark-smoke.yml, historical.rs.
Last, because a workflow cannot be green until 3 and 4 exist, and because a red CI check on a fork PR blocks nothing but everything after it.

6. chore(repo): agent guidance — AGENTS.md, CLAUDE.md, GEMINI.md, ~76 lines.
Unrelated to all of the above and trivially mergeable on its own.

The reason this matters more than usual here: the renames/deletions in 1 and 2 touch run.conf.default, warm.rs, menu.rs and the loader — among the most contended files in the queue. As one PR they will conflict with almost everything that merges while it waits, and every conflict will be resolved inside a diff nobody has read to the end.

**@⁠Luxuride** on GitHub · 2026-12-04 11:02 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322#issuecomment-7409540084) A concrete split, from the diff (`main`…`tools/benchmark-suite`, 110 files, +20,977/−2,172). It is not one PR about a benchmark suite — it is four unrelated things, and they have very different review costs: **1. `refactor: delete the paths nothing reaches` — ~950 deletions, no additions.** `crates/victory-loader/src/vehicle_notch.rs` (−297), `ps5_rumble.rs` (−124), `crates/victory-gpu/src/pipeline/library/name_gate.rs` (−146), `crates/victory-shader/src/emit/mod.rs` (−362), `crates/victory-core/src/menu.rs` (−76), `apps/victory/src/warm.rs` (−53), `crates/victory-gpu/src/pull.rs` (−74), `tools/backup-saves.sh` (−88). Deletions are the fastest review in the world and the easiest merge; keeping them inside a 20k-line PR is the worst possible place for them. Base `main`. **2. `config: prune the switches the removal orphaned` — `run.conf.default` (+140/−269) and the `xtask/src/switches.rs` change.** Separate because it is the only part where a reviewer has to agree that a documented switch is *gone*, and because it conflicts with every other PR that touches `run.conf.default`. **3. `bench: the harness` — `tools/benchmark-suite/src/{main,protocol,env,stats,json,report,compare,pr,fixtures,dxil_inspect}.rs` + `Cargo.toml`/`Cargo.lock`, ~9k lines.** No suites, no adapters: a runner, a protocol, a statistics layer, a reporter. This is the part that has to be right before anything measured with it means anything, and it can be reviewed without knowing what is being measured. **4. `bench: the suites and the xmem adapter` — `src/suites/*` (~10 files, `residency` 817, `shaders` 577, `rt_freed_bench` 552, `rt_remap_bench` 548, `mapping` 530, `texture_queue` 519, `frame` 421, `front_plan_bench` 393 …) + `src/adapters/xmem.rs` (698).** Each suite is an independent claim about what to measure; `rt_freed_bench` and `rt_remap_bench` in particular only make sense next to their respective PRs, not in a suite catalogue. **5. `ci: a benchmark smoke run` — `.github/workflows/benchmark-smoke.yml`, `historical.rs`.** Last, because a workflow cannot be green until 3 and 4 exist, and because a red CI check on a fork PR blocks nothing but everything after it. **6. `chore(repo): agent guidance` — `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, ~76 lines.** Unrelated to all of the above and trivially mergeable on its own. The reason this matters more than usual here: the renames/deletions in 1 and 2 touch `run.conf.default`, `warm.rs`, `menu.rs` and the loader — among the most contended files in the queue. As one PR they will conflict with almost everything that merges while it waits, and every conflict will be resolved inside a diff nobody has read to the end.
Author
Owner

@⁠tommiehansen on GitHub · 2026-12-04 17:54 UTC · original

@⁠Luxuride Thanks for the feedback! Most of the unrelated changes have already been removed.

I'd prefer to keep the benchmark harness, test suites and CI together as a complete, independently testable tool. Larger additions, including cross-platform Vulkan support, will be handled in separate follow-up PRs to keep this PR focused.

**@⁠tommiehansen** on GitHub · 2026-12-04 17:54 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322#issuecomment-7419639567) @⁠Luxuride Thanks for the feedback! Most of the unrelated changes have already been removed. I'd prefer to keep the benchmark harness, test suites and CI together as a complete, independently testable tool. Larger additions, including cross-platform Vulkan support, will be handled in separate follow-up PRs to keep this PR focused.
The cache and command list can retire separate references to the same immutable snapshot. Count each deferred GPU address once so overlapping references do not imply extra allocated memory. Check that the deferred queue drains and its high-water mark fits within the modeled live allocation peak.
Apply the reviewed portable GPU package core. Allow a full, verified ancestor to isolate a stacked PR and record the resolved baseline in reports. Select ray-tracing fixtures for native HWRT changes and disclose the limits of CPU-only module coverage. Test strict ancestry, baseline rejection and workload selection.
Author
Owner

@⁠tommiehansen on GitHub · 2026-12-04 21:37 UTC · original

The reviewed portable GPU package’s core landed on this branch in 5bd5534. --base-commit now requires a full verified strict ancestor and isolates stacked PR changes. HWRT production paths select the ray-tracing suite and disclose the limits of CPU-only coverage. On Apple M5, 31 Rust tests and Cargo check passed, along with a Windows-target compile check. A Quick run against official #469 pinned 0fd7614 → 0ddf76c matched all seven CPU shader digests. Timing was inconclusive and GPU execution remained unsupported. The optional portable GPU payload is being kept as a separate follow-up.

**@⁠tommiehansen** on GitHub · 2026-12-04 21:37 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322#issuecomment-7424932143) The reviewed portable GPU package’s core landed on this branch in `5bd5534`. `--base-commit` now requires a full verified strict ancestor and isolates stacked PR changes. HWRT production paths select the ray-tracing suite and disclose the limits of CPU-only coverage. On Apple M5, 31 Rust tests and Cargo check passed, along with a Windows-target compile check. A Quick run against official #469 pinned `0fd7614` → `0ddf76c` matched all seven CPU shader digests. Timing was inconclusive and GPU execution remained unsupported. The optional portable GPU payload is being kept as a separate follow-up.
Author
Owner

@⁠tommiehansen on GitHub · 2026-12-04 21:41 UTC · original

The optional Vulkan work is in the stacked fork PR. Native ARM64 CMake/CTest passed on physical Apple M5 via MoltenVK, including deliberate oracle failure. The Standard sensitivity runs failed the drift gate and are inconclusive. The separate exporter commit preserves the original CPU and D3D12 paths.

**@⁠tommiehansen** on GitHub · 2026-12-04 21:41 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322#issuecomment-7425022576) The optional Vulkan work is in [the stacked fork PR](https://github.com/tommiehansen/VIctory-xmem/pull/6). Native ARM64 CMake/CTest passed on physical Apple M5 via MoltenVK, including deliberate oracle failure. The Standard sensitivity runs failed the drift gate and are inconclusive. The separate exporter commit preserves the original CPU and D3D12 paths.
github-bot changed title from tools: add standalone Rust synthetic benchmark suite to feat(tools): add standalone Rust synthetic benchmark suite 2026-12-04 22:19:52 +00:00
Author
Owner

@⁠tommiehansen on GitHub · 2026-12-05 10:19 UTC · original

Thanks for the earlier Windows and scope reviews. The smaller #322 remains available; the optional Vulkan/Nextgen integration is now #568, excluding repository-wide agent guidance. All seven active upstream CI jobs passed, including actual software Vulkan execution and the deliberately incorrect oracle rejection. This is a separate integration alternative, not a physical GPU performance claim. Integration and checks.

**@⁠tommiehansen** on GitHub · 2026-12-05 10:19 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/322#issuecomment-7436363913) Thanks for the earlier Windows and scope reviews. The smaller #322 remains available; the optional Vulkan/Nextgen integration is now #568, excluding repository-wide agent guidance. All seven active upstream CI jobs passed, including actual software Vulkan execution and the deliberately incorrect oracle rejection. This is a separate integration alternative, not a physical GPU performance claim. [Integration and checks](https://git.gtahub.st/github/lobomfz--VIctory-xmem/pulls/568).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/322/head:github-bot/gh-322'
git switch 'github-bot/gh-322'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-322'
git switch 'github-bot/gh-322'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-322'
git switch 'github-bot/gh-322'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-322'
git switch 'main'
git merge --squash 'github-bot/gh-322'
git switch 'main'
git merge --ff-only 'github-bot/gh-322'
git switch 'main'
git merge 'github-bot/gh-322'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.