Repository navigation
Tests: the conformance title's GPU frame, cargo conformance and cargo demo (with a stress scale), on Windows and macOS - #3021
0xkn0wh3r3 wants to merge 11 commits into
Conversation
…rence docs/acceptance.md plans an acceptance and benchmark layer that needs no title, no game data and no SDK: a stand-in title written from Microsoft's public GDK reference, run through VIctory's own loader and runtime, that calls each platform area as a title does and checks what the reference says the call does. The Microsoft GDK is not used: its license limits it to Windows titles for Windows and forbids reverse engineering it. tests/fixtures/conformance is that title (a cdylib outside the workspace, like hle-probe). crates/victory-hle/tests/conformance.rs builds it, binds it with HleResolver and runs its 82 checks (TAP): - runtime initialisation, and QueryApiImpl found as a title's stub finds it; - task queues and async calls: dispatch modes and ports, delayed submits, termination, XAsyncRun, provider operation order, cancellation; - system information: analytics family, console id and its errors; - physical pages mapped at two addresses stay coherent and unmap; - DirectStorage from memory: raw and zlib, completion order, a failed read not blocking later notifications, request reuse, automatic submission; - game saves: container names, updates, the 16 MB update limit and all-or-nothing updates. 80 pass. Two answers differ from the reference and are listed in the test with why, reported rather than failed (one passing fails the test, so the list stays true): a retail console id is documented as 00000000.00000000.00000000.00000000.00 (VIctory: 38 digits ending in 1), and a DirectStorage queue submits itself once an Enqueue fills more than half its capacity (VIctory: at half). An ignored test runs the streaming workload and prints its throughput.
…ackage, HDR The conformance title (tests/fixtures/conformance) now runs 143 checks through VIctory, each from Microsoft's public reference: - the user: silent default user added twice is the same user, handle duplication and comparison, local and network ids found back, state, age group, privileges, gamertag components within their documented sizes and the short-buffer error; - DirectStorage from files: raw reads at an offset, zlib at 16-byte aligned offsets, a missing file refused; - files on the console's drives (package at G:, temporary storage at T:) through every path-taking import VIctory binds: CreateFileW/-A/2, attributes, FindFirstFileW, fopen, _wfopen, _wstat64, directories, writes, MoveFileExW, deletes, and Win32's errors for missing paths; - persistent local storage: the path and its size, consistent space figures within the declared quota, a written file counted as used; - networking hints and the documented default UDP port (sync and async), XPackageIsPackagedProcess and the identifier, HDR mode results. 139 pass. Two more answers differ from the reference and join the list in the test: XUserFindUserByLocalId of no user returns E_GAMEUSER_USER_NOT_FOUND (the reference: HRESULT_FROM_WIN32 (ERROR_NOT_FOUND)), and XUserGetGamertag answers an invalid component with the gamertag (the reference: E_INVALIDARG). The harness mounts G: and T: and makes the storage folder, as `victory run` does.
Nine more checks from the public reference: a SerializedThreadPool port runs its callbacks one at a time and a ThreadPool port in parallel; a composite queue's callback is dispatched from the queue owning its port; XAsyncGetResult with another identity than XAsyncBegin's is E_INVALIDARG; with the process task queue set to nullptr there is none, and it is put back after. One more answer differs from the reference and joins the list in the test: with no process task queue, an async call whose block names no queue runs anyway, where XTaskQueueSetCurrentProcessTaskQueue's page says APIs needing a queue fail with E_NO_TASK_QUEUE. 152 checks, 147 pass.
Review (Marvisak#2057): the report check passed when a known divergence's check was gone, also with the TAP plan lowered to match, and when the report was cut short of its plan. `accept` now requires the results to be numbered 1 to the plan's count, in order, each known divergence's check to be there exactly once and to fail, and nothing else to fail; it returns the known divergences seen. `reports_missing_or_cut_short_checks_are_refused` runs it on made-up reports: all present, a skipped check, a known check gone (plan lowered to match), a report cut short of its plan, a known divergence that passes, an unknown failure, a known check twice, and no checks.
… its notes in the test The conformance title and its harness now say only that they are written from the public platform documentation, without naming the console SDK. docs/acceptance.md is gone: how to run the suite and what KNOWN means are a few lines in crates/victory-hle/tests/conformance.rs's module docs. The fixture's miniz_oxide is the version the workspace already uses.
…ecks it against WARP The title draws a scene as a title does, from the console device's method slots: device, queue, lists, fence, descriptor heaps, serialised root signatures, a graphics pipeline from a stream and a compute pipeline whose shaders are GFX10 programs assembled by hand from AMD's RDNA2 ISA guide (vertex transform, Blinn-Phong lighting from constant buffers times a sampled texture, a compute blur), in the container layout VIctory reads. Vertex, index and constant buffers in title memory, a texture uploaded by copy, a depth buffer, four indexed draws, a dispatch, a copy to a read-back buffer. The harness draws the same scene (one shared file) natively on WARP from equivalent HLSL; the title checks its frame against it within a small tolerance, plus pixels exact by construction (clear colour, emitted colour, depth). VICTORY_CONFORMANCE_WINDOW=<seconds> presents the frame, animated, with PresentX; VICTORY_CONFORMANCE_DUMP=<folder> saves both frames.
The runtime reads 16 bytes past a heap description, as newer titles follow it with memory of their own for the descriptors (address, size): victory-gpu's create_heap takes it as a placement when the size matches the heap's. The title passed the 4-word description alone, so those bytes were whatever its stack held; if they ever looked like a placement the heap would sit at a stray address (the list benchmark in Marvisak#2820 crashed so, in one build). It now passes the description and a zero placement, as a title that does not place its heaps leaves it.
The suite's notes moved into the test itself; the GPU frame's module headers still named the document.
VICTORY_CONFORMANCE_DLL names the title's DLL instead of building it with cargo at run time, for a test binary run where cargo is not: a binary cross-compiled for Windows (cargo xwin) and run under Wine, for example.
One command each for the acceptance suite and for showing its GPU frame: - `cargo conformance` runs the conformance title's suite; `--window <s>` then shows the GPU frame for that long. - `cargo demo` shows only the GPU frame, animated, until its window is closed (`--seconds` to stop sooner): to leave running, or to show. - Both draw the window's frames at `--resolution` (720p, 1080p, 1440p, 4k or <width>x<height>; 1440p by default) with VIctory's overlay (frame rate and frame times), and build the test in release. - On Windows they run the test natively. On macOS they cross-compile the title and the test with cargo-xwin and run them under CrossOver (Wine, D3DMetal, Rosetta 2) in a bottle of their own, made on first use. The title draws the window's frames at their own size with a second set of resources and pipelines (the compute pass takes its row width), while the checks stay on the 512x288 frame. The overlay was never drawn into the old 512x288 window: its panel needs 720 lines. `VICTORY_CONFORMANCE_WINDOW=until-closed` presents until VIctory's window is gone, then ends the process. On an M5 Max under CrossOver, in release: about 59 fps at 1440p, 58 at 1080p and 53 at 4K, overlay shown.
- `--scale <n>` (VICTORY_CONFORMANCE_SCALE) stresses VIctory rather than the GPU: each step past 1 adds 64 small cubes and pyramids to the window's frame, each a draw whose constants are written into title memory and whose view is made in the shader-visible heap that frame, and one more submission that binds the pass again, as a title's lists do. The title prints the frame rate and the work per frame every 5 seconds. - The window's frames add terrain: ridged Perlin noise around the ground, flat beside it and rising into ridges with distance. It is a mesh of the shared geometry, drawn only in the window; the checked frame and the WARP reference are unchanged. - `--dump <dir>` saves the checked frames and, after a timed window, the window's last frame (window.ppm). The title now tracks the presented texture's state and the copy list's instead of inferring them from the first frame, so a frame can be read back after presenting. Under CrossOver on an M5 Max, 1440p: scales 1 to 16 hold the display's 60 fps (up to 964 draws and 16 submissions a frame); scale 64 (4,036 draws, 64 submissions) takes 42 ms a frame.
- The portable crates build and test on macOS and Linux (as Marvisak#2992 on main). - Release builds with thin LTO, x86-64-v3 for Windows, and xxh3 for texture change detection (as Marvisak#3011 on main). - `cargo conformance` and `cargo demo`: the acceptance suite and its GPU frame in a window, with --resolution, the --scale stress test, terrain and --dump, on Windows and under CrossOver on macOS (as Marvisak#3021 on main).
|
Independent Linux/Wine verification on NVIDIA GeForce RTX 4060 Laptop GPU (8 GiB), 16 GiB RAM, Wine 11.0 + vkd3d-proton 3.2.0 + DXVK 3.1.1, exact clean PR head
This synthetic test exercises console-facing root signatures and present successfully in VIctory; it does not remove XCL's separate native-vtable assertion or the retail game's 16 GiB loading blocker. |
kotekompotek
left a comment
There was a problem hiding this comment.
LGTM — the first real end-to-end coverage: fixture built to CARGO_TARGET_TMPDIR (repo stays clean), loaded through the genuine prepare→load→bind_imports→attach path with mounted drives, and missing-import assertion means any HLE gap fails loudly. The KNOWN list with doc citations + fail-on-pass is the right way to track divergence. WARP comparison degrades gracefully. Skimmed the fixture modules — synthetic hand-assembled GFX10 programs and doc-derived checks only, no game data.
|
Automated triage for the maintainers. Thanks for the reply. The head is unchanged, so the verdict stays needs work; needs the maintainer's decision: build aliases, a new fixture crate with its own lockfile, xtask commands that run other programs, and the macOS/CrossOver runner. The three-way split you outline, with short README text in each, would make this reviewable once #2057 lands. Generated by Claude Code |
|
Understood. Most of this is your decision: the build aliases, the fixture crate and its dependencies, the xtask commands that run other programs, the macOS/CrossOver runner and the README text. Splitting it as you suggest makes sense:
The README text would shrink to a few lines in each piece. |
…through demo-portable-build)
|
I ran the generated GPU frame from exact
On stock, independent texture copies showed full-height coverage in both the scene color target and the compute output texture. Native translation gave the 512-, 1280-, and 1920-wide compute shaders the same 3,768-byte container size. Reusing the first shader's 512-pixel linear store stride predicts exactly 289 populated buffer rows at both larger sizes. The sole production change was the Mac fork's existing fix to put an MD5 of the DXIL bitcode in the |
Depends on #2057 (the conformance title). This branch is built on #2057's branch, so its 5 commits show here until it merges; the 6 commits after
1434e72are this PR's.This adds the conformance title's GPU frame, plus one command each to run the acceptance suite and to show the frame as a demo, on Windows and on macOS. The demo can also scale up the work it gives VIctory, as a stress test of the translation layer.
What's here
tests/gpu-frame-workload, which never had a PR of its own). The conformance title draws a scene through VIctory's console D3D12 with hand-assembled GFX10 shaders, and the test compares it with the same scene drawn natively on WARP from HLSL. That's 37 checks, on top of Tests: a conformance title checks the runtime against the public platform documentation #2057's 152.cargo conformance(cargo xtask conformance): the whole suite.--window <seconds>then shows the GPU frame, animated, for that long.cargo demo(cargo xtask demo): only the GPU frame, in a window until it is closed, with VIctory's overlay (frame rate and frame times) if GPU: a debug overlay, Alt+Z, drawn into the presented frame #2171 is in. Options:--resolution 720p|1080p|1440p|4k|<width>x<height>(default 1440p). The checks still run on the 512x288 frame; the window's frames are drawn at their own size.--scale <n>: each step past 1 adds 64 small objects, each a draw whose constants are written into title memory and whose view is made in the shader-visible heap that frame, plus one more submission that binds the pass again. It stresses VIctory's per-draw, per-descriptor and per-submission work rather than the GPU. The title prints the frame rate and the work per frame every 5 seconds.--seconds <n>,--no-overlay,--debug, and--dump <dir>, which saves the checked frames and the window's last frame as PPM images.cargo-xwinand run them under CrossOver (Wine, Apple's D3DMetal for D3D12, Rosetta 2) in a bottle of their own. On Windows they runcargo testnatively.VICTORY_CONFORMANCE_DLLlets the test use a title DLL built beforehand, since Wine can't run the host'scargo.Testing
Run on an M5 Max under CrossOver, from this branch, which is
mainplus #2057 only:cargo conformance: passes. All 189 checks run; the 5 divergences Tests: a conformance title checks the runtime against the public platform documentation #2057'sKNOWNlists are reported, and the WARP comparison is skipped because D3DMetal has no WARP adapter.cargo demo: runs until its window is closed, then exits cleanly. At 1440p, scales 1 to 16 hold the display's 60 fps (up to 965 draws and 16 submissions a frame). Scale 64 (4,037 draws, 64 submissions) takes about 42 ms a frame ondemo.OpenExistingHeapFromAddress1aren't supported, so the overlay's GPU-time readings are empty and title memory is copied rather than used in place.cargo test -p victory-hle --test conformancewith the same variables.