Draft integration test of 138 PRs on Windows #231

Closed
github-bot wants to merge 364 commits from gh-pr/231/head into gh-pr/231/base
Owner

@⁠muhammed-aksoy on GitHub · 2026-11-24 01:39 UTC · original
muhammed-aksoy:pr-integration → main · +25471 −1432 · 155 files · 364 commits · closed without merging

What

This draft integrates 138 PRs against upstream main at d2a4bae1f49533ef5cb512fd1b1ba1513f2e1989. The latest update merges 20 newly opened PRs, refreshes 10 previously integrated PR heads including PR 287, and integrates PR 217. The changes from closed PRs 35, 195, 220, and 266 were backed out. Upstream still points to the same base.

Tested

  • Native Windows workspace tests on e440f47 passed with 562 tests and zero failures.

  • Windows all-targets, all-features build check and asset-policy check passed. The asset policy checked 195 files, and Git's whitespace check passed.

  • Rustfmt reported formatting differences in 41 files.

  • Hosted Windows CI passed on e440f47 in WARP mode. GitHub Actions run

  • The initial hosted run passed the build and asset policy, then failed to create a fixed-wave-size shader pipeline with the default adapter. The WARP workflow passed both locally and on GitHub for the prior source snapshot. Initial hosted run · Passing hosted WARP run for the prior snapshot

  • Jeremy independently ran the workspace library suites on e440f47. He reported 512 passed, zero failed, and 19 ignored across 11 test binaries. Independent verification

Integration fixes

The earlier batch combined the stack-size setting with Agility SDK exports, reconciled the depth bounds and host queries documentation, restored the GPU query test's FXC dependency, and removed duplicate shader match arms. This update supplies the optional PSV field in existing shader fixtures, explicitly parses the storage quota as u64, records late frame ticks before returning from the wait, and preserves diagnostic tick logging.

The refreshed synthetic PE test now expects the parser to reject an unterminated TLS callback array, matching the stricter parser already in the batch.

Included PR numbers

9, 12, 17, 20, 55, 69, 72, 76, 82, 83, 87, 88, 89, 93, 96, 98, 101, 104, 105, 110, 111, 113, 115, 119, 120, 121, 122, 123, 124, 126, 130, 132, 139, 141, 143, 149, 150, 151, 153, 158, 159, 160, 161, 163, 167, 169, 172, 174, 175, 177, 179, 182, 183, 185, 186, 188, 190, 191, 192, 194, 196, 197, 198, 200, 202, 204, 207, 209, 213, 214, 217, 219, 221, 222, 228, 229, 236, 238, 239, 240, 245, 247, 248, 249, 259, 260, 263, 270, 273, 276, 278, 279, 280, 285, 287, 288, 299, 302, 310, 311, 313, 315, 319, 322, 323, 324, 326, 329, 331, 333, 335, 337, 341, 343, 345, 347, 351, 353, 355, 356, 357, 358, 359, 361, 362, 364, 368, 369, 370, 371, 372, 373, 377, 378, 379, 381, 382, 384

Conflicts in the latest refresh

Some entries are updated heads whose earlier revision still appears in the included list.

101, 158, 159, 177, 185, 241, 315, 354, 360, 363, 365, 367, 374, 376, 380, 383, 385, 387

Conflicts from the preceding batch

232, 233, 234, 235, 237, 241, 242, 244, 246, 250, 251, 254, 256, 261, 265, 269, 275, 281, 282, 284, 286, 290, 292, 294, 298, 301, 305, 306, 307, 308, 309, 312, 317, 318, 320, 321, 328, 332, 334, 336, 342, 346, 349, 352

Current upstream status

Upstream main advanced to ffe310e. Native Windows validation at that commit passed 342 tests, the all-targets/all-features build check, and the asset policy. The results above refer to the published integration snapshot e440f47.

Of the 138 PRs in that snapshot, 26 are now merged upstream, nine are closed (including PR 287), and 103 are still open. A local rebuild from current main found 80 Git-clean merges, 22 merge conflicts, and one PR whose change was already represented. The candidate remains under review because the shader thread-ID regression fails after the merge. It also exposed an XMA packet traversal regression when carrying PR 96. There were 245 open PRs numbered after 387 at the audit, and they were outside this rebuild.

**@⁠muhammed-aksoy** on GitHub · 2026-11-24 01:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/231) `muhammed-aksoy:pr-integration` → `main` · +25471 −1432 · 155 files · 364 commits · closed without merging ## What This draft integrates 138 PRs against upstream `main` at `d2a4bae1f49533ef5cb512fd1b1ba1513f2e1989`. The latest update merges 20 newly opened PRs, refreshes 10 previously integrated PR heads including PR 287, and integrates PR 217. The changes from closed PRs 35, 195, 220, and 266 were backed out. Upstream still points to the same base. ## Tested - [x] Native Windows workspace tests on `e440f47` passed with 562 tests and zero failures. - [x] Windows all-targets, all-features build check and asset-policy check passed. The asset policy checked 195 files, and Git's whitespace check passed. - [ ] Rustfmt reported formatting differences in 41 files. - [x] Hosted Windows CI passed on `e440f47` in WARP mode. [GitHub Actions run](https://github.com/muhammed-aksoy/VIctory/actions/runs/45315941846) - The initial hosted run passed the build and asset policy, then failed to create a fixed-wave-size shader pipeline with the default adapter. The WARP workflow passed both locally and on GitHub for the prior source snapshot. [Initial hosted run](https://github.com/muhammed-aksoy/VIctory/actions/runs/45314641652) · [Passing hosted WARP run for the prior snapshot](https://github.com/muhammed-aksoy/VIctory/actions/runs/45315293863) - [x] Jeremy independently ran the workspace library suites on `e440f47`. He reported 512 passed, zero failed, and 19 ignored across 11 test binaries. [Independent verification](https://git.gtahub.st/github/Marvisak--VIctory/pulls/231) ## Integration fixes The earlier batch combined the stack-size setting with Agility SDK exports, reconciled the depth bounds and host queries documentation, restored the GPU query test's FXC dependency, and removed duplicate shader match arms. This update supplies the optional PSV field in existing shader fixtures, explicitly parses the storage quota as `u64`, records late frame ticks before returning from the wait, and preserves diagnostic tick logging. The refreshed synthetic PE test now expects the parser to reject an unterminated TLS callback array, matching the stricter parser already in the batch. ## Included PR numbers ```text 9, 12, 17, 20, 55, 69, 72, 76, 82, 83, 87, 88, 89, 93, 96, 98, 101, 104, 105, 110, 111, 113, 115, 119, 120, 121, 122, 123, 124, 126, 130, 132, 139, 141, 143, 149, 150, 151, 153, 158, 159, 160, 161, 163, 167, 169, 172, 174, 175, 177, 179, 182, 183, 185, 186, 188, 190, 191, 192, 194, 196, 197, 198, 200, 202, 204, 207, 209, 213, 214, 217, 219, 221, 222, 228, 229, 236, 238, 239, 240, 245, 247, 248, 249, 259, 260, 263, 270, 273, 276, 278, 279, 280, 285, 287, 288, 299, 302, 310, 311, 313, 315, 319, 322, 323, 324, 326, 329, 331, 333, 335, 337, 341, 343, 345, 347, 351, 353, 355, 356, 357, 358, 359, 361, 362, 364, 368, 369, 370, 371, 372, 373, 377, 378, 379, 381, 382, 384 ``` ## Conflicts in the latest refresh Some entries are updated heads whose earlier revision still appears in the included list. ```text 101, 158, 159, 177, 185, 241, 315, 354, 360, 363, 365, 367, 374, 376, 380, 383, 385, 387 ``` ## Conflicts from the preceding batch ```text 232, 233, 234, 235, 237, 241, 242, 244, 246, 250, 251, 254, 256, 261, 265, 269, 275, 281, 282, 284, 286, 290, 292, 294, 298, 301, 305, 306, 307, 308, 309, 312, 317, 318, 320, 321, 328, 332, 334, 336, 342, 346, 349, 352 ``` ## Current upstream status Upstream main advanced to ffe310e. Native Windows validation at that commit passed 342 tests, the all-targets/all-features build check, and the asset policy. The results above refer to the published integration snapshot e440f47. Of the 138 PRs in that snapshot, 26 are now merged upstream, nine are closed (including PR 287), and 103 are still open. A local rebuild from current main found 80 Git-clean merges, 22 merge conflicts, and one PR whose change was already represented. The candidate remains under review because the shader thread-ID regression fails after the merge. It also exposed an XMA packet traversal regression when carrying PR 96. There were 245 open PRs numbered after 387 at the audit, and they were outside this rebuild.
Many issues do not give the data that is necessary to find the cause:
the VIctory commit, the game build, the CPU, the GPU and driver, and the
crash log. Some are only one line of output.

- Bug report form. All the fields above are necessary.
- Feature request form.
- Blank issues are disabled, so each issue uses a form.
- PR template with the sections "What" and "Tested", as in PR #4.
- A workflow fails a PR when "What" or "Tested" has no text.

The bug report form tells the user to attach no game files (docs/asset-policy.md).
A new workflow runs `cargo fmt --all -- --check` on each push to main
and on each pull request. It uses the toolchain that
rust-toolchain.toml gives and rustfmt.toml, so it agrees with a local
`cargo fmt`. It runs on Linux, because rustfmt does not compile code.

The tree is not formatted yet (26 files), so the check fails until a
`cargo fmt --all` commit is merged.
The console's GPU allows uses of some formats that other host GPUs do
not. On an RTX 4070 two 2560x1440 textures failed to create with
E_INVALIDARG (vkd3d-proton: "Requested resource flags #5, but no format
in cast list supports it"): format 86 (BGRA8) with unordered access, and
format 115 (B4G4R4A4) as a render target.

When creation fails, try again without unordered access, then without
render-target use, as is already done for depth targets that ask for
unordered access. The views the host cannot make are skipped. A clear
value is only passed while the texture is still a render target or
depth target, since the host refuses it otherwise.

Not checked: whether the title draws to or writes these textures in a
way that now goes missing.

Tested: Linux (Wine 11.21, vkd3d-proton 3.1), i7-12700K, RTX 4070. The
two textures are created and the title runs on.
Speech streams were always empty WAVE files, so narration was silent.
They are now spoken by the WinRT speech synthesizer in the host's
default voice, on a thread of our own in the multithreaded apartment,
then mixed to mono and resampled to the 16 kHz 16-bit PCM the silent
stub already used. SSML the host refuses is spoken as its plain text.
A stream handle is its boxed WAVE file, freed when the stream closes.
With no voice, or off Windows, streams stay empty WAVE files.

victory-hle now depends on windows on Windows (it was diagnostics-only)
with the Foundation, Media_Core, Media_SpeechSynthesis and
Storage_Streams features.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ADVANCE_XMA_READ added the title's block count to the 5-bit read block
in u32 before taking it modulo the ring size, so a count near u32::MAX
overflowed (a panic in debug builds). The count is reduced modulo the
ring first; the result is the same for every count that did not
overflow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
kernel_will_write (fread's size times count, saturated) and
title_memory_remapped added the length to the address unchecked, so a
huge fread count overflowed (a panic in debug builds). The end now
saturates at the top of the address space.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each rANS symbol scanned all of its model's bucket starts to find the slot's
bucket, then rebuilt the symbol's frequency and start from the symbol. A
per-model table of the bucket at each 256-slot window's first slot now starts
the search, which steps over the few buckets that begin inside the window; the
symbol, frequency and remainder come straight from that bucket. The lane loop
also keeps the record offset instead of dividing by the symbols per block on
every symbol.

Synthetic streams, release, one core (median of 3 runs, 16384 blocks):
BC1 177 -> 128 ns/block, BC4 184 -> 128, BC7 591 -> 452.

Tests: the window lookup against the scan for every slot of every model
(shipped tables, uniform tables, one-slot buckets); a payload step against the
first version's arithmetic on the shipped tables; every format's lane layout
round trips at 1 to 1000 blocks; an ignored throughput benchmark.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The cap warning only said how many descriptors the host made, so a capped
NVIDIA heap gave no clue how many title slots were lost. Report what the
title asked for, what the host made, and the difference.

This replaces the earlier per-read report: main now logs the highest
past-heap slot in mirror() and #21 remaps the root tables that reach it,
so a second report of the same reads would only overlap.

docs/view-heap-limit.md is updated for #21 landing: root tables are
remapped, State::tables makes tables afresh for a CBV or a past-cap entry
(no descriptor-count rule), and #16 is an RTX 5070 Ti. The sampler heap's
2,048 limit is left as a separate issue.

Verified with cargo check -p victory-gpu --all-targets and cargo test
-p victory-gpu (36 passed).
A frame that ends in a packet where no frame begins (the tail of a frame that crossed packets, then padding) left the next frame pointing into that padding, which ended the stream early. Now the next frame is found by following each packet's skip to the next packet with frames.
A wave reduction that reads a row total with v_permlane16_b32 left the value unknown, so the wave operation was not recognised. It now picks within the lane own row, like v_permlanex16_b32 picks from the other row, and both only with every lane active (fi and bound_ctrl decide what an inactive lane reads).
CreateFileA, GetFileAttributesA, fopen, fopen_s and the narrow
std::_Fiopen turn the title's virtual-drive path into a host path and
then passed it to our own wide wrapper, which looked it up a second time.
When the host path starts with a letter that is itself mounted, it was
rewritten again: with the game on a host G: drive (say G:\GTA6), the
title's G:\x64\a.rpf became G:\GTA6\x64\a.rpf and then
G:\GTA6\GTA6\x64\a.rpf, so every narrow open of a title file failed.
The same happens for T: when the data folder is on a host T: drive.

They now call the host's wide function directly, as DeleteFileA,
SetCurrentDirectoryA, _open, _stat64i32 and remove already do.
Module::write dropped unread phis by sweeping every instruction until a
sweep changed nothing, allocating an operand Vec per instruction per
sweep. A chain of merges needs one sweep per merge, so the cost grew with
instructions x merges. A worklist now visits each instruction once and
reads operands through a callback; the block DFS, latch folding and the
call/phi/gep records stop allocating too. The written bytes are the same
(pinned by a test against the previous writer's output).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Our own completions looked their call up again by block address: after a
provider's DoWork returned, after a cancel, after a failed begin, and when
queued DoWork ran. A provider usually ends its call itself (XAsyncComplete
from DoWork or Cancel), and once it has, the title may begin a new call on
the same block, from its completion routine or from a thread that polls
the status. The lookup then found that new call:

- the old call's DoWork result (S_OK, size 0) or cancel (E_ABORT) ended
  the new call before it had done anything, ran its cleanup and fired the
  completion routine a second time;
- DoWork still queued for a canceled call ran the new call's DoWork.

Each queued DoWork now carries the call that scheduled it and runs only
while that call is still the block's, and DoWork, cancel and begin
complete that call. A call that is already over ignores a second
complete, so nothing reaches the next call. XAsyncComplete itself still
goes by block, as providers name their call by its block.
Fail when a requested scan root cannot be opened. Report traversal errors below a readable root alongside the other skipped inputs.
Co-Authored-By: GPT 6.2 Sol <[email protected]>
These decode and are tracked in ir.rs but the lowering had no case for them, so any shader using one failed to translate with Unsupported.
Ask Windows for the live allocation type before guarding physical-page views. Keep the existing VirtualQuery fallback for unknown region flags and query failures. This avoids walking a long run of read-only pages solely to learn its memory type.

Validate ordinary mapped files, executable images, private stack memory and free addresses alongside the existing pagefile guard and write-watch tests.
A raw buffer view on the host must start on a multiple of 16 bytes; the
console needs only 4. buffer_srv and buffer_uav move a view's first
element by where its memory sits in the host copy, so a title's raw view
could land on 4, 8 or 12 bytes past a 16-byte boundary. The host then
refuses CreateShaderResourceView (or CreateUnorderedAccessView), and the
device is removed (0x887A0001). A user report from the world:

  CreateShaderResourceView: When creating a RAW Shader Resource View, the
  offset of the first element from the start of the buffer must be a
  multiple of 16 bytes. Thus, FirstElement (42261210) must be a multiple
  of 4 since each element is 4 bytes.

Such a view is now refused like one that is not on an element: the slot
gets a null view of its kind (reads zeros) and a warning is logged once.
Starting the view 16 bytes lower would need the shader to add the
difference.

Type-checked and clippy-clean for x86_64-pc-windows-msvc (cross-checked
from Linux with -Zbuild-std); not run against the title.
Many issues do not give the data that is necessary to find the cause:
the VIctory commit, the game build, the CPU, the GPU and driver, and the
crash log. Some are only one line of output.

- Bug report form. All the fields above are necessary.
- Feature request form.
- Blank issues are disabled, so each issue uses a form.
- PR template with the sections "What" and "Tested", as in PR #4.
- A workflow fails a PR when "What" or "Tested" has no text.

The bug report form tells the user to attach no game files (docs/asset-policy.md).
The README warns that entering the world can remove the host device, and the
Debugging table already lists the switches that answer the question (DRED, GPU
timing, GPU-based validation, WARP). What was missing is the short list of
facts a report needs for those answers to be usable: the adapter and driver
version, the Windows build, whether the software adapter reproduces it, the
tail of crashes.log, the variables that were set, the build profile, and how
the failure ended.

Reports that arrive without the driver version or the OS build cannot be
compared with each other after a driver update, which is the position two of
the current GPU issues are in.

Nothing from the title's data is asked for anywhere in it, and the section
points at docs/asset-policy.md for that rule.
# Conflicts:
#	crates/victory-shader/src/emit/mod.rs
Bools::vars kept the nodes and variables it had seen in lists and scanned
them for every node, quadratic in the diagram's size; it now uses a set
that scans a short list while it is small and hashes once it grows.
Bools::given cofactored the diagram once per decided atom, each walk with
a fresh table; cofactors of different variables commute, so it now
replaces every decided atom in one walk. Equal functions are equal nodes,
so the results are the same nodes as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A callback submitted with a delay waited on a thread of its own and was
delivered when the delay ran out, whether or not the queue had been
terminated meanwhile. XTaskQueueTerminate only canceled what was already
in the ports, so a pending delayed callback was not canceled: it ran
later as live work (canceled = false), after the termination callback,
by which time a title may have freed what the callback uses.

The queue now keeps its delayed callbacks in a list until their delay
runs out. Terminate cancels them along with the queued ones, before it
calls the termination callback, and a delay that runs out after that
finds nothing to deliver. A submit racing Terminate checks `terminated`
under the list's lock, so the callback is either canceled or refused.
AI-assisted (Claude Code)
VICTORY_PROFILE=1 logs a summary every few seconds: frame intervals with
avg, p50/p95/p99, max, 1% low, hitches and stutters; the work per frame;
process memory and resident bytes; cache hit rates; the timed scopes that
took longest; the biggest and slowest loads. VICTORY_PROFILE=<dir> also
writes frames.csv (one row per presented frame) and trace.json (Chrome
trace events for Perfetto). Off, every hook is one relaxed load.

Nothing calls it yet; the aggregation is unit-tested without a GPU.
With VICTORY_PROFILE set: every presented frame (its present number, as
VICTORY_CAPTURE counts, size, format, draws and dispatches since the last
one, time spent presenting), each submission's preparing and fence wait,
shader translations and pipeline creations timed, the shader container
table and the disk cache as caches, texture refreshes (unchanged textures
as hits), descriptor heaps, upload buffers, resident GPU memory and host
textures, the adapter's video memory and budget, and a full dump before a
host GPU failure ends the run.
victory run calls victory_profile::init. With VICTORY_PROFILE set: ReadFile
and fread timed with their bytes, big (1 MiB) or slow (5 ms) reads named
as file loads, every DirectStorage request a load under the title's name
for it and by what it decodes, XMemAlloc/XMemFree timed, the default
allocator's resident bytes, XMemVirtualAlloc bytes, XMA frames and Opus
packets timed.
VICTORY_PROFILE_DUMP=<seconds>,... now also runs the VICTORY_STACKS dump,
so one report has the frames, memory, caches and where each thread is.
The dump before a host GPU failure does not suspend threads.
The panel is plain data in victory-profile: its lines from the last 120
frames and the samplers, an embedded 5x7 font as '#' strings, a graph of
the frame intervals, and the rows in the back buffer's format (RGBA8,
BGRA8, RGB10A2, RGBA16F). Redrawn at most four times a second. Off unless
VICTORY_PROFILE_OVERLAY=1 or VICTORY_PROFILE=overlay; tests for the text,
the font, the layout and the encodings.
The presenter copies the panel from a kept upload buffer into the back
buffer's corner with CopyTextureRegion, after the frame and before the
present: no shaders or pipelines. F3 while our window has focus shows and
hides it. Host pipeline lookups count as cache hits and misses.
Co-Authored-By: GPT 6.2 Sol <[email protected]>
MapViewOfFile3 with MEM_REPLACE_PLACEHOLDER replaces exactly one
placeholder: the range must be the placeholder's own. map() split the
placeholder around the range and mapped one view over it, so it worked
only when the range lay in a single placeholder. Every mapping leaves its
reservation split at its ends and unmapping does not join the pieces, so
after a partial unmap, a scattered mapping or a shorter earlier run, a
run over those pages failed with ERROR_INVALID_ADDRESS and
XMemMapPhysicalPages returned NULL, its range already unmapped.

map() now splits only at the run's two ends and gives each placeholder in
the range a view of its part. Placeholders are never coalesced: the host
also coalesces placeholders of separate reservations, and pieces a title
split itself would stay joined after the unmap. If a view fails, those
made before it become placeholders again. The split call also frees
memory that replaced a placeholder back to one, committed pages
included, so split_at() splits only where everything below the split
point is reserved.

New tests: a run remapped after a partial unmap, a run from one
placeholder into the next, a title-split piece kept through a map and an
unmap, and a failed run that is rolled back without touching committed
memory next to it. The first three fail on main (XMemMapPhysicalPages
returns NULL). cargo test --workspace passes on Windows 11. Wine's
virtual.c splits placeholders into separate views and reports them the
same way (AllocationBase, region end, exact MEM_REPLACE_PLACEHOLDER
match); not run under Wine.
The d16 forms of the typed buffer loads return each channel as 16 bits,
two per VGPR, low half first; the decoder already sizes their data that
way. The lowering only treated `buffer_` names as d16, so a
tbuffer_load_format_d16_* went through the 32-bit path: the first VGPR
got channel x as a 32-bit value (the f32 bits of 1.0 instead of the f16
pair (1.0, 2.0)) and the other channels were dropped.

The format path now packs its channels for d16: integer formats keep
their low 16 bits, the other formats become f16 (as the MUBUF d16 path
converts them).
Each import the title binds, and each GetProcAddress on a host module,
went through registry::lookup: every module lower-cased the DLL name into
a fresh String to test its patterns, then every export of the serving
modules was compared by name. A miss, which every import we leave to the
host is, paid for all of it.

The registry is now indexed once by export name, in registry order, with
the first export of a name in each module. A lookup hashes the name (FNV,
the keys are our own export names), and only the modules exporting it test
their patterns, case-insensitively and without allocating. The first
serving module and its first export still win, as in the scan.

Release, one core, every registry export under each DLL name that serves
it plus one host-only miss per name (605 lookups, best of 5, 3 runs):
scan 444-489 ns, index 41-46 ns per import (10.3x-11.8x).

Tests: the index against the old scan for every DLL pattern (as written,
upper-cased, versioned API sets) by every export name and misses, on the
registry and on overlapping synthetic modules; pattern matching against
HleModule::serves; registry patterns are lower case; 300 modules sharing
a name keep registry order; an ignored throughput benchmark.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Textures in memory with no write watch (the physical-page views of the
texture pool) were checked with committed() and then read directly,
twice (hash, detile). A title unmapping those pages in between, for
example evicting a texture a big descriptor table still lists, faulted
on the read, and the vectored handler takes only writes. The memory is
now read through copy_mapped (ReadProcessMemory, zeros for unmapped
pages), as the watched path already does, into a per-thread scratch
buffer reused between textures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A DualSense is not an XInput device, so the title never saw one even though
GameInput reports pads. Read the pad's HID input reports on a thread and
expose them in the shape the XInput source returns, on slot 0 when no XInput
pad answers there.

USB input reports (0x01, 64 bytes) and Bluetooth reports (0x31, 78 bytes)
place the buttons and triggers at different offsets. Read the fields through
Windows' HID parser (HidP_GetUsages/HidP_GetUsageValue) by declared usage
instead of by fixed offsets, so both transports and the DualSense Edge share
one mapping. Square, cross, circle and triangle become X, A, B and Y;
shoulders, create/options, stick clicks and the hat map to their pad bits;
sticks are centered and Y is inverted. Touchpad, gyro and lightbar have no
pad surface in the title and rumble is not sent back yet.

The keyboard also plays Circle on O, next to Enter's Cross.

Tests: cargo test -p victory-hle --lib dualsense, cargo test -p victory-hle,
cargo build --release -p victory. Verified live on Windows: the title
registered a gamepad callback (kind 0x40000), pad 0 connected, and presses
and analog triggers arrived.
Threads created without a stack size take the executable's default
reserve, 1 MiB from the linker. vkd3d-proton's and the driver's own
threads compiling the title's large world shaders overflowed it under
Wine on an RTX 4070 (four threads at one driver address during the world
load). Reserve 16 MiB for MSVC targets; pages are committed only as used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep the kind-21 enable flag in the graphics state and pipeline cache
key. Use DEPTH_STENCIL1 for vertex and mesh streams that request the
test when the host supports it. Unsupported hosts fall back to the
plain depth-stencil state and warn once.

Forward the title's depth bounds to the host command list and replay
them when binding a graphics pipeline, including after the indirect
clamp. New and reset lists start with D3D12's 0..1 default.

Synthetic title draws and mesh dispatches on an RTX 5070 and WARP
kept excluded pixels at the cleared depth of 0.5 and wrote 0.25 to
included pixels. Fresh and reset lists also wrote 0.25. A forced
unsupported run drew all pixels, and the stream reader regression
failed with the upstream reader. The console subobject layout and
call signature still need title-side verification.
No query ran on the host GPU: BeginQuery/EndQuery did nothing and
ResolveQueryData wrote stand-ins (every occlusion query 2^20 samples,
every binary one visible, statistics zeros, timestamps the clock after
the submission), so nothing a title decides by a query was real.

Now:
- A title query heap of a type the host has (occlusion, timestamp,
  pipeline statistics; at most 2^18 queries) gets a host heap of its
  size on first use.
- BeginQuery/EndQuery record into the list's host list, in order with
  its draws. Following D3D12's rules: timestamps only end; a query
  running in the list already does not begin again; an end without its
  begin in the same list is dropped; queries still running when the
  list closes are ended there.
- ResolveQueryData resolves on the host the queries whose last run
  there was of the type resolved. Occlusion and statistics results go
  into the title buffer's host copy at the resolve's offset (declared as
  a GPU write, so the submission's copy-back puts them in title memory,
  and later commands read the copy). Timestamps go through read-back
  memory and are put on the title's GPU clock (100 MHz since the first
  use, as GetTimestampFrequency and bottom-of-pipe timestamps say) from
  the queue's clock calibration against the performance counter, never
  past the time they were read.
- Everything else keeps the stand-ins: queries not run on the host, a
  heap of another type, indices past the heap's end, destinations not
  8-byte aligned in their copy, the console's other query types, and no
  host GPU. The resolve's bounds check no longer overflows on offsets
  near u64::MAX (as open PR #52 does).

Tests drive the title's list, queue and heap methods on the host GPU
(RTX 5070), skipping without one; the draws come from a small host
pipeline recorded into the title list's host list, since title
pipelines need translated console shaders:
- a full-screen 64x64 triangle counts 4096 samples and is visible; one
  scissored away counts 0 and is not; its statistics are 3 vertices, 1
  primitive, at least 4096 pixel shader runs; the bytes around the
  results stay; the host copy holds the results;
- two timestamps around 64 draws come out in order, between the GPU
  clock before (less 1 ms) and after the submission;
- queries not run, of the wrong heap, past the heap or the buffer, or of
  unknown types keep the stand-in values (with or without a host).
The query tests are clean under the debug layer and GPU-based
validation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With real occlusion queries, a title draw the host does not run (its
pipeline is not ready yet, its shader does not translate, an indirect
execution that cannot run) left the query counting too few samples,
often none, and a title culls by that what the draw would have shown.
While most of the world's draws are still dropped that would hide more,
not less.

A host list now marks the queries running in it when a draw, mesh
dispatch or indirect execution is not run, and such an occlusion or
binary occlusion query is ended on the host but not taken as measured:
its resolve writes the stand-in (2^20 samples, visible) as before host
queries. Pipeline statistics keep what the host counted.

Test (RTX 5070): a title DrawInstanced with nothing bound inside
occlusion and binary occlusion queries resolves to the stand-ins, a
query begun after it measures 0, statistics measure the host draw. It
fails without the marking (0 samples instead of 2^20).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Synthesize one compute fixture per opcode table entry and run the translation passes. Diagnose refused instructions even when their results are unused, and identify opcode panics or timeouts in an isolated test process.

List the refused set and provide an opt-in report grouped by encoding and reason. An opcode that stops lowering fails the regular test; one that starts lowering only makes its line stale, so changes that lower opcodes need not touch the list. The baseline covers 1,233 entries without game data.
Image samples and gathers now lower by their form (comparison,
derivatives, coarse or 16-bit derivatives, level, level 0, bias, level
clamp, texel offset) instead of a fixed list of opcodes. The address
dwords follow LLVM's ImageDimIntrinsics and Mesa's ac_build_image_opcode:
offset, bias and reference a dword each, then the derivatives (16-bit
ones two per dword, each direction its own), the coordinates and the
level or clamp. The decoder counted 32-bit derivatives for the _g16
forms; it now counts them packed.

Newly lowered:
- every texel-offset form of the samples above; DXIL immediates when the
  offset word is a constant in -8..7, else (past -8..7, or per lane) the
  coordinates move by offset / size at a level known at translation;
- _cl (the DXIL clamp argument), _cd (as _d), _g16;
- image_sample_c, _c_cl and their _o forms in compute as well as pixel
  shaders; image_sample_c_l(_o) with a level, image_sample_c_b(_cl)(_o)
  with a bias known to be 0;
- image_gather4_l(_o) with a level known to be 0, image_gather4_c_lz(_o),
  image_gather4_c_l(_o) at level 0 (textureGatherCmp);
- a16 biased samples (the bias an f16 in its dword's low half) and a16
  comparisons;
- image_store of some channels: the data VGPRs are the dmask's channels,
  the others are written as 0.
Still refused, each with its reason: gathers at an implicit level or with
a bias, comparisons with derivatives, at a level or with a bias not known
to be 0 (SM 6.7/6.8 operations), and offsets past -8..7 or per lane at a
level not known at translation.

Tests: hand-assembled compute programs on the RTX 5070 against texels
worked out on the CPU (offsets known, past -8..7 and per lane; levels,
gradients, g16, bias and clamp through compute quads; comparisons and
comparison gathers per texel; partial stores, d16 too), every newly
accepted form through the validator, and the refusal reasons. On
upstream/main all of them fail ("... is not supported").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add scalar bit counts, searches, field and packing operations, and vector integer multiply-adds, SADs, dot products and saturating conversions. Use IEEE bits for frexp, class and double compares so NaNs, signed zeros and denormals survive.

Add synthetic compute tests with live DXIL results compared against CPU references. Validate the shaders with the Windows SDK validator and run them on the RTX 5070. The opcode audit moves 106 mnemonics from refused to lowered.
Co-Authored-By: GPT 6.2 Sol <[email protected]>
Reserve a new staging path and clean it up if writing or publishing fails. Cover a failed publication with a synthetic destination directory.
Report an index read failure instead of counting the file as checked.
XMemMapPhysicalPages with a count of 0, and the GPU's page-mapping copy
of a zero-length range, went into unmap with an empty range. Its search
for views starting inside asked the view map for a range that runs
backwards, which BTreeMap panics on once any view exists; in an
extern "system" function that aborts the process. Without that panic
the view holding the address would have been unmapped and mapped again
as two.

unmap now returns at once for a length of 0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
imdct_half worked out every pre- and post-rotation with sin_cos on each
call (n of them per subframe) and ran its FFT on two fresh Vecs. The
rotations, the bit-reversed order and the butterfly rotations now come
from a table built once for 128, 256 and 512 samples; the work buffers
live on the stack. Every value is computed with the same expression (the
butterflies with the same running product), so the output is bit for
bit what it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
frame::wait marked the tick it waited for as taken (LAST) only after
the sleep, outside the clock's lock, so two threads waiting for one
event kind at once both got the same tick and both returned on it,
against the module's once-per-tick rule (an origin wait then begins two
frames in one interval). next_tick now takes the tick under the clock's
lock when the wait comes within its time-out; a time-out takes none, as
before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A texture UAV read as float and used atomically in the same program got
the float handle for its atomic: dxil-spirv then emitted OpAtomicOr on a
float texel pointer (invalid SPIR-V), and the NVIDIA compiler crashed in
vkCreateComputePipelines when GTA VI entered its world (two programs:
c12c1f7296419a5b, 8358f9eef7931421). With the type in the key the atomic
gets its own uint handle; all dumped SPIR-V validates.
- Buffer-to-texture CopyTextureRegion: widen packed 16-bit (86/115) placed footprints to R8G8B8A8_UNORM and expand texels on the CPU at submission (packed <-> RGBA8 helpers and unit tests added for uploads and readbacks).
- texture::upload: detile widened packed 16-bit textures into a tight 2-byte buffer before expanding rows into the 4-byte host staging footprint.
- GPU-to-GPU CopyResource, CopyTextureRegion, and ResolveSubresource: skip mixed native-packed <-> widened copies once per format before barriers or host_written, and map resolve formats through target_format.
- view_format: return None for typed widened targets so null view descriptions inherit the host resource dimension.

AI-assisted (Claude Code)
The Proton example ran $PWD/victory.exe, which only exists if copied
there, and wrote host.out.log/host.err.log into the repository root.
Point it at target/x86_64-pc-windows-msvc/release/victory.exe and put
the logs in a per-run folder under ~/.local/share/victory/logs.
Co-Authored-By: GPT 6.2 Sol <[email protected]>
Co-Authored-By: GPT 6.2 Sol <[email protected]>
An illegal or privileged instruction is reported by its address only,
which does not say which instruction it was. On an Intel host that is
the question every such report raises (clwb, clzero, rdpru, an SSE4a
form...), and reporters have had to guess or dump the bytes by hand.

The report's first line now ends with up to 15 bytes at the faulting
address, as hex, read no further than the end of that page, so the
report names the instruction by itself.
A path on a virtual drive was handed to the host as the host folder
followed by the title's tail, so the host resolved `..` against the host
folder: `X:\..\f` named a file beside the drive's folder, where on a
drive of its own `..` stops at the root and the path is `X:\f`. Long
paths (the `\?\` form) already resolved `..` here and stopped at the
root, so the same title path named different files depending on its
length.

A tail with a `..` part is now resolved here in the short form too, with
the clean-up the long form uses. Other paths are passed on as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Decoder::decode took the caller's bit count as the end of the frame. Past
the data the bit reader returns zeros, and a stereo tile header reading
only zeros gives the subframe to no channel, so it never moves on; with a
count beyond the data it never overreads either, and looped for good.
Clamp the end to the bits the data holds. A frame from read_frame always
holds its bits, so its decoding does not change.

Add deterministic noise tests (xorshift64, fixed seeds, as BCPack's):
buffers of noise packets, streams of noise frames with clean and damaged
headers, frames in mono and stereo at each sample rate, bit counts past the
data, and read_frame and packet at any offset. Every walk is bounded and
every decode must give one frame of samples. The bit-count test hangs
without the fix; the others pass on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GetModuleFileNameA/W on the host clears the thread's last error when
the name fits, and code tells a truncated name from a whole one by it
(grow the buffer while the last error is ERROR_INSUFFICIENT_BUFFER; or
fail if it is, also when the name filled the buffer exactly). Our
answer for a title image set the error when the name was cut and left
it alone otherwise, so after one call with too small a buffer, or
after any earlier call on the thread that left 122, a whole name still
read as truncated.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The static TLS redirect tested the whole 9-byte `mov r64, gs:[0x58]`
pattern at every byte of every executable section. It now skips with
SSE2 compares to the offsets that hold `gs`, `8B` two bytes on and `25`
four bytes on, and tests the full pattern only there. Offsets without
those three bytes cannot match, so the patched bytes and the count are
the same as before.

A test checks the new scan against the old byte-at-a-time one on random
code with loads, near misses and overlaps, at every word alignment. An
ignored release benchmark (tls_scan_speed) times both on 1, 16 and
128 MiB of synthetic code: 8-9x faster.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The clamp was HLSL compiled at run time by the system's D3DCompile. Wine's
d3dcompiler_47 rejects it (no Load on RWByteAddressBuffer, no store to a
structured buffer, and the RootSignature attribute is ignored), so under
Wine and Proton clamp() failed and every indirect execution was dropped.

The same shader is now emitted as DXIL by the shader crate
(emit:🗜️:argument_clamp) and its root signature is made from a
description, so no shader compiler is needed on any host. For that the
shader builder learns root UAVs (raw buffers), beside root CBVs and SRVs.

Two GPU tests run the clamp over records of each kind and compare with
the bounds written out in Rust, and check that records past the list's
budget run empty.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
VIctory stays a Windows program; on Linux it is cross-compiled for
x86_64-pc-windows-msvc with cargo-xwin and run under Wine with
VKD3D-Proton and DXVK. The README gains the steps; shell.nix gives Nix
users the toolchain (rustup, cargo-xwin, clang-cl, lld-link, llvm-lib)
and a Wine prefix of VIctory's own. The asset policy allows .nix files.

Wine's ws2_32 lacks WSAConnectByList and GetAddrInfoExA, and its winhttp
WinHttpGetProxySettingsEx. Forwarding to them panicked; now
WSAConnectByList tries each vetted candidate with connect (blocking, the
timeout not kept) and GetAddrInfoExA answers WSAHOST_NOT_FOUND, as for a
blocked name. The export test exempts the three.

view_format is Windows-only like host_resource, its only callee, so the
workspace's host-side crates build natively again.

The pre-commit hook is executable: git skipped it on Linux, where
`cargo xtask install-hooks` said it was installed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When a frame ended a loop, decode cut it at the loop's end subframe, set
the loop's skip (the subframes of the loop's first frame that lie before
the loop) and then took that skip out of the frame in hand: the loop's
last. So the head of the last frame was dropped instead, and the first
frame played from its start, with the audio before the loop in it. The
number of samples came out the same; the seam did not.

The pending skip is still applied to the frame in hand, and the loop's
skip is set after it, for the frame decoded next.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: GPT 6.2 Sol <[email protected]>
An access violation is reported with the address it touched and
nothing else, so a read of free memory, a write to memory that was
reserved but whose commit failed, a stack guard page and a write to
code or constants all look the same in a report.

The report now adds what VirtualQuery says is at that address: nothing,
reserved but never committed, a guard page, or the page's protection,
with the module for an image's pages.
Windows 10's in-box D3D12 stops at shader model 6.5 and refuses root
signatures with the directly indexed heap flags (c01), so every
translated pipeline was refused and nothing drew (#84).

victory.exe now exports D3D12SDKVersion (620) and D3D12SDKPath
(.\D3D12\), and `cargo xtask agility` fetches Microsoft.Direct3D.D3D12
1.620.2 from nuget.org, checks its published SHA-512, and puts
D3D12Core.dll and d3d12SDKLayers.dll in target\<profile>\D3D12\. The
DLLs never enter the repository. Windows 11, or a missing folder, keeps
the in-box runtime.

`victory config` reports whether the runtime is in place, and the SM 6.5
error names the command.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Whether a crash is a missing instruction depends on the CPU (Intel CPUs
lack some of the console's AMD-only instructions), and which D3D12
runtime there is depends on the Windows build, yet a report carries
neither, so every report has needed a follow-up question.

Unhandled exceptions, panics and host GPU failures now end with a
"host:" line naming the CPU's brand string and the real Windows
version (RtlGetVersion), read once when the crash log is set up.
The source resolver's rule (local files only) knew a share as `\..`,
`//..` or `file://server/..`. The host knows more spellings: any two
leading separators (`/\server\share`), the object manager's prefix
(`\??\UNC\server\share`), and a `file:` URL with no host whose path
starts with two separators (`file:////server/share`,
`file:\server\share`, also percent-encoded). Those fell through as
relative paths or drive-less local files and went to the host's
resolver unchanged.

They are refused now, naming the server. Paths with one leading
separator, a drive after the slashes or the prefix, and the path of a
URL that names this machine pass as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A provider's folder is the user's folder plus the configuration id as a
file name. An empty id gave the user's folder itself, where the other
configurations' folders are. Opening the provider converts containers
of the old layout, which are folders without a `~` or a dot in their
name, as a configuration's folder is: each was taken for one, an empty
container was committed in its place and the folder was removed with
every save in it.

An empty id is now treated as no id (the default configuration).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Based on #34 by ka1qux (commit faa0a9a), rebased over #45, which added the
same flag and register helpers for clwb loops; the duplicates are merged
into gpr/cmp_flags/CMP_FLAGS.

clzero: the two loops compilers build around it are done whole in one
exception, leaving registers and flags as the last pass would. Anything else
around it is one line and the next instruction.

rdpru: returns the time-stamp counter for MPERF and APERF, 0 for other
counters, and leaves the flags as they are: a Ryzen 7 5800X3D running it
natively in user mode changes none, for known counters or not.

Added over #34:
- loop 1 rejects cmp rax, rax (it fell into the loop and left wrong flags);
- tests that go through the emulation on any CPU (both loop shapes, the
  rax-rax and wrong-neighbour fallbacks, rdpru with both flag states), since
  on an AMD host the native tests never enter the handler.
XGameSaveCreateContainer, XGameSaveCreateUpdate and
XGameSaveInitializeProviderResult left the title's handle untouched when
they failed. The GDK documents those handles as null on failure, and
its own sample closes them on that basis ("if (containerContext)
XGameSaveCloseContainer(...)" on a variable it never initialized), so
a failed call made the title close whatever was on its stack: a heap
corruption far from the failure that caused it.

Each of the three now nulls the handle before anything can fail.
Wine's ws2_32 lacks WSAConnectByList and GetAddrInfoExA, and its winhttp
WinHttpGetProxySettingsEx. Forwarding to the first two panicked (the
host lacks ...). WSAConnectByList now tries each vetted candidate with
connect (blocking, the timeout not kept) where the host has none, and
GetAddrInfoExA answers WSAHOST_NOT_FOUND, as for a blocked name.
WinHttpGetProxySettingsEx never reaches the host. The export test
exempts the three; a new test covers the connect fallback.

view_format is Windows-only like host_resource, its only callee, so
victory-gpu builds on non-Windows hosts again.

The pre-commit hook is executable: git skipped it on Linux, where
`cargo xtask install-hooks` said it was installed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XUserGetGamertag returned the name for every component, the modern
suffix included. The GDK documents the suffix as empty when there is
none, and a title that shows "name#suffix" whenever the suffix is not
empty showed "Player#Player".

The modern suffix (component 2) is now empty; the classic, modern and
unique modern components are still the name.
Under Wine without a sound driver, Grand Theft Auto VI stops about 15 s
in on an int3 assert of its own (title+0x4dcbc9d), in its loading-screen
loop. With no output device the title's audio never drains its command
buffer; the loop adds about 1.7 KB a pass to a 96 KB buffer until a
write no longer fits. Nothing in the assert points at audio.

When the audio decoder connects, count the host's output devices once
(waveOutGetNumDevs) and warn if there are none. The README notes that
Fedora ships Wine's sound driver apart from Wine, as wine-pulseaudio.

Tested: Linux (Wine 11.21 Staging, PipeWire), i7-12700K, RTX 4070. With
the prefix's audio driver disabled the warning is logged and the title
stops at the assert; with winepulse it logs nothing new and runs past
the loading screen.
Stack dumps (VICTORY_STACKS, diagnostics builds) read another thread's
TEB right after NtQueryInformationThread and suspended it only later: a
thread exiting in between frees its TEB, and the read faults. The
thread is now suspended first and resumed on every way out.

The dump times went through Duration::from_secs_f64, which panics on
`inf` or `1e20`, killing the dump thread (the crash hook logs it as a
crash). They are parsed by `schedule` now, which leaves out NaN and
times no Duration holds. 1 new test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
pending_with runs its work (a text-entry dialog) on a thread of its own
and lets the call complete when the work returns. Canceling ends the
call at once: the call is completed with E_ABORT and its state freed,
while the work goes on. When it returned, the thread wrote the result
into the freed state and completed the block, which by then might hold
the title's next call: that call ended with the old call's result.

The thread now shares the state (an Arc) instead of borrowing it, and
completes only its own call, while it is still the block's.
An unimplemented import with the default Trap policy printed its name
and aborted. abort() is a fast fail: it skips the exception handlers
and the panic hook, which are what append to crashes.log, so the most
common bring-up crash left nothing there, not even which import it was.

The trap now reports through log_crash, which prints the same line,
appends it to the crash log and adds the title's last debug output.
The console supplies reverb impulse responses as partitioned frequency-domain complex pairs. Decode that layout into a portable partitioned convolver so convolution streams return wet audio instead of silence. FFT/IFFT streams still return silence. Add seven unit tests for the convolver and an end-to-end test through XDspActivate and XDspSubmitCommand.
GFX10.3 sizes the derivatives of an image sample by its opcode (the _g16
forms hold them two per dword, each direction starting a dword) and the
coordinates and the level by a16, independently. The decoder and the
lowering took a16 to make the derivatives 16-bit too, so an a16 sample
with 32-bit derivatives had too few address dwords and read its
derivatives and coordinates from the wrong halves.

After LLVM's SITargetLowering::lowerImage where hasG16 (the opcode's
gradients are packed only for G16; "Don't compress addresses for G16"),
and its MC test gfx10_asm_mimg.s: image_sample_d ... 2D a16 has five
address dwords (four derivatives and the packed coordinates),
image_sample_d_cl ... 2D a16 six.

Tests: the decoder's address counts for image_sample_d, _d_cl, _d_g16
and _d_cl_o with a16 (5, 6, 3, 7); on the RTX 5070, image_sample_d with
a16 and 32-bit derivatives samples the level its derivatives pick at the
packed f16 coordinates. With the old sizing that case reads level 3 at
texel 0 for a lane that should read level 0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
XTaskQueueDispatch with an infinite timeout waited until a callback was
queued. Terminating the queue refuses new callbacks and drained the
queued ones without waking anyone, so a dispatcher thread's loop
(`while (XTaskQueueDispatch(queue, port, INFINITE));`, which ends by
terminating the queue) stayed in its wait for good, and so did whoever
joined that thread. A dispatch begun after the termination did the same.

A dispatch now also ends, returning false, when its queue is
terminated: the termination wakes the port's waiters after draining it.
The flag is the queue's, so a dispatch on another queue that shares the
port waits on.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The SOPP table had s_ttracedata_imm at 0x26, as Mesa's opcode list
does; RDNA2 encodes it at 0x28 (AMD's RDNA2 ISA, LLVM's GFX10 tables
and disassembler tests). A shader with the thread-trace marker decoded
it as an unknown opcode and failed to translate, though the IR drops
the marker as harmless.
Calls are filed by their block's address, and a call that succeeded with
a result stays filed until XAsyncGetResult takes it. XAsyncBegin refused
any block whose address had a call filed. So when a title never took a
result and freed the block, the next block it was given at that address
could not begin a call: E_INVALIDARG, every time, with the old call's
provider never cleaned up.

A zeroed block is a new one: the block of a result left behind holds the
result's size, so it never reads zero. XAsyncBegin now ends a finished
call filed under the address of a zeroed block (its provider gets its
cleanup) and begins the new one. A call still in flight keeps its
address, and a block still holding a result is refused as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
f32_to_half rounds to nearest by adding half an ulp to the mantissa,
then or-ed the shifted mantissa into the exponent field. When the
rounding carried out of the mantissa, that carry is the exponent's low
bit: or-ed into an odd exponent it was lost, so values just below a
power of two came out at the power below (2 - 2^-12 gave 1.0, not 2.0).
Rectangle lists use it for the fourth corner of half-float elements.

The carry is now added into the exponent.
The decoder fills an XMA voice's output ring until the write block
(word 0, bits 27-31) comes round to the title's read block (word 9,
bits 0-4). The write block wraps modulo the ring size (word 0, bits
22-26), and so does a read block moved on by command 18, but a read block
the title set up at or past the ring's end was compared as it was: no
write block ever equalled it. With a stream that loops forever the pass
never ended, holding that voice's lock, so the title's next command on
the voice (advance, disable) waited for good, and releasing the context
arrays did too.

Take the read block modulo the ring size as well, as the write side
already does. A test sets up read block 6 on a ring of four with an
endless loop and requires the pass to end within seconds, with blocks 0
and 1 filled.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The device answers QueryInterface for ID3D12Device and for its newer
levels (Grand Theft Auto VI creates it as ID3D12Device11). A device
child's GetDevice and the DXGI device's QueryInterface knew only the
first: asked for the device by the interface the title holds, they
answered E_NOINTERFACE with a null pointer.

Both now ask the device's own test (is_device).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
When a list stops deep in a long run of commands between two barriers,
the device-removed report listed the first 12 commands after the barrier.
Those have usually finished; the ones still running come after the stop.
It now names up to 40 commands from a few before the stop on (test
added).

VICTORY_SHADER_DUMP=<dir> (diagnostics builds) writes each shader
container and its DXIL as <hash>.bin / <hash>.dxil when it is translated,
so a hash from a DRED or timing line can be disassembled with
`dxc -dumpbin`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Render targets and depth buffers carry compression metadata on the console. Report an upper-bound reservation after the data planes in XG layouts so titles do not undersize pools. Keep the host's data-plane layout unchanged and avoid inventing metadata plane types whose usage codes are not published. Add unit tests for the sizing and the layout output.
constant_color() was used only by the two Windows-gated tests, so off Windows
it was dead code and victory-shader's tests built with a warning. A new test
parses the container it builds, checks the size field, the pixel-shader parts
in order, the DXIL program header and that the digest is container::hash of
the bytes after it. It needs neither D3D12 nor dxil.dll, so it runs on Linux.
A filter that tracing-subscriber rejects, such as VICTORY_LOG=victory_loader=loud,
was dropped without a word and the binary logged at its default level, so a
typo looked like the target had nothing to say. init now prints one line on
stderr naming the variable, its value and the parse error, then uses the
default as before.

Choosing the filter moves into choose_filter so it can be tested without
touching the process environment; five unit tests cover unset, VICTORY_LOG
over RUST_LOG, the RUST_LOG fallback, and a bad value in each variable.
When a program reads an image descriptor as data, descriptor_data
rebuilt word 3 from getDimensions' level count even when nothing reads
that word. vkd3d-proton turns the query into OpImageQueryLevels, and on
a 3D image inside a loop NVIDIA's Vulkan compiler crashes on it
(vkCreateComputePipelines, 0xc0000005 under Wine). Query the level
count only when word 3's register is read as data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reading and loading a title DLL report its path when they fail;
preparing it, in between, did not. A DLL the PE parser refuses ended
the run with just "malformed image: ..." (or the like), without saying
which of the title's DLLs it was.

The prepare step now adds "preparing <path>" like its neighbours.
Only constant_color uses them, so they live inside it (from #258). The
helper itself stays on every host for the hermetic container test.
No graphics object's interface list holds IUnknown, so QueryInterface
for it (and every call that hands out an object by interface id) said
E_NOINTERFACE and returned null. COM code asks for it to compare two
pointers for identity, to keep an object as a plain reference, or to
pass it on to an API that takes any object.

object::is, which all of those go through, now also matches IUnknown.
The DXGI device answers with the D3D12 device, which it already stands
for: one pointer whichever of the object's interfaces is asked.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
records() matched every marker in the file, so one inside a record's
packed bytes (a stored deflate block carries the container as it is)
could be reported as a second record. Resume the search after each
record's packed bytes. Synthetic test: a record whose payload is
another record, packed with stored blocks.
CheckFeatureSupport returned E_NOTIMPL for D3D12 feature IDs 5 and 6. Report plane counts for depth and stencil format families and the address widths already published through OPTIONS, with the same size and null validation as the other features. Add two unit tests.
The console lets a title view a texture in any format of its family: an
R8G8B8A8_UNORM texture as R8G8B8A8_UNORM_SRGB, say, or the reverse. `fits`
gave every such view of a typed host texture the texture's own format, so
the hardware did no sRGB-to-linear conversion where the title asked for
one, or converted where it did not: colours came out with the wrong gamma.

Hosts that report CastingFullyTypedFormatSupported (D3D12 options 3) let
views of a fully typed resource name another format of its family, with no
change to how the resource is made. sRGB and linear twins (8-bit RGBA,
BGRA, BGRX, and BC1, BC2, BC3 and BC7) now keep the title's view format on
such hosts; other casts within a family read as before, and hosts without
the cap keep today's behaviour with a warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured on Windows 11, RTX 2070 Super, Ryzen 5 3600, game folder on a
7200 rpm SATA hard drive: about 90 s at 30 fps and 3 draws/frame with the
drive 100% busy (100-350 reads/s, often under 1 MB/s) before the menus
appear. Runs closed earlier than that look like a hang.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The input table still listed rumble as missing, but set_rumble reaches XInputSetState. Remove the reference to a TODO.md that does not exist from the HDR note.
The crate's rustdoc listed BCPack and XMA2 as planned and the architecture
table still had BCPack under "planned", though both modules are in the
crate. List the three modules with links, and say where Opus and zlib are
decoded instead (victory-hle, with opus-pure and miniz_oxide).
A compute program whose root signature does not fit the 16 user SGPRs
finds its arguments through a spill table: s[0:1] holds a pointer (high
dword masked to 40 bits, usually copied to s2/s3 first) to a table of
the user data, and the program s_loads descriptors and constants from
it. Table dword k is user SGPR 16 + k. The translator only knew
addresses that come from the declared root layout, so every such
program failed with "an address in an SGPR that is no root parameter".

For compute programs whose root layout lies entirely at user SGPR 16 and
above, loads from that pointer with a constant offset become s_mov_b32
copies of the user SGPRs the dwords stand for, before the SSA is built,
so resource tracking and lowering see what they see for ordinary root
arguments. Only straight-line code from the pointer's set-up is
rewritten (tags are dropped at branch targets and on any overwrite of
the pointer registers); other loads stay loads.

On the title's world shaders this took the "SGPR that is no root
parameter" failures from 34 programs to 4 in one run. Other failures
that were hidden behind it now show (address not from a root parameter,
root UAV or typed root view, an address from a phi...). Whether the
translated programs render correctly has not been checked beyond that.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
RtlVirtualUnwind and RtlCaptureContext want a 16-byte aligned CONTEXT,
and windows-sys 0.61 declares the x64 CONTEXT without align(16). In a
debug build the by-value copy in unwind_into, and the test's stack
context, landed 8 bytes off (an address ending in ...838), so
unwinds_like_the_system_walk crashed the whole victory-loader test binary
with a stack-overflow message and STATUS_ACCESS_VIOLATION. Aligning only
the test's context was not enough: the copy in unwind_into, which the
crash handler and stacks.rs also unwind with, faulted as well.

unwind_into now copies its context into an Aligned16 wrapper and unwinds
that; the test captures into one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
victory-gpu's element table already sizes the console's
R10G10B10_SNORM_A2_UNORM (189, 4 bytes) and R4G4_UNORM (190, 1 byte),
but texture::format did not know them, so Texture::new refused any
texture in those formats. The GPU then fell back to a packed size
estimate instead of the console layout and had no layout to detile
with, and XG layout queries for them failed.

Add both to the table, list the console numbers in its doc, and pin
every console format's element size and layout in a test.
The format's tables now ship in-tree (Tables::builtin), but the ignored
reference_chunks test still panicked unless VICTORY_BCPACK_TABLES named a
table file. It now uses the built-in tables by default; the variable stays
as an override for comparing another table file. Only VICTORY_BCPACK_CASES
is required.
Two copies into title memory asked the host about the destination before
every copy. copy_mapped's own comment tells what that costs: asking
VirtualQuery about the source took about 2 ms per copy in the title's big
pools, because the query walks the page tables to the end of the region
with the same state, whatever the size of the copy.

- A list's copy into title memory checked that the whole destination was
  committed first, with VirtualQuery. The destinations were private pools
  of about 600 MiB.
- The copy-back of what shaders wrote used WriteProcessMemory, which asks
  for the destination's region before it writes: the same walk for every
  64 KiB piece.

Both now rely on the kernel copy the other copies already use
(ReadProcessMemory on our own process). It fails on a destination page
that is not mapped writable as it does on a source page it cannot read,
without faulting. A title destination is asked for its region only after
its copy has failed, which keeps the page retries (they write their zeros
themselves) off unmapped memory. write_mapped does what it did: mapped
pages are written, unmapped and read-only ones are not.

One difference: a title destination that was not all mapped used to be
left alone, and the bytes before its first unmapped page may now arrive
(the kernel copy stops at that page). No title copy of the run below had
such a destination, and none failed.

Measured in the world (first mission's intro; i7-13650HX, RTX 4060
Laptop, diagnostics build), with the old and the new call timed on the
same copies of one run, 41 frames of about 1.15 s each:

  title copies, 80 per frame (0.45 MB): the check alone 59.5 ms per
  frame; the whole copy now 0.56 ms
  copy-back, 110 pieces per frame (4.9 MB): 38.6 ms per frame; now
  0.55 ms

That is 98 ms of a frame (8.6 %) down to about 1 ms. In stacks of the
submitting thread sampled at 10 Hz, VirtualQuery under these two calls
was 47 of 462 samples before and 0 of 189 after.

Two tests run both copies against reserved memory with a committed block
on each side of a hole (no GPU, no game data).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A note on what found the causes of a dark scene after loading, GPU hangs
and load stalls in a native ARM64 port of GTA V (RAGE over DXVK), written
as things to try at the stage VIctory is at: the world loads, the scene
stays dark and the GPU can hang. It refers to the existing VICTORY_*
switches where they already cover a step, and says which lessons do not
carry over because VIctory runs the title's x86-64 code unchanged.

No game code, names or data; cargo xtask policy passes. The README's
Debugging section links to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A flip (or vblank) wait always ended on the next tick after now. A frame
that took a little longer than an interval therefore waited for the
whole following interval: at 30 fps, a 40 ms frame was shown after
66 ms, and frame times rounded up to whole intervals (30 fps falling
straight to 15, then 10). A non-origin wait that begins after a tick
nobody has taken now ends at once on that tick; on-time frames are
paced as before. Origin waits are unchanged.
XStoreQueryPackageIdentifier documents E_INVALIDARG for a store id that
has no installed package. We returned XPackage's 0x89245208 instead.
The FSSM root layout gives each parameter a user-data byte and an SGPR
count, and resource tracking turns them into registers with
HwStage::user_sgpr (index + 8 as u8 for merged and mesh stages) and, for
a root descriptor, that plus one. A byte of 248 or more in a merged-stage
record overflowed that add: a panic in debug builds, a wrapped register
that misattributes inputs in release. Reject, when the record is read, a
parameter whose SGPRs run past s105 (the last before VCC).
The corrupt-blob test only checked that native_programs fails, so a
check could stop firing while an earlier one caught the same bytes.
Each XDAT, XBCH, FSSM, record and stage-data refusal now has a case that
expects its own message, with the boundaries that still pass (256
VGPRs, a patch ending at the code's last dword, out-of-range entries
of other kinds).
Translate README.md, docs/architecture.md and docs/asset-policy.md
into Brazilian Portuguese (README.pt-BR.md, docs/pt-BR/). Each file
notes the date it was translated and that the English version is
canonical. Commands, identifiers and code blocks are kept as-is.
COMPUTE_PGM_RSRC2.TIDIG_COMP_CNT is a 2-bit field, and
ComputeIo::thread_id_vgprs returned it plus one: 4 for a value of 3.
io::raise then labelled v3 as Input::ThreadIdInGroup(3), and lowering
asks DXIL's threadIdInGroup for component 3, which does not exist (the
console-lanes path quietly treats it as z instead).

A thread id has only x, y and z, so clamp the field to 2 before adding
one: v0-v2 are the thread id and v3 stays an ordinary VGPR. A unit test
covers the field at 3.
That is the stage VIctory is at, so the note now leads with how the port got
past it: the state dumps that named each wait (script threads, streaming
queue, stacks, prompts) and the causes they found (an unseen prompt waiting
for input, the signed-in user, services that never answer, missing or
unconverted data, a faulting startup script, config budgets, out-of-range
platform answers, a render/main thread deadlock, reads that never complete),
plus how to tell slow frames from a stall. Dark scene and GPU hang points
stay, shortened.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The prepare unit tests patch the test binary itself, which is a PE image
only on Windows. This builds a small PE32+ executable in the test (one
import module, one TLS callback, DIR64 relocations, a bound-import entry)
and checks what prepare writes and that nothing else changes.
The ImageInfo unit tests that read imports, TLS and section mapping parse
the test binary itself, which is a PE only on Windows. Add an integration
test that builds a small PE32+ executable in memory (one section, a
KERNEL32.dll import by name and by ordinal, two TLS callbacks) and checks
headers, sections, imports and their IAT slots, TLS callback order,
rva_to_file_offset (padding past the virtual size, the 4 GiB limit), an
IAT running outside the image, other machines and truncated input.
No game data or files on disk.
implib.rs, the reader behind `victory lib-exports`, had no tests. Two are
added, built from an in-memory `!<arch>` archive of short-format import
objects (no SDK .lib, no game data), so they run on every host:

- every name type maps to the export the linker would bind (by name,
  no-prefix, undecorated, by ordinal), with its code/data/const kind;
- the result is sorted, and a repeat of an export under another hint is
  one entry (the hint is not part of the key);
- a member that is not a short import object is counted in
  other_members rather than dropped;
- a file that is not an archive is an error, an empty archive has no
  imports.
cargo doc --no-deps warns twice on main for crates that document on any
host:

    warning: public documentation for `texture` links to private item `MICRO`
      --> crates/victory-formats/src/texture.rs:16:19
    warning: `prepare` is both a function and a module
     --> crates/victory-loader/src/lib.rs:7:10

MICRO is a private table, so the public page cannot link to it; it stays
named in code font. In the loader's overview, step 1 means the function,
so the link says prepare() and rustdoc resolves it there instead of
guessing between it and the module.

With both, RUSTDOCFLAGS="-D warnings" cargo doc --no-deps passes for
victory-core, -pe, -loader, -formats, -pipeline, -game and -shader.
Comments only; no code changes.
host::module held the module cache's lock while it called
LoadLibraryExA. Loading a DLL that is not loaded yet takes the OS
loader lock, and title code runs under that lock too (a title DLL's
thread attach, TLS callbacks run as threads start), where it can need
the cache: any first use of a host! function, or a late-bound title
DLL. One thread holding the cache and waiting for the loader lock,
another holding the loader lock and waiting for the cache: the process
hangs, and cannot even exit, as ExitProcess needs the loader lock too.

The cache is now looked up, then unlocked for the load, then locked
again to keep the handle; a thread that loaded the same DLL meanwhile
got the same module, which stays loaded.
Container::parse accepted part offsets that point back into the 0x20-byte
header or the part offset table, so offset 0 read "DXBC" as a part's
FourCC and the digest as its size. Parts start after the offset table;
reject anything earlier, and cover each Malformed branch of the parser
with synthetic containers.
DxilProgram::parse has five rejections (program size, DXIL magic, bitcode
bounds, LLVM magic, bitcode offset) and trims a part to the program's own
size before reading the trailer, but the tests only reached the LLVM-magic
rejection. Synthetic headers now hit each one by name, check that padding
after the program is not taken for an Xbox trailer, and that an unknown
program kind is kept rather than refused.

Tests only; runs on any host.
The sampler word's LOD bias is a 14-bit signed 5.8 field, so it decodes
to anything from -32 to 31.996. D3D12 takes a static sampler's MipLODBias
only from -16 to 15.99 (D3D12_MIP_LOD_BIAS_MIN/MAX) and refuses a root
signature holding one outside that, which would lose the whole pipeline.
Clamp the decoded bias to that range; values inside it are unchanged.

The test covers both clamped ends and in-range values on either side,
and runs on every host.
The disassembler wrote every s_sendmsg as if it were a GS message, with a
GS operation and a stream, so the mesh stage's allocation request read
"sendmsg(MSG_GS_ALLOC_REQ, GS_OP_NOP, 0)", and only four of the GFX10
message ids had names.

Now messages are spelled the way LLVM's AMDGPU assembler spells them: the
operation only for GS, GS_DONE and SYSMSG, the stream only for a GS emit or
cut, and every GFX10 message id named. An operand whose bits no field
accounts for (an unknown id, a stream on a NOP, an operation on a message
that has none, bits above the stream) stays as raw hex instead of losing
those bits. The text is only used for shader dumps; translation does not
read it.
host_shader goes through the shader cache, which translates on a miss
and then writes the entry. When the write failed (a full disk, a file
where the entry's folder goes, a scanner holding the new file during
the rename), the error came back as the shader's: a translation that
had worked was thrown away, the shader was marked as not translating
for the rest of the run, and every draw using it was dropped.

The converter now records that its translation worked; a cache error
after that is logged as such and the shader is translated without the
cache, as when there is none.
The MicrosoftGame.config reader ended a tag at its first '>', but XML
allows '>' unescaped inside an attribute value. A value with one
(DefaultDisplayName="A > B") cut the tag short: its '/>' was never
seen, so the element stayed open and every element after it was read
as its child. Game/TitleId and the storage quota were then not found,
and the title ran as id 00000000 with no storage quota, its saves and
temporary files in that folder, without a warning.

A tag now ends at the first '>' outside quotes.
KNOWN_BUILDS is matched against the hex BLAKE3 that run.rs computes, so an
entry with a typo, a truncated hash, stray whitespace or a duplicate would
silently never identify the build it names. Check each entry is 64 lowercase
hex digits (the form blake3::Hash::to_hex writes), that labels and hashes are
unique, that identify() finds each build by its own hash in either case, and
that an unknown digest, an empty string or non-hex text identifies nothing.

The list is empty today, so the first two checks guard future entries; all
three run on every host without game files.
prepare() walks the base relocations to find the one that patches the TLS
callback field. It added each DIR64 entry's page offset to the block's
page RVA unchecked: a damaged block near u32::MAX panicked with an
overflow in debug builds and, in release, wrapped to a low RVA that could
match the field and zero an unrelated relocation entry.

Targets that do not fit in an RVA are now left out, the TLS field's own
RVA is computed with checked_add, and the block walk is split into
dir64_entries over plain bytes so it is covered by tests on every host.
An empty slice still has an address, and vkd3d-proton answers E_INVALIDARG to a non-null blob of length 0, so under Wine no pipeline library was ever created and host pipelines were not kept.
Co-authored-by: Claude Opus 5.5 <[email protected]>
XGameUiShowTextEntryAsync documents a 1024-character maximum on console,
1024 for a maxTextLength of 0, and 1024 for the Password scope whatever
the title asks. 0 meant no limit here, larger limits were kept and the
scope was ignored.
XPersistentLocalStorageGetPath documents E_FAIL for a pathSize smaller
than the path on Xbox devices; ERROR_INSUFFICIENT_BUFFER is the PC
result, which put_string gave us.
Raising a native vertex shader loads input channel c from
Reg::V(vgpr + c), with vgpr a byte read straight from the stage data.
An input at v253 or above with a later channel enabled overflowed that
u8 add: a panic in debug builds, and in release a wrapped register that
labels a low VGPR as the attribute. Reject, when the stage data is read,
an input whose last enabled channel lies past v255.
On Windows 10 the victory-shader test executables had no D3D12SDKVersion
and D3D12SDKPath exports, so every host device stopped at shader model 6.5:
the 7 emit::valu_tests failed and the device-backed tests skipped.

The tests now export them (path ..\D3D12\, the folder `cargo xtask
agility` fills) only when D3D12Core.dll is there: D3D12 does not fall back
to the in-box runtime when the named one is missing. The build script
watches the DLL only when it exists, so a missing runtime does not rebuild
the crate every time; the xtask touches build.rs after installing it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A well-formed record in bytes before the first SGD5 magic (another file
in the same archive) was reported as one of the SGD5 file's records.
Tests also cut a two-record file at every length: only whole records
are found, and each one unpacks.
Frame dumps decoded DXGI format 11 (R16G16B16A16_UNORM) as half floats,
so 0x8000 came out as -0 and 0xffff as -inf, and 12-14 were not handled.
Format 89 (R10G10B10_XR_BIAS_A2_UNORM) went through the B8G8R8A8 swap.
A slice may not start at null, even an empty one, so asking for a title
image's name with (NULL, 0) was undefined behaviour; a debug build
aborted the process. A null buffer is now no buffer: nothing is written,
0 is returned and the last error is ERROR_INSUFFICIENT_BUFFER.
Extend the synthetic image with optional delay-import, export and debug
directories, each added only by the test that needs it, and check:
delay-import IAT slots and their bounds, export forwarders by name and by
ordinal, the RSDS record and its symbol-server key (non-RSDS is ignored),
the relocation/exception/load-config flags including RELOCS_STRIPPED,
subsystem names, and the raw layout offset helpers.
docs/pt-BR/instalacao.md walks a first-time user through checking
requirements, installing Git, Rust and the MSVC build tools, cloning,
running the tests, building, configuring victory.toml and reporting
problems. It does not cover obtaining game files. README.pt-BR.md
links to it from the getting-started section.
The far-jump resolver took any literal: one that is not a multiple of 4
sent decoding into the middle of a dword, reading words that straddle
two instructions. Such a target is now an ISA error.

Tests also pin the exact offset and reason of each way decode refuses
code: odd size, branch or call out of range, a truncated instruction or
literal, running off the end, a reserved FLAT segment, an unknown
encoding, a branch into an instruction, and far jumps off the code.
A compute record's thread-group size is three u32s read straight from the
stage data. Lowering multiplies them (a debug panic on overflow) and writes
them as the DXIL numthreads. Refuse a zero component, one past D3D12's
limits (x, y 1024; z 64), or a group over 1024 threads as
Malformed("implausible thread-group size").
buffer_gl0_inv and buffer_gl1_inv name a buffer but read no descriptor, so resource tracking refused them before lowering. Skip descriptor tracking for _inv buffer instructions and lower the pair to nothing, as the existing scalar cache instructions already are. Add a synthetic full-pipeline test.
The search resumed right after a record's packed bytes, so a marker found
there read its NUL, kind and size from the end of those packed bytes, and
its name from before them. Bytes past the end of the deflate stream are
not checked, so such a phantom record was reported. The search now starts
six bytes after the previous record (or the magic), and a record's header
and name are read only from bytes after it.

Tests: the phantom case (failed before: [PS_first, None]), an empty
container, and every single-byte change to a two-record file finds only
disjoint records inside the file, without panicking.
exp mrtz's channel y is lowered to an SV_StencilRef output, but the
module's shader flags never had StencilRef (bit 11) and SFI0 never had
D3D_SHADER_FEATURE_STENCIL_REF (0x200). DXC sets both for a pixel
shader whose output signature has the stencil reference, and the
validator checks the flags against the module.

Both are now set when a pixel shader outputs SV_StencilRef.
The pipeline state validation part left PSInfo.SampleFrequency at 0.
DXC sets it when a pixel input is interpolated per sample (modes 6 and
7, which our lowering gives to PERSP_SAMPLE and LINEAR_SAMPLE
barycentrics) or is SV_SampleIndex, and the validator compares the
whole runtime info with what it derives from the module.

The flag is now set for such pixel shaders.
An empty slice still has an address, and vkd3d-proton answers E_INVALIDARG to a non-null blob of length 0, so under Wine no pipeline library was ever created and host pipelines were not kept.
The ISA's special cases in its order: a NaN numerator or denominator comes
back quieted, 0/0 and inf/inf give NaN, x/0 and inf/x a signed infinity,
0/x and x/inf a signed zero, otherwise |S0| with the quotient's sign.
Worked on the f32 values of the f16 operands, which are exact.
Adds five hermetic tests to synthetic_image.rs: names read from the IAT
when OriginalFirstThunk is 0, a TLS directory with no callbacks or no RVA,
a callback array that runs to the end of its section, TLS data outside the
sections or past 4 GiB, and a PE32 header being Unsupported.
- The only_loopback_is_reachable test fails on Windows 10 (#118); say
  so after the test step and in the troubleshooting table.
- 0xc000001d on CPUs without CLWB (#108, #210) is fixed in main since
  7d33c46; tell users who hit it to update and rebuild.
- 16 GB RAM with an 8 GB GPU can run out of memory at the forced 4K
  resolution (#203); add it to the requirements table.
They went through a 32-bit conversion, so an f16 past the i16 range
(32768 up to 65504) wrapped, and infinities and NaN were undefined. The
value is now clamped in f32 to the 16-bit range first (every f16 is exact
there) and NaN gives 0, as the hardware's conversions do.
The sampler word's minimum and maximum LOD fields are independent, so a
maximum below the minimum decodes as is. A host sampler needs MaxLOD >=
MinLOD (Vulkan VUID-VkSamplerCreateInfo-maxLod-01973 under vkd3d-proton).
The maximum is now raised to the minimum, which gives the same clamp
result; ordered pairs are unchanged.
A mesh record's thread-group size is a u16 read straight from the stage
data. It becomes the DXIL numthreads x and, for containers without the
HLSL thread count, the stride lowering multiplies the group id by. A
record of 0 emitted numthreads(0, 1, 1) and gave every group id 0.
Such records are now refused with the compute path's
Malformed("implausible thread-group size"); the synthetic fssm helper
writes a one-lane mesh group.
Adds two ImportLibrary unit tests. One builds the layout lib.exe writes
(two `/` linker members, a `//` long-names member, imports under `/<n>`
names) and checks that the bookkeeping members are neither imports nor
other members. The other checks that a truncated archive, an oversized
member and a long name past the names table return an error without a
panic, and that a cut-short or overlong import object inside an intact
archive is counted in other_members.
Deflate stored blocks carry a record's container as it is, so the raw DXBC
scan in `victory shader` also found it and counted it a second time.
sgd5::Record::span and sgd5::in_record let the scan skip offsets inside a
record.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:55:45 +00:00
github-bot closed this pull request 2026-11-26 03:55:45 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 05:39 UTC · original

Thanks @⁠muhammed-aksoy for maintaining this broad Windows integration roll-up and reconciling the updated PR heads.

I independently tested commit e440f471b159e0ac940612d0115e2e2be2cd6154 with:

cargo test --locked --workspace --lib -- --test-threads=1

The workspace library suites completed successfully: 512 passed, 0 failed, and 19 ignored across 11 library test binaries.

The run includes coverage for the latest integration fixes, including rejecting an unterminated synthetic TLS callback array, saturating storage quota parsing at the u64 byte limit, and frame waits that update tick/frame counts, alongside the wider PE, loader, HLE, GPU, profile, and game library suites.

This was a library-only run. It does not build every binary target or feature combination, run hosted Windows CI, or launch a title.

**@⁠jeremygold02** on GitHub · 2026-11-24 05:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/231#issuecomment-7123148742) Thanks @⁠muhammed-aksoy for maintaining this broad Windows integration roll-up and reconciling the updated PR heads. I independently tested commit `e440f471b159e0ac940612d0115e2e2be2cd6154` with: ``` cargo test --locked --workspace --lib -- --test-threads=1 ``` The workspace library suites completed successfully: 512 passed, 0 failed, and 19 ignored across 11 library test binaries. The run includes coverage for the latest integration fixes, including [rejecting an unterminated synthetic TLS callback array](https://github.com/Marvisak/VIctory/blob/e440f471b159e0ac940612d0115e2e2be2cd6154/crates/victory-pe/src/image.rs#L596), [saturating storage quota parsing at the `u64` byte limit](https://github.com/Marvisak/VIctory/blob/e440f471b159e0ac940612d0115e2e2be2cd6154/crates/victory-hle/src/runtime.rs#L258), and [frame waits that update tick/frame counts](https://github.com/Marvisak/VIctory/blob/e440f471b159e0ac940612d0115e2e2be2cd6154/crates/victory-gpu/src/frame.rs#L194), alongside the wider PE, loader, HLE, GPU, profile, and game library suites. This was a library-only run. It does not build every binary target or feature combination, run hosted Windows CI, or launch a title.
Author
Owner

@⁠Ilokaxt on GitHub · 2026-11-24 12:40 UTC · original

Tried this branch as it is (e440f47, 337 commits ahead of main, 104 behind ffe310e) on an RTX 3070 Ti Laptop (NVIDIA driver 610.88, Windows 11 build 26300), diagnostics build, with only a local fix that creates the device on the high-performance adapter.

The title stops about one second after start, before the first screen. Its own last output:

D3D12 XDXR Error:
Unexpected internal Failure: D3D12SerializeVersionedRootSignature(&desc, &pRootSignatureBlob, nullptr)

then its crash handler runs (the upload to backtrace.io is blocked by the offline network layer, as it should be). main at ffe310e with the same local fix boots and reaches the world on this machine, so something in the integrated set breaks root signature serialization for the title's XDXR (xboxbvhbuilder.dll) path.

**@⁠Ilokaxt** on GitHub · 2026-11-24 12:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/231#issuecomment-7131755221) Tried this branch as it is (`e440f47`, 337 commits ahead of `main`, 104 behind `ffe310e`) on an **RTX 3070 Ti Laptop** (NVIDIA driver 610.88, Windows 11 build 26300), diagnostics build, with only a local fix that creates the device on the high-performance adapter. The title stops about one second after start, before the first screen. Its own last output: ``` D3D12 XDXR Error: Unexpected internal Failure: D3D12SerializeVersionedRootSignature(&desc, &pRootSignatureBlob, nullptr) ``` then its crash handler runs (the upload to backtrace.io is blocked by the offline network layer, as it should be). `main` at `ffe310e` with the same local fix boots and reaches the world on this machine, so something in the integrated set breaks root signature serialization for the title's XDXR (`xboxbvhbuilder.dll`) path.
Author
Owner

@⁠muhammed-aksoy on GitHub · 2026-11-24 14:33 UTC · original

Thanks for the A/B report, @⁠Ilokaxt. Your run points to a startup regression on this draft: e440f47 fails XDXR root-signature serialization while ffe310e boots with the same adapter-selection change. The passing library tests used synthetic fixtures and do not cover that startup path. I haven't isolated the offending change, so I'd keep this draft out of the merge queue. The smaller integration batch on ffe310e has its own Windows CI result and its title startup remains unverified.

**@⁠muhammed-aksoy** on GitHub · 2026-11-24 14:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/231#issuecomment-7134568825) Thanks for the A/B report, @⁠Ilokaxt. Your run points to a startup regression on this draft: `e440f47` fails XDXR root-signature serialization while `ffe310e` boots with the same adapter-selection change. The passing library tests used synthetic fixtures and do not cover that startup path. I haven't isolated the offending change, so I'd keep this draft out of the merge queue. The smaller [integration batch on ffe310e](https://github.com/muhammed-aksoy/VIctory/pull/1) has its own Windows CI result and its title startup remains unverified.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:00 UTC · original

Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/231#issuecomment-7148041771) Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!231
No description provided.