Skip to content

Add synthetic Cargo benchmark suite - #132

Closed
bmjask wants to merge 7 commits into
xcl-dev:mainfrom
bmjask:codex/benchmark-suite
Closed

bmjask wants to merge 7 commits into
xcl-dev:mainfrom
bmjask:codex/benchmark-suite

Conversation

@bmjask

@bmjask bmjask commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add Criterion-backed cargo bench support with four explicit benchmark targets
  • add 67 deterministic synthetic benchmarks covering RDNA2 decoding and analysis, recompiler translation, shader and container scanning, descriptors, PE/RPF/config/manifest parsing, VFS classification, and runtime utilities
  • document full-suite, per-target, and saved-baseline commands
  • keep all benchmark inputs synthetic or repository-built; no title executable, game files, or compatible GPU are required

Benchmark targets

  • core: quick smoke baselines
  • formats: instruction streams, descriptors, PE/RPF, manifest and configuration formats
  • gpu_cpu: CPU-side shader/recompiler pipeline work
  • runtime: VFS, configuration and utility paths

Verification

  • cargo bench -p xcl --no-run
  • all 67 Criterion cases passed smoke mode across the four targets
  • cargo build --workspace
  • full serial workspace suite passed: 497 library tests passed, 16 ignored, 0 failed, plus all integration and end-to-end suites
  • benchmark throughput labels independently reviewed and corrected
  • git diff --check

The only emitted warning is the existing unrelated atomic API deprecation.

Flamegraph workflow

  • retain line-level debug information in optimized benchmark builds
  • add scripts/flamegraph.ps1 for whole-target or filtered Windows CPU profiles
  • validate tool availability and propagate profiler failures without installing tools or requesting elevation
  • document generated SVG paths and when to use PIX/WPA for GPU or off-CPU analysis

Lum7nt added a commit to Lum7nt/xcl that referenced this pull request Nov 23, 2026
… and add console stubs

Scarlett GDK uses subobject type 23 for Amplification Shaders (AS) and 24 for Mesh Shaders (MS), whereas PC Direct3D 12 uses slot 24 for AS and 25 for MS. Console streams passing an MS container in slot 24 previously failed pipeline stream translation as an unsupported AS, returning E_INVALIDARG.

- Disambiguate slot 24 in real.rs and null.rs by checking shader container stage and NGG hardware stage.
- Direct console slot 24 MS containers to mesh shader translation and fallback.
- In fallback_stream, rewrite console slot 24 to PC slot 25 with dummy mesh bytecode so PC drivers accept the SM 6.5 stream.
- Add unit tests for subobject payload and fallback stream rewriting.
- Add console stubs for command list xcl-dev#75, xcl-dev#126, #131, xcl-dev#132, xcl-dev#142, allocator xcl-dev#9, and queue xcl-dev#31 extension.
@ivall

ivall commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Not merged in this round: it adds benchmark dependencies to the workspace and is behind main by 60+ commits. Please rebase on main (6da33fa) and say what the benches are meant to catch (a regression gate or a manual tool).

heretic1321 pushed a commit to heretic1321/xcl that referenced this pull request Nov 23, 2026
… and add console stubs

Scarlett GDK uses subobject type 23 for Amplification Shaders (AS) and 24 for Mesh Shaders (MS), whereas PC Direct3D 12 uses slot 24 for AS and 25 for MS. Console streams passing an MS container in slot 24 previously failed pipeline stream translation as an unsupported AS, returning E_INVALIDARG.

- Disambiguate slot 24 in real.rs and null.rs by checking shader container stage and NGG hardware stage.
- Direct console slot 24 MS containers to mesh shader translation and fallback.
- In fallback_stream, rewrite console slot 24 to PC slot 25 with dummy mesh bytecode so PC drivers accept the SM 6.5 stream.
- Add unit tests for subobject payload and fallback stream rewriting.
- Add console stubs for command list xcl-dev#75, xcl-dev#126, #131, xcl-dev#132, xcl-dev#142, allocator xcl-dev#9, and queue xcl-dev#31 extension.
@raylitebull

Copy link
Copy Markdown
Member

Closing as a stale, conflicting PR that was previously passed over due to added workspace benchmark dependencies and being far behind main.

theaustinayers added a commit to theaustinayers/xcl that referenced this pull request Nov 25, 2026
…pelineX) are UAV barriers

FlushGpuCacheRangeX and FlushShaderCacheRangeX of the newer list layout were answered with nothing.
They are how a title orders a pass behind the one that wrote what it reads: a retail title calls them
thousands of times a minute, and its compute passes (the ones that write indirect arguments and the
ones that read them) had no order there. FlushPipelineX (xcl-dev#67, newer layout xcl-dev#69) as well; at xcl-dev#69 a
newer-layout title's call ran Write32BitValueBottomOfPipeX with the flags as the address.

The PC has no ranges of caches: a UAV barrier for all resources, on direct and compute lists.

Test: cache_flushes_are_uav_barriers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
JR-Wiederkehr pushed a commit to JR-Wiederkehr/xcl that referenced this pull request Nov 25, 2026
…ecuteIndirect)

Supersedes xcl-dev#724; its commits are kept with their authors.

Conflicts:
- bind.rs State keeps the tree's heap_bound and xcl-dev#1803's heaps next to
  the record buffers and scratch; reset clears the heaps and holds the
  record buffers for the old allocator; forget takes the state out of
  the sharded map (bind::STATES) and holds its buffers. HashMap is
  imported again for the PR's maps.
- console_list.rs Layout keeps xcl-dev#1803's heaps and the PR's inline_ms;
  with_heaps and user_data_ms both stay.
- device_x.rs keeps xcl-dev#1887's log of a refused signature and the PR's
  companion Dispatch signature; the CreateCommandSignature doc is back
  above its function (the merge had put it above indirect_arg_bytes).
- real.rs console slots keep the tree's #131 / xcl-dev#132 FlushCacheRange and
  the PR's DispatchMesh at xcl-dev#127.
- list_x.rs: the PR's bound_heaps test helper removes the list from
  its own part of the sharded recording map.

DispatchMesh slot: xcl-dev#1984 mapped the newer layout's xcl-dev#129 to the older
xcl-dev#126, this PR to xcl-dev#127, where it hooks DispatchMesh. Kept xcl-dev#127: it is
the shift of two slots the other methods have, and xcl-dev#1984's own reading
of the newer layout (xcl-dev#126 / xcl-dev#127 the shading-rate methods, the older
xcl-dev#124 / xcl-dev#125) puts its xcl-dev#128 at the older xcl-dev#126. xcl-dev#1984's test is rewritten
for (129, 127) and checks that the older slot runs bind::dispatch_mesh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants