Console API conformance: runtime, GPU, DirectStorage, XG, XMem and audio calls the title makes #1510

Manually merged
github merged 70 commits from github-bot/gh-1510 into main 2026-11-29 08:21:51 +00:00 AGit
Owner

@⁠capibawa on GitHub · 2026-11-28 21:03 UTC · original
fix/gdk-conformance → main · +13108 −1086 · 56 files · 70 commits · merged 2026-11-29 08:16 UTC

What

70 commits that answer the console calls the title makes, but which still failed, crashed or returned placeholders. Each commit is one fix and explains itself in its message.

What players notice

  • In-game screenshots: XAppCaptureTakeScreenshot now saves the next presented frame as a PNG under the title's data folder (screenshots/photo-<secs>-<n>.png) and fills in its result. main still refuses screenshots as if capture were unavailable.
  • FidelityFX and DLSS:
    • The FidelityFX path is patched in only at the sizes the title's FSR4 supports. At other sizes the title divided by zero at its first upscaling: DLSS frame generation on its own, VICTORY_FSR_PATH on Series X, or a Series S scene other than 720p/1080p without DLSS.
    • When DLSS refuses an upscaling, a plain bilinear upscaling runs in its place. Before, nothing ran and the picture froze or showed a stale frame.
    • An upscale description chained behind another one is found, so DLSS takes it.
  • Skipped Bink movies (VICTORY_SKIP_BINK): a skipped movie is paused, so its soundtrack no longer plays on. A title copying a skipped movie's frame no longer gets undecoded garbage. A movie whose layout isn't the known one is left alone instead of being written to.
  • Dynamic resolution: a present that shows only part of its texture (for example 1280x720 of a 1920x1080 texture) shows that part in its place on the screen, not the whole texture.
  • GPU ordering:
    • A wait that reaches into the next frame (async compute waiting on the next frame's graphics) is kept across one present, not broken every frame with its work run out of order.
    • A blocking fence wait now waits until the value is reached instead of failing, which a title could take as a lost device.
  • Audio:
    • XAudio2 voices playing XMA2, which the host's XAudio2 refuses, are decoded, so titles using XAudio2 with XMA2 banks are no longer silent or failing audio setup.
    • The click at the seam between chained XMA contexts is gone.
  • System pages offline: the message dialog and error dialog appear as host dialogs with the title's buttons. Achievements, invites, the player picker and similar pages close at once as they would offline, instead of failing.
  • Saves: XGameSaveFiles gets a folder of its own beside the container saves.
  • Other:
    • The title sees its own command line, not victory play ….
    • Its memory figures match the console's budget instead of the PC's RAM.
    • A dual-stack socket bound to all interfaces hears IPv4 loopback, so local tools can reach it.

All changes

  • Runtime (XGameRuntime): the method tables are padded to the last slot the title's runtime stubs call. The error, activation and pending-invite areas are served. XUser, XGameUI, XPackage, XNetworking, XStore and XGameSave answer as an offline console. QueryApiImpl refuses a null out pointer. Struct layout tests cover what titles share with us.
  • GPU device, lists and queues:
    • Feature queries past the first five; format support is the host device's.
    • Both queue tables reach their last slot, and every GPU method table checks its length at compile time.
    • SuspendX, ResumeX and GetClockCalibration.
    • ID3D12Device9 and ID3D12Device10 answer as the device.
    • Event-less fence waits block until the value is reached.
    • Each plane's source rectangle is shown in its place on the screen.
    • UAV clears, logging for the depth order, shading rate and sample mask the host does not apply, and loading of the compute pipelines the console serialized, which is opt-in (VICTORY_DESERIALIZE_COMPUTE=1): loaded by default, they left the scene grey (see Tests).
  • DirectStorage: the whole queue interface and its options, file handles, the older factory ids, and per-queue error events with the full error record.
  • XG: size, alignment, mip offsets, 64 KiB layouts, buffer and depth-stencil layouts, GetTexelCoordinate and GetSwizzlePatternInfo.
  • XMem: graphics memory types get title graphics memory, XMEM_2MB_ALIGN, the longer working-set statistics, the title's figures in GlobalMemoryStatusEx, and the heap, hysteresis, option and write-watch exports.
  • Audio: XMA2 source voices in XAudio2, XMA contexts chained through their overlap buffer, the xapu rate converter, ApuHeapGetState, and the convolution ramp.
  • Kernel, files, media, net:
    • The title's command line, in the ANSI code page too.
    • Title DLL lookups through GetProcAddress and GetModuleHandleEx.
    • Path translation in Media Foundation.
    • The rest of the path-taking file API.
    • XCurl served offline, and a dual-stack bind hears IPv4 loopback.
  • Bink and FidelityFX: skipped movies pause and stay out of title memory. The FidelityFX patch applies only at sizes the title's FSR4 takes, and a plain upscaling is used where DLSS takes none.

Rebased onto main

main had independently fixed some of the same things, so those overlaps were merged feature by feature rather than hunk by hunk. Each affected commit says what it kept from each side.

  • XOR swizzle addressing: this branch's version is dropped. Both implementations give identical addresses for every element of 3,150 layouts (both consoles, every mode, element size, 2D, array and 3D, every mip), so main's stays.
  • DirectStorage: this branch's queue replaces the one on main. main's QueryInterface, padded tables, off-the-frame worker placement and fence-signal thread are kept. The signal thread also fixes this branch signalling fences under the scheduler's lock.
  • Blocking fence wait: this branch's version replaces main's. It forces held work after 250 ms instead of 2 s, wakes the behind line when that is on, and keeps the VICTORY_FENCE_WAIT_MS limit.
  • XStore and XGameSave: main's blocking save calls and store catalog, licence and add-on calls are kept. This branch adds only the calls main lacks.
  • Presenting: main's shadow lift and movie flag are combined with this branch's per-plane placement. The lift is the composer's last root constant.

This also covers the queue and device table parts of #1409: the 38-slot queue tables, SuspendX/ResumeX, and ID3D12Device9/10.

Tests

  • cargo test --workspace: every suite passes except xtask's repository_passes_policy. That fails on main too: crates/victory-shader/src/emit/lower.rs is over the 640 KiB limit, and this branch does not touch it.
  • cargo clippy --workspace --all-targets (with and without --all-features): no warnings from this branch's code. main still has 12 warning sites, which -D warnings in CI will report.
  • In the game, on this rebased branch: RTX 5070 Ti (driver 617.42), Windows 11 26300, Series X profile, 1440p, DLSS quality.
    • Before the last commit: the scene was grey behind the interface and subtitles. 350 compute shaders did not translate, and 400 to 1,000 draws a frame were dropped. A bisect against main (which shows the scene) found the commit that loads the console's cached compute pipelines. Many of the title's own compute passes came in as console code the translator does not take.
    • After: with that loading opt-in, the scene shows, as on main.
**@⁠capibawa** on GitHub · 2026-11-28 21:03 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1510) `fix/gdk-conformance` → `main` · +13108 −1086 · 56 files · 70 commits · merged 2026-11-29 08:16 UTC ## What 70 commits that answer the console calls the title makes, but which still failed, crashed or returned placeholders. Each commit is one fix and explains itself in its message. ### What players notice - **In-game screenshots:** `XAppCaptureTakeScreenshot` now saves the next presented frame as a PNG under the title's data folder (`screenshots/photo-<secs>-<n>.png`) and fills in its result. `main` still refuses screenshots as if capture were unavailable. - **FidelityFX and DLSS:** - The FidelityFX path is patched in only at the sizes the title's FSR4 supports. At other sizes the title divided by zero at its first upscaling: DLSS frame generation on its own, `VICTORY_FSR_PATH` on Series X, or a Series S scene other than 720p/1080p without DLSS. - When DLSS refuses an upscaling, a plain bilinear upscaling runs in its place. Before, nothing ran and the picture froze or showed a stale frame. - An upscale description chained behind another one is found, so DLSS takes it. - **Skipped Bink movies (`VICTORY_SKIP_BINK`):** a skipped movie is paused, so its soundtrack no longer plays on. A title copying a skipped movie's frame no longer gets undecoded garbage. A movie whose layout isn't the known one is left alone instead of being written to. - **Dynamic resolution:** a present that shows only part of its texture (for example 1280x720 of a 1920x1080 texture) shows that part in its place on the screen, not the whole texture. - **GPU ordering:** - A wait that reaches into the next frame (async compute waiting on the next frame's graphics) is kept across one present, not broken every frame with its work run out of order. - A blocking fence wait now waits until the value is reached instead of failing, which a title could take as a lost device. - **Audio:** - XAudio2 voices playing XMA2, which the host's XAudio2 refuses, are decoded, so titles using XAudio2 with XMA2 banks are no longer silent or failing audio setup. - The click at the seam between chained XMA contexts is gone. - **System pages offline:** the message dialog and error dialog appear as host dialogs with the title's buttons. Achievements, invites, the player picker and similar pages close at once as they would offline, instead of failing. - **Saves:** `XGameSaveFiles` gets a folder of its own beside the container saves. - **Other:** - The title sees its own command line, not `victory play …`. - Its memory figures match the console's budget instead of the PC's RAM. - A dual-stack socket bound to all interfaces hears IPv4 loopback, so local tools can reach it. ### All changes - **Runtime (XGameRuntime):** the method tables are padded to the last slot the title's runtime stubs call. The error, activation and pending-invite areas are served. XUser, XGameUI, XPackage, XNetworking, XStore and XGameSave answer as an offline console. `QueryApiImpl` refuses a null out pointer. Struct layout tests cover what titles share with us. - **GPU device, lists and queues:** - Feature queries past the first five; format support is the host device's. - Both queue tables reach their last slot, and every GPU method table checks its length at compile time. - `SuspendX`, `ResumeX` and `GetClockCalibration`. - `ID3D12Device9` and `ID3D12Device10` answer as the device. - Event-less fence waits block until the value is reached. - Each plane's source rectangle is shown in its place on the screen. - UAV clears, logging for the depth order, shading rate and sample mask the host does not apply, and loading of the compute pipelines the console serialized, which is opt-in (`VICTORY_DESERIALIZE_COMPUTE=1`): loaded by default, they left the scene grey (see Tests). - **DirectStorage:** the whole queue interface and its options, file handles, the older factory ids, and per-queue error events with the full error record. - **XG:** size, alignment, mip offsets, 64 KiB layouts, buffer and depth-stencil layouts, `GetTexelCoordinate` and `GetSwizzlePatternInfo`. - **XMem:** graphics memory types get title graphics memory, `XMEM_2MB_ALIGN`, the longer working-set statistics, the title's figures in `GlobalMemoryStatusEx`, and the heap, hysteresis, option and write-watch exports. - **Audio:** XMA2 source voices in XAudio2, XMA contexts chained through their overlap buffer, the xapu rate converter, `ApuHeapGetState`, and the convolution ramp. - **Kernel, files, media, net:** - The title's command line, in the ANSI code page too. - Title DLL lookups through `GetProcAddress` and `GetModuleHandleEx`. - Path translation in Media Foundation. - The rest of the path-taking file API. - XCurl served offline, and a dual-stack bind hears IPv4 loopback. - **Bink and FidelityFX:** skipped movies pause and stay out of title memory. The FidelityFX patch applies only at sizes the title's FSR4 takes, and a plain upscaling is used where DLSS takes none. ## Rebased onto main `main` had independently fixed some of the same things, so those overlaps were merged feature by feature rather than hunk by hunk. Each affected commit says what it kept from each side. - **XOR swizzle addressing:** this branch's version is dropped. Both implementations give identical addresses for every element of 3,150 layouts (both consoles, every mode, element size, 2D, array and 3D, every mip), so `main`'s stays. - **DirectStorage:** this branch's queue replaces the one on `main`. `main`'s QueryInterface, padded tables, off-the-frame worker placement and fence-signal thread are kept. The signal thread also fixes this branch signalling fences under the scheduler's lock. - **Blocking fence wait:** this branch's version replaces `main`'s. It forces held work after 250 ms instead of 2 s, wakes the behind line when that is on, and keeps the `VICTORY_FENCE_WAIT_MS` limit. - **XStore and XGameSave:** `main`'s blocking save calls and store catalog, licence and add-on calls are kept. This branch adds only the calls `main` lacks. - **Presenting:** `main`'s shadow lift and movie flag are combined with this branch's per-plane placement. The lift is the composer's last root constant. This also covers the queue and device table parts of #1409: the 38-slot queue tables, `SuspendX`/`ResumeX`, and `ID3D12Device9`/`10`. ## Tests - `cargo test --workspace`: every suite passes except `xtask`'s `repository_passes_policy`. That fails on `main` too: `crates/victory-shader/src/emit/lower.rs` is over the 640 KiB limit, and this branch does not touch it. - `cargo clippy --workspace --all-targets` (with and without `--all-features`): no warnings from this branch's code. `main` still has 12 warning sites, which `-D warnings` in CI will report. - In the game, on this rebased branch: RTX 5070 Ti (driver 617.42), Windows 11 26300, Series X profile, 1440p, DLSS quality. - **Before the last commit:** the scene was grey behind the interface and subtitles. 350 compute shaders did not translate, and 400 to 1,000 draws a frame were dropped. A bisect against `main` (which shows the scene) found the commit that loads the console's cached compute pipelines. Many of the title's own compute passes came in as console code the translator does not take. - **After:** with that loading opt-in, the scene shows, as on `main`.
Twelve runtime method tables ended before the last slot that the GDK
2610 title stubs (xgameruntime.lib) call for the same interface. A
title calling past the end jumped through whatever memory followed
the table. The tables now run to the GDK's last slot; the new slots are
missing::<N>, so a call returns E_NOTIMPL and logs a warning.

Object records its slot count, and method_tables_cover_every_gdk_slot
checks each served interface against the GDK's last slot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The queue table ended at 0x58; IDStorageQueueX1/X2 add EnqueueSetEvent
(0x60) and Query1 (0x68), which a title could reach since one object
answers for every queue IID. EnqueueSignal (0x28) was missing, so a
title waiting on its fence would hang; GetErrorEvent returned an error
code as a handle; RetrieveErrorRecord and Query left their structs
unwritten.

- Fence signals and events are ordered marks, reached like status
  entries once every earlier read has finished.
- GetErrorEvent gives a real (never-set) event; RetrieveErrorRecord
  reports no failures; Query/Query1 report the description and room.
- CancelRequestsWithTag logs and lets the requests complete.
- The field read as "unknown" is DSTORAGE_QUEUE_OPTIONS: a queue
  without AutoSubmitDisabled now submits itself once half full.
- Factory: CreateQueue (0x18, no options), SetCpuAffinity, SetDebugFlags
  and GetStats are answered.

Rebased onto upstream's own pass at these calls (0f0c2ad): this
version's queue (options, Query1, EnqueueSetEvent, cancel by tag, the
factory's affinity, debug flags and statistics) replaces upstream's,
and upstream's QueryInterface, padded file, status and queue tables,
off-the-frame worker placement and signal thread are kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Unimplemented slots returned E_NOTIMPL (0x80004001), which a bool
return reads as true, and void methods with out-params left them
unwritten.

- XThreadSetTimeSensitive/IsTimeSensitive keep a per-thread flag.
- XSystemHandleTrack, IsHandleValid, AllowFullDownloadBandwidth.
- XPackageUpdateInstallationMonitor (false), Register/Unregister
  PackageInstalled.
- XUser default-audio-endpoint change registration.
- GameInput GetBatteryState fills Unknown; IsForceFeedbackMotorPoweredOn
  and AcquireExclusiveRawDeviceAccess return false.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Unbound calls sent G:\ and T:\ paths straight to the host, which either
failed or used a real host drive of that letter. Now bound: copy, move
and replace (A/W, Ex, CopyFile2), the narrow directory/attribute/disk
calls, FindFirstFileA/ExA, GetDriveType, GetVolumeInformation,
GetVolumePathName, GetTempFileNameW, SearchPath and
SetCurrentDirectoryW. Volume-root calls answer for the host volume
under the virtual drive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The host loader does not know the images we map, so FROM_ADDRESS lookups
in title code failed. GetModuleHandleEx now answers as GetModuleHandle
does, and finds a title image by an address within its SizeOfImage.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only MEM_2MB_PAGES gave a 2 MiB-aligned address; the XMem flag asks for
the same alignment with any page size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sizes and every field offset of the 33 structs titles share with the HLE
(XSystem, XAsync, XGameSave, XNetworking, XPackage, XStore, persistent
storage, XMem, XApu, ACP, XDsp, GameInput, DirectStorage), as titles lay them out. An
assert_layout! macro in lib.rs; one layouts test per module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GetResourceSizeBytes, GetResourceBaseAlignmentBytes and
GetMipLevelOffsetBytes return UINT64, and returned E_NOTIMPL
(0x80004001) as a byte count. IsTiledResource returns bool and read as
true. The table ended at 0x60; GetSwizzlePatternInfo (0x68) jumped past
it. Size and alignment now come from the layout, mip offsets from the
same placement as element offsets, IsTiledResource is false (the
D3D12-style description has no tiled flag), and the table has 14 slots.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
IDStorageFileX::GetHandle returned an error code as a handle; it now
returns a duplicate the title closes. Close is answered (the handles
close with the last reference, since running reads hold them).
DStorageGetFactory also accepts IDStorageFactoryX and X1, whose slots
are the first ones of ours.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The optional out structure was left unwritten. It now gets an SDR
range (0-100 nits, chosen rather than measured).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only beginScale was applied, as a constant gain. Frame i is now scaled
by begin + i * (end - begin) / blockFrameCount.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
It returned false but left the title's pointer as it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SetEventOnCompletion without an event now blocks until the fence is
reached, as D3D12 has it, instead of failing with E_NOTIMPL. While it
waits, held queue work whose waits are met runs and late flights are
settled; after 250 ms unmet, held work is forced as a present forces it
(VICTORY_WAIT_FORCE=0 keeps it held). VICTORY_FENCE_WAIT_MS=n restores a
give-up limit with the old error.

d3d12_xs.dll now binds the interface ids it exports as data and
WKPDID_D3DDebugObjectNameW, plus
D3D12CreateDevice, D3D12CreateVersionedRootSignatureDeserializer,
D3D10CreateBlob, D3D12GetDebugInterface (no debug layer: E_NOINTERFACE),
D3D12XboxSet/GetProcessDebugFlags (kept, not acted on),
D3D12XboxUnloadDriverModule and D3DFlushEntireCpuCache. A test checks
every id's value; the exports with no known behaviour (DXGIX*, D3D12UploadCustomMicrocodeX,
D3D12XboxEnableMemoryProfiling, InternalDriverCallX) stay unserved.

Upstream made the same wait block (ce14990), forcing held work after two
seconds. This version takes its place: it forces after 250 ms, wakes the
behind line instead of running held work on the waiting thread when that
line is on, and keeps the VICTORY_FENCE_WAIT_MS limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
One rule for the swizzle mode a D3D12-style layout field names
(victory_formats::texture::layout_swizzle), shared by XG and the device
so both agree on every texture's size. XG_TEXTURE_LAYOUT_64KB_UNDEFINED
and _64KB_STANDARD (2, 3) now lay out in SW_64KB_S, the standard 64 KiB
mode without XOR; 1D and depth/stencil textures get no 64 KiB mode
rather than a guessed one. Device textures with these layouts used the
packed fallback size before.

XGSuggestSwizzleMode: a layout field holding a mode is
ignored, 64KB_UNDEFINED (a reserved resource) keeps a 64 KiB mode, a
reserved depth buffer is refused (E_NOTIMPL) and a buffer is invalid.
IsTiledResource answers for layout 2 and XG_RESOURCE_MISC_TILED.

New exports: the D3D11-style 1D/2D/3D computers and layout functions,
XGComputeOptimalSwizzleMode, XGComputeTileShape (D3D's standard tile
shapes), XGInitializeLibrary/XGTerminateLibrary (S_OK, then S_FALSE),
XGSetHardwareVersion (Series layouts always) and the exclusive lock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only MFCreateSourceResolver was wrapped, so MFCreateSourceReaderFromURL,
MFCreateSinkWriterFromURL, MFCreateFile and MFBeginCreateFile handed the
host a G:\ or T:\ path it cannot open (virtual drives are not host
drives), and the reader's own resolver fetched http(s) URLs past
modules::net. The two mfreadwrite calls now follow the resolver's URL
rule (local files only, virtual drives rewritten, the rest refused with
MF_E_UNSUPPORTED_SCHEME); a sink writer given a byte stream keeps its
URL, which only names the container. MFCreateFile and MFBeginCreateFile
rewrite their file path as modules::files does.

The asynchronous calls (MFBeginCreateFile, BeginCreateObjectFromURL)
keep their rewritten string for the process's life: the host may read it
after the call returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's shipping FSR4 carries the Series S tables only (1280x720 or
1920x1080 in, 1920x1080 out); at other sizes its context is not made and
the title divides by zero at its first upscaling. The path was patched in
whenever DLSS, frame generation or VICTORY_FSR_PATH was there, so DLSS
frame generation alone or VICTORY_FSR_PATH on Series X (1440p/4K out),
and a Series S scene other than 720/1080 without DLSS, reached it.

upscaler_mode decides it at the start: with DLSS taking the upscalings
any scale goes; without it the path is left out on Series X (frame
generation then gets no upscalings and stays off) and Series S keeps
dlaa or quality, else quality. An "upscaling" line says what changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
PresentX's planes carry a source rectangle per resource (pSrcViewRects:
a dynamic resolution shows part of its texture) and a place on the
screen (pDestPlacementBase, fractions of it); both were ignored, so a
title presenting 1280x720 of a 1920x1080 texture showed all of it.

They are read from the 72-byte retail layout and kept only when they
make sense (a source inside the texture, a place inside the screen, each
with an area), else the plane is whole as before. The composer takes a
placement per plane and an optional overlay; it draws whenever there is
an overlay or the base plane is not shown whole. A whole single plane is
still copied as it is.

On upstream's shadow lift and movie class: the lift is the composer's
last root constant (18 in all) and still applies to the scene before the
interface is blended, and each present carries its movie class beside
the planes' placement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console's GPU video calls (exported by its mfplat)
are not in the host's Media Foundation, so a title importing them got
the loader's reporting stub at its first video. Both are served now and
refuse with MF_E_UNSUPPORTED_D3D_TYPE (said once each): the title's
device and textures are translated objects, and frames a host decoder
made on the host device would be host textures the title cannot put in
its own descriptors. The title then takes its own way without a GPU
decoder. Decoding on the GPU needs host textures handed to the title as
its own resources, which nothing does yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XStoreQueryLicenseToken, XStoreShowRateAndReviewUI,
XStoreShowAssociatedProductsUI and XStoreShowGiftingUI were E_NOTIMPL
placeholders that failed at once without beginning the call. They now
begin it and fail it with the store network error, as the module's other
service calls do, and their result slots return that status.

Upstream already answers the catalog queries, the can-acquire checks and
the add-on licences the same way, and the package-update download
(4af086d); its versions are kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The host's XAudio2 2.9 refuses WAVE_FORMAT_XMA2 source voices (decoded by
SHAPE on the console), does not know XAUDIO2_DO_NOT_USE_SHAPE,
_DO_NOT_SHARE_SHAPE_CONTEXTS or _EXCLUDE_FROM_GAME_DVR_CAPTURE, and has
no XAudio2CreateWithSharedContexts. Titles using XAudio2 with XMA2 banks
were silent or failed audio init.

The xaudio2 module serves XAudio2Create (also as ordinal 1),
XAudio2CreateWithVersionInfo and XAudio2CreateWithSharedContexts over the
host's engine and patches its method table: voice creation drops the
console's flags, and an XMA2 source voice is made as a 16-bit PCM voice
of the same channels and rate. That voice's SubmitSourceBuffer decodes
the buffer's packets (each stream from its own packet, interleaved) with
victory_formats::xma and submits the PCM with the buffer's play and loop
region (fitted to what decoded) and context; the PCM is kept while the
voice may read it. FlushSourceBuffers restarts the decoders;
DestroyVoice frees them.

The engine also keeps the process's multithreaded apartment
(CoIncrementMTAUsage): the host's mastering voice failed with
CO_E_NOTINITIALIZED on a title thread, which never starts COM.

Not checked with real XMA2 content (none is at hand); a buffer is
decoded whole on the submitting thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every present ran everything any queue still held, whatever its fence
(release_held(true)), so a wait reaching into the next frame (async
compute waiting for a value the next frame's graphics writes) was
broken every frame and its work ran out of order.

On the path without the async-submit line, a present now runs all that
is held only when its own queue holds something (the present shows that
work). Otherwise it runs only the queues that gave up nothing since the
present before: a wait may span one present, not two, so one nothing
meets still goes and a title waiting on that queue's fence is not held
for good. Each queue's line counts what it gave up, which is how a queue
that stood still is told. VICTORY_WAIT_FORCE=0 keeps everything held, as
before.

The async-submit line (behind) still puts a present behind all that was
given before it, on every queue.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XPackageGetUserLocale, XPackageEnumerateChunkAvailability,
XPackageInstallChunks, XPackageGetMountPathSize, XPackageGetWriteStats,
XPackageUninstallUWPInstance, XPackageEnumerateFeatures and
XPackageGetPackageKind were E_NOTIMPL placeholders.

- GetUserLocale: the host user's locale name ("en-US"), sized as the
  runtime's other string getters (E_NOT_SUFFICIENT_BUFFER when short).
  The console matches it against the package's languages, which are not
  known here.
- GetPackageKind: Game for our package, the no-package error otherwise.
- InstallChunks: a monitor of the finished installation, as the async
  form gives.
- EnumerateChunkAvailability / EnumerateFeatures: S_OK with nothing
  listed (the chunk layout and features are not known here).
- GetWriteStats: nothing written, a budget nothing reaches, a non-zero
  interval.
- GetMountPathSize: E_INVALIDARG (no mount handle is ever given);
  UninstallUWPInstance: none installed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
CheckFeatureSupport answered OPTIONS, ARCHITECTURE, FEATURE_LEVELS,
FORMAT_SUPPORT and MULTISAMPLE only; every other query was E_NOTIMPL,
which sends engines down fallback paths or stops them.

Now also FORMAT_INFO (two planes for depth with stencil and the two-plane
video formats), GPU_VIRTUAL_ADDRESS_SUPPORT, SHADER_MODEL (up to 6.7,
the console's highest), OPTIONS1 (waves of 32 to 64 lanes, 52 or 20
compute units by console), ROOT_SIGNATURE (up to 1.1), ARCHITECTURE1,
OPTIONS2-5, SHADER_CACHE, COMMAND_QUEUE_PRIORITY, EXISTING_HEAPS, OPTIONS6
(as it always is on Xbox) and OPTIONS7: the consoles'
RDNA 2 values at the sizes of the console's structures, which are
checked. Later queries stay E_NOTIMPL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Device slots 0x1c8 and 0x218, which the title calls and which fail, are
DeserializeGraphicsPipelineStateX and DeserializeComputePipelineStateX
(counted from the console's device method table; the same count puts
GetNodeCount, the pipeline creations and CheckFeatureSupport where the
table already has them). The title loads pipelines it cached on a
console with them.

Their descriptions are a root signature, the driver's pipeline packet
and metadata, and per stage its native code and metadata. Those formats
look like the FSPX entries victory_shader::native reads, which is not
checked, so the calls still fail with out cleared; the log now names the
method and gives each part's size and first words, instead of raw
description words, so that the formats can be compared from a run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XGComputeBufferLayout, XGComputeOptimalDepthStencilSwizzleMode,
XGValidateDepthStencilSwizzleMode and XGValidateDescriptor were not
served (an import of them got the loader's reporting stub).

- XGComputeBufferLayout: one plane of one linear mip, sized and aligned
  to 64 KiB as the device places a buffer, so the two agree.
- XGComputeOptimalDepthStencilSwizzleMode: SW_64KB_Z_X, none for a tiled
  depth buffer, as XGComputeOptimalSwizzleMode answers for depth.
- XGValidateDepthStencilSwizzleMode: S_OK for a depth format in
  SW_64KB_Z_X at 1, 2, 4 or 8 samples.
- XGValidateDescriptor: S_OK for 4 or 8 dwords (fields not checked).

Still not served: XGCreateTextureComputerFromDescriptor (needs the
console descriptor decoding victory-gpu has), DCC, BVH and the
DirectStorage shuffle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XNetworkingQueryConfigurationSetting, SetConfigurationSetting and
QueryStatistics were E_NOTIMPL. The three TCP receive-queue limits the
title sets are kept and read back (0 until set); statistics are all zero
offline; an unknown setting or statistics type is E_INVALIDARG.

The ConnectEx wrapper returned FALSE without an error when the
provider's pointer came back null; it now sets WSAEINVAL. (When the
lookup itself fails, WSAIoctl has set the error already.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An import of ApuHeapGetState got the loader's reporting stub. It now
reports, for the cached or non-cached heap: the blocks allocated from it
and their bytes, the bytes their rounding lost, and what is left of the
size ApuCreateHeap was given (nothing for a heap the first allocation
made); APU_E_HEAP_NOT_ALLOCATED before there is a heap. ApuAlloc now
keeps which heap a block is from, and ApuCreateHeap the sizes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XPackageEnumeratePackages listed nothing for any kind, so a title that
finds its own installation that way (kind Game) got none. Kind Game now
calls back once with this installation: its identifier, kind, store id
and title id (version, display name, description and publisher are 0 and
empty: the manifest parser skips attributes). Content still lists none.

The package folder's size was walked on whichever title thread first
asked for installation progress (seconds for a large install on slow
storage). It is now counted on a thread of its own, started when the
title first asks for its package identifier or progress; progress
reports 0 bytes until then, still complete and launchable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A skipped movie kept its soundtrack: Bink's sound runs on the DLL's own
thread, which frame skipping does not stop. BinkPause is now among the
wrapped exports; a movie is paused when it is first skipped, and the
title resuming it keeps it paused.

The wrappers wrote the frame counters at fixed offsets of whatever HBINK
pointed at. A movie whose header does not read as the known one (a size
a movie has, a frame count, a frame rate) is now neither skipped nor
written to, and says so.

Also notes in xg.rs why CopyFromSubresource takes no sample: multisampled
layouts are refused there, not copied as sample 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ffxCreateContext and ffxDispatch looked only at the first description of
the chain for the upscale type, so an upscale description chained behind
another (the API allows any order) went to the title's own FidelityFX
unseen. Both now walk the chain (16 deep at most) and rewrite or read the
upscale description where it is, passing the chain on as it was given.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
xgameruntime.lib (2610) asks QueryApiImpl for 5c48dedf-0b67-4492-a4b5-
6829b8e796e1 before XStoreQueryAssociatedProductsForStoreId* and
XStoreQueryPackageUpdates* (slots 0x268-0x288), and for 60b09f4e-1b85-
45b1-826c-169118e230e1 before XStoreIsAvailabilityPurchasable (0x230);
neither was registered, so those calls failed with ERROR_NOT_SUPPORTED
(or false) instead of the offline answer. Both now reach the store table
(IIDs and slots read from the library's disassembly), whose slots are
served: the two queries fail with the store network error through their
block, and nothing is purchasable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GetProcAddress on one of the title's own DLLs went straight to the
host's lookup, so a title that finds amd_fidelityfx_loader_xbox.dll's
functions by name bypassed the FidelityFX interposer (DLSS took none of
its upscalings), and a Bink export found that way bypassed the
VICTORY_SKIP_BINK wrappers. Such a lookup now passes through the same
two hooks as an import (bink::wrap, the new fidelityfx::wrap).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The texture computer's slots 0x38, 0x58 and 0x68 were E_NOTIMPL.

- GetTexelCoordinate: Layout::coordinate inverts Layout::offset. The
  slice comes of the slice size, the mip of the mips' ranges, the block
  of the block size; inside a block each address bit is one coordinate's
  in the modes addressed here, so the position splits into its x, y and
  z patterns. Tail mips, sharing one block, are searched. The result is
  checked against offset(). E_INVALIDARG outside the texture or in
  padding, E_NOTIMPL in XOR and MSAA layouts (as the copies answer).
- GetSwizzlePatternInfo: the plane's block in elements; the equation
  index is addrlib's "none" for linear, else the swizzle mode (the
  driver's own numbering is not known here).
- GetTextureViewDescriptor: E_INVALIDARG, the documented "cannot be
  described with a descriptor", with the dwords zeroed. Views are made
  through the device here, whose heaps hold records of their own, so a
  hardware descriptor the title wrote into one would not be read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A bind to [::] became [::1], so an IPv6 socket made dual-stack
(IPV6_V6ONLY off, which a title does to take IPv4 peers) no longer heard
127.0.0.1. Such a socket is now bound to ::ffff:127.0.0.1, the IPv4
loopback; an IPv6-only socket (Windows' default) keeps [::1]. One socket
holds one loopback address, and IPv4 loopback is what local tools and
other processes use; a client of "localhost" tries both families.
Binding all interfaces would reach the network, so that stays narrowed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XCurl is an OS component on the console, not in the package, so a title
using libHttpClient (or libcurl directly) imported XCurl.dll from
nothing: every call went to the loader's reporting stub.

The new xcurl module serves all 61 exports of the GDK's XCurl.lib, as an
unplugged console answers them (as modules::net has it): every transfer
fails with CURLE_COULDNT_RESOLVE_HOST, in the easy call's result, the
error buffer, and the multi handle's done message for each handle added
(perform leaves nothing running; wait and poll return at once). What
titles keep state in works as libcurl's does: easy handles keep their
private pointer, URL and error buffer (getinfo answers them, and zero
for what a transfer that never connected has), duphandle and reset;
string lists; escaping and unescaping; the URL API (a URL split into its
parts and put back together); version info. MIME, forms and shares are
accepted and do nothing. Strings handed out are freed by curl_free.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XMA: every context decoded from a cold state and flushed its tail when
its input ran out, so the seam between one voice's consecutive contexts
(which titles chain by copying the overlap buffer, word 8, from one to
the next) was decoded wrong: a click. A context with an overlap buffer
now keeps what its decoder carries there instead of flushing it (each
channel's last block length and half a frame of overlap, as 16-bit
samples, in a tagged layout of ours: the title copies it as bytes), and
a context enabled with one goes on from it, once. Only written inside
the APU heap block that holds the buffer. xma::Decoder gains carry() and
resume(). A voice that ends on a context with an overlap buffer loses
its last half frame (5 ms at 48 kHz).

xapu: DecodeConvertOpus and ConvertPCM were E_NOTIMPL at connect. Each
stream now has a sample-rate converter: pitch
input frames per output frame (1/8 to 8), ramping toward each command's
target by its rate per output frame (straight to it without a rate);
output in whole outputs of the connection's size (256, 480, 512, 960 or
1024 frames), the rest kept, all of it with Flush; deinterleaved input
and output (the second channel at the output size); results with the
current pitch, OutputReady / NeedMoreInput / MoreOutputAvailable and the
kept and converted frame counts. Reset with the Decoder option resets
the decoder only. Linear interpolation, not the hardware's filter.

Also moves xaudio2's S_OK import into its tests (it warned).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When DLSS takes the upscalings, the title's FidelityFX context is made at
the shipping FSR4's sizes, smaller than asked. On a dispatch DLSS then
refused (a resource it could not take, a resize), the title's own could
not run at the size asked either, and nothing ran: the output kept its
last frame, a freeze or stale image.

victory_gpu::upscale_fallback now does it at that place of the title's
list, as DLSS would be put there (inputs prepared, the output marked
written on the host): a compute pass that samples the colour input's
render region bilinearly, held half a texel inside it, over the whole
output. Its views come from a ring of 32 shader-visible slots. Output
formats a compute shader stores to plainly only (RGBA32F/16F, R10G10B10A2,
R11G11B10, RGBA8); elsewhere none runs, as before. No sharpening or
temporal accumulation: it keeps the picture moving.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
BinkCopyToBuffer and BinkCopyToBufferRect were not wrapped (more than
four arguments), so a title copying a skipped movie's frame got what the
undecoded frame buffers held. Both are wrapped now with eleven argument
slots, the longer one's: a callee reads only its own arguments and the
caller frees the stack (the x64 convention), so either goes through
whole without RAD's exact signature. A skipped movie's copy is not made
and reports success; others go to the DLL. GPU frame paths are still not
wrapped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The command queue's method tables had 36 slots; the console's
ID3D12CommandQueue has 38. A call to EnableLiveDebuggingX
(0x120) or WaitX (0x128) read a function address from what follows the
table and jumped to it. Both tables now have all 38 slots; the last two
log and fail with E_NOTIMPL as any slot we have not written does.

object::console_slots holds each object's slot count on the console, at
the newest interface level it has (Device11, GraphicsCommandList8,
Resource2, Fence1, Heap1, DXGIFactory2, ...), and every GPU method table
asserts at compile time that it is at least that long. Built before the
queue fix, only the two queue tables failed it.

A test calls slots 0x120 and 0x128 of both queue tables and checks that
the nine queue methods we answer sit where the console puts them in the
newer layout. Whether the title calls either slot is not known.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A query with no room for the object returned 0x80070032 and logged even
an area we answer as "runtime API area not implemented". It now fails
with E_POINTER first, as IUnknown::QueryInterface does: the runtime's
own answer is not documented, and the title's stubs always pass room
for the object, so this only keeps the result and the log honest.

The queue table test also checks AddRef at 0x08 and Release at 0x10:
the queue's AddRef was already the counting object::add_ref that
missing_table puts in every table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tests now check every slot the device and newer command lists fill
against the console's ID3D12Device11 and
ID3D12GraphicsCommandList8, each by its method's
name: 50 device slots, 66 list slots. The two
deserialize slots are generic functions, whose address need not be
unique, so they are called instead: both fail and leave no pipeline.
The comments that called these layouts, and the queue's, inferred or
unknown now name them; 0x400 is RSSetShadingRateX, not written.
The slot tables in these tests and the queue's are #[rustfmt::skip]
tables, as elsewhere in the repository.

List slot 0x470 is OMSetSampleMaskX(QuadSampleMask). It is still not
applied, since which value means every sample is not known,
but each distinct value the title sets is now logged once (the first
eight) instead of being dropped silently, to show whether a title masks
samples at all. Thin lists get the same slot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both went to the host, which answered victory's own command line
(`play <exe> --res ... --dlss ... --fps ...`), while argv (__p___argv)
already holds only the program and the title's arguments. The title
imports GetCommandLineA from api-ms-win-core-processenvironment-l1-1-0,
at one call site. Both now answer that same list as one line, kept for
the whole run: each argument quoted as CommandLineToArgvW and the C
runtime read it back (blanks and quotes, backslashes before a quote
doubled), the program only quoted, as argv[0] is read without escapes.
The kernel module serves the processenvironment API sets for them; a
GetProcAddress on kernel32 finds them too.

A test splits the line with the host's CommandLineToArgvW for a list of
awkward arguments (empty, blanks, quotes, trailing backslashes) and gets
the same list back, and checks that what the title is given matches its
argv and holds none of victory's options.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
CheckFeatureSupport(FORMAT_SUPPORT) answered every use of every format,
an undefined one too. Each format the title asks about is now logged
once (the first 64) with the answer, and the answer is the host
device's: a format it does not support fails with E_FAIL and both
support words zero, as D3D12 does. The 16-bit depth with stencil
formats are asked as their 24-bit stand-ins (resource::pc_format), and
where we render to a stand-in (resource::target_format: B5G5R5A1,
B4G4R4A4, R9G9B9E5 on hosts that refuse them) the stand-in's render
target, blend, multisample and typed UAV uses count too, since that is
what the title is given. Without a host device, and for the console's
own formats PC has not (116, 117, 189, 190; 191 is another format on
PC), every use is still claimed: what the console's GPU supports per
format is not known.

A test checks the answer against fake hosts (with and without one, a
lacking format, a stand-in, a console-only format) and through the
device's slot on the real host when there is one (RGBA8 a 2D texture
and render target, an undefined format E_FAIL).

descriptor::increment_size is #[inline(never)]: with this change a
release build gave the device table its own copy of it, and the slot
test, which compares addresses, failed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GlobalMemoryStatusEx (api-ms-win-core-sysinfo-l1-1-0 in the title)
went to the host and reported the PC's RAM, while
XMemGetWorkingSetStatistics reports the console's title budget (13.5 GB
on Series X, less what was transferred). It now calls the host, which
checks dwLength and fails as before, then reports the title's limit as
the total physical memory and that limit less what the working set
says is used as available, with the memory load from the two. The page
file and virtual figures stay the host's, the page file's raised to at
least the physical ones. The call is logged once. What the console
answers here is not known: this follows from its own
memory figures. As the working set's, "used" is all our process has
committed, so in a long run nothing may read as available.

A test checks that the total agrees with the working set's limit, that
a wrong dwLength fails, and the figures for a use under and over the
limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GetErrorEvent handed out one process-wide event nothing ever set, and
RetrieveErrorRecord wrote a failure count of 0 and nothing else, so a
title waiting on the event never heard of a failed read. Now
each queue has its own event,
set when one of its requests fails, and RetrieveErrorRecord writes the
whole DSTORAGE_ERROR_RECORD: the failures since the last call and the
first failed request in enqueue order (its HRESULT, command type, and
EnqueueRequest's parameters: options, destination and size, the file's
path as the title named it and the offset, or the memory source, the
source size, cancellation tag and name), then starts again with none.
The record is taken when the request fails, before it is reported
complete, while its name is still the title's to read. Whether the event resets
itself is not known; ours stays set until the
record is retrieved. Nothing is cancelled here, so no cancelled request
is counted. The event is closed with the queue.

The record's layout is checked with assert_layout! as the console lays
it out: 656 bytes, FirstFailure at 8,
Filename at 36, Name at 592. A test reads past a file's end and feeds a
bad zlib stream in one batch: the event is set, the record counts 2 and
names the first (END_OF_FILE, offset, tag, path, name), and after the
retrieval the count is 0 and the event reset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title imports WerRegisterFile from
api-ms-win-core-windowserrorreporting-l1-1-0; it went to the host with
the title's path, which on one of our virtual drives (the package
drive, save and temp drives) names nothing the host can find. It now
goes through the same rewriting as the other path APIs in `files`, and
the files module serves that API set.

A test registers a file by its virtual-drive path, then unregisters it
with the host's WerUnregisterFile by its host path: that succeeds once,
so the registration was made under the host path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GetProcAddress on a host module looks our overrides up by the module's
file name. A title that loads an API set by name gets the handle of the
host DLL behind it, so overrides served only under the API set were
missed: the window ones (CreateWindowExW/A, served under
ext-ms-win-rtcore-ntuser-window-*) through user32.dll, and the device
type's registry ones (served under api-ms-win-core-registry-* and
advapi32) through kernelbase.dll.

The registry module now also serves kernelbase.dll: that DLL is
host-allowed, so loading it is unchanged, and no title image imports it
(dumpbin /dependents of the exe and its DLLs). user32.dll is not added
to the window module's list: that would also make it a pseudo module a
title could load, where it is refused now, as the console has none.
host_override instead looks a user32 name up under the window API set
too, from a small table. Both overrides call the host directly
(windows-sys, or GetProcAddress on the system DLL), so nothing is
wrapped twice.

A test checks that GetProcAddress on the host's user32 handle, and on
the handle loading the window API set by name gives, returns our
CreateWindowExW; that kernelbase and advapi32 give our RegOpenKeyExW;
that a name we do not override stays the host's; and that loading
user32.dll by name is still refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SetPixelShaderDepthForceZOrderX (list slot 0x248, newer lists 0x258)
and RSSetShadingRate (0x3e0, newer 0x3f0) were silent no-ops. Neither
is applied still: the host has no forced depth order, and coarse
shading would change what the title's pixels look like where it may
not expect it. Each now logs what the title sets, as OMSetSampleMaskX
does: every distinct value once, the first eight. ForceOrder's both
values are logged, as which a list starts with is not
known; for the shading rate, settings other than 1x1 with
pass-through combiners (both 0, D3D12's reset state),
with null combiners read as pass-through. The noting (a repeat costs
two loads) is a small Noted type both use.

The newer-list slot test names both at their new functions; a test
checks the noting and calls both with and without combiners.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The voice callbacks of an XMA2 source voice are the host PCM voice's,
so OnVoiceProcessingPassStart's BytesRequired counts 16-bit PCM bytes,
not XMA2 data. The module comment now says so, and that a title
streaming XMA2 by that figure would submit more than it needs. No play
log so far shows XAudio2 in use, so nothing changes; what the console
counts there is not known.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XTaskQueueTerminate did not follow XTaskQueue.h (2610) in three ways.
It drained every callback on the queue's ports, so terminating a
composite queue canceled the pending work of other queues sharing those
ports ("does NOT automatically terminate other queues sharing the same
ports"); a thread-pool queue's waiting callbacks, kept in the pool's
own list, were not canceled at all. It called the termination callback
at once, while callbacks of the queue could still be running on other
threads ("invoked after all work and completion callbacks have been
canceled or completed"). And it ignored `wait`: the callback always ran
inline ("asynchronously" without it).

A task now notes its queue (weakly: a queued task does not keep a
closed queue alive), and each queue counts its callbacks from
submission until they have run or been canceled. Termination takes back
only its own from its ports, the pool and its delayed callbacks, cancels
them, then calls the termination callback once none is outstanding: on
the caller's thread with `wait`, which returns after it, or on a thread
of ours without. A per-queue gate covers checking for termination,
counting and enqueueing, so nothing is queued after termination has
looked; no callback runs under it.

Where the header is silent, behaviour is kept: canceled callbacks still
run on the caller's thread, and a callback that terminates its own queue
and waits is not left waiting for itself. Four tests: the three header
rules (each failed before) and the self-termination case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The narrow command line was the wide one's UTF-8. Windows' GetCommandLineA
gives it in the process's ANSI code page, so a title reading a non-ASCII
argument from it got bytes its code page decodes differently. It is now
the wide line through WideCharToMultiByte(CP_ACP), made once and kept
for the whole run as before; a character the code page lacks becomes its
default character, as the host's own conversion does, and a NUL inside an
argument still ends the line there.

A test checks a non-ASCII line against WideCharToMultiByte of the wide
one (and that it is not UTF-8 where the code page is not), that it reads
back to the wide line where the code page has every character, and that
ASCII and the NUL cut are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The available page file was raised to at least the title's available
memory. It is the commit the PC has left, so a title could be told of
headroom Windows does not have and fail to commit what it was promised.
It now stays the host's figure; the physical figures (the title's limit
and what it uses) and the page file's total (at least the limit) are as
before.

The working-set test no longer expects the page file's available part to
reach the physical one; it checks that a host headroom below the title's
available memory (1 GB against 6 GB) is not raised, and that a page file
smaller than the limit keeps the host's available part.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XMemAllocDefault ignored XALLOC_ATTRIBUTES' MemoryType and PageSize:
every type but 32-bit addresses came from the host heap,
whose blocks the GPU side does not track as title memory and whose writes
it does not watch, and lay above 2^40, where the console keeps no title
memory.

Every type other than XALLOC_MEMTYPE_HEAP_CACHEABLE (the graphics and
physical ones) now comes from XMemVirtualAlloc with the GRAPHICS flags,
as 32-bit addresses already did: committed, write-watched, noted to the
GPU side, below 2^40. The alignment is honoured (a reservation is 64 KiB
aligned, 2 MiB with XMEM_2MB_ALIGN above that; nothing past 512 KiB is
named, and past 2 MiB is refused), and XALLOC_PAGESIZE_2MB asks for
2 MiB pages. Heap memory stays on the heap. The types' cache attributes
(write-combined, uncached, GPU read-only, non-coherent, executable) are
not applied: the block is cacheable read-write host memory, as
XMemVirtualAlloc's is.

XMemFreeDefault keeps a set of the reservations it handed out and
releases those whatever attributes the free names, through the title's
VirtualFree, so what the GPU side noted of the block goes first (32-bit
blocks were released without that); anything else goes back to the heap.
Each such block now takes at least 64 KiB of address space.

A test allocates three types (write-combined, GPU uncached, physical
uncached; 16 B, 512 KiB and 64 KiB aligned, one in 2 MiB pages): each is
aligned, a whole committed reservation in the console's range that
XMemVirtualQuery reports as graphics memory, write-watched once written,
and released by XMemFreeDefault with other attributes; a heap type is
still a heap block, and an alignment past 2 MiB is refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GetModuleHandle of one of the title's DLLs that is not mapped yet (one in
its folder, as amd_fidelityfx_upscaler_xbox.dll) answered NULL with
ERROR_MOD_NOT_FOUND, as it should, but by way of the refusal of host DLLs
outside the host policy, which warned "a host DLL outside the host
policy: refused". It is now told apart: a name that is a file in the
title's folder (runtime::title_dir, the main image's folder) gives the
same answer and a debug line, "a title DLL not loaded yet". Loads and
names elsewhere are as before.

find_module is split so this can be tested: dll_file (the name's file),
resolve (what the name is, given the title's folder) and answer (what
the title gets). The refused names are a module static.

A test gives resolve a temporary folder holding a stand-in DLL file:
probes of it, in any case and without extension, are "not loaded";
a folder of a DLL's name, no title folder, wininet.dll and a load the
title DLL loader turned down stay refused; the answer for "not loaded"
is NULL with ERROR_MOD_NOT_FOUND and does not note the name as refused.
(The ANSI command line test's last call is also reflowed for rustfmt.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
runs_code's comment said a load as data or resources (LoadLibraryEx with
DONT_RESOLVE_DLL_REFERENCES, LOAD_LIBRARY_AS_DATAFILE(_EXCLUSIVE) or
LOAD_LIBRARY_AS_IMAGE_RESOURCE) of a title DLL we have not mapped "can go
to the host", but such a load was handled as a probe: refused, or since
the previous commit "not loaded yet". The behaviour now matches it: for
a DLL in the title's folder the host loads that file by its full path,
with the title's flags, so it runs no code and the host's own search
path (our executable's folder) does not matter. A mapped title DLL is
still given as the image we mapped, and other names are as before.

find_module now takes how the module is asked for (Ask: a probe, a load
that runs code, a load as data with its flags) in place of a flag;
runs_code became Ask::library.

A test copies a system DLL with a version resource into a temporary
folder as a stand-in title DLL: each data flag (and a combination) gives
the host load of that file with those flags, LOAD_WITH_ALTERED_SEARCH_PATH
alone runs code, a load and a probe do not go to the host, and wininet
as data stays refused; the host's handle has the resource, and is freed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The network guard had three tests in about 1,180 lines. A fourth checks
its edges, through the module's own wrappers, with nothing leaving the
machine (blocked calls stop before the host's; the rest go to a loopback
listener):

- connect and sendto to IPv4-mapped IPv6 addresses: ::ffff:8.8.8.8 and
  ::ffff:192.0.2.1 are unreachable (WSAENETUNREACH), ::ffff:127.0.0.1
  connects and sends on a dual-stack socket;
- AF_UNIX, an unknown family, IPv4 and IPv6 addresses shorter than their
  family needs, a length of 3 or -1 and a null address are refused, for
  connect and sendto;
- sendto without an address goes to the peer connect vetted;
- WSAConnectByNameW's guard takes localhost (any case), IPv4 and IPv6
  loopback literals and [::1]; other names fail with WSAHOST_NOT_FOUND
  and other literals (::ffff:8.8.8.8 among them) with WSAENETUNREACH;
  127.0.0.1 by name reaches the listener through the host;
- getaddrinfo of other names (and of "[::1]", not a literal) fails with
  WSAHOST_NOT_FOUND and a null result;
- WinHttpConnect to names and literals that are not loopback (bracketed
  mapped IPv6 too) gives no handle and ERROR_WINHTTP_CANNOT_CONNECT;
  localhost, 127.0.0.1 and [::1] give one (it sends nothing by itself).

No defect turned up, so nothing else changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- ClearUnorderedAccessViewUint/Float (list slots 0x1a8/0x1b0) clear
  textures on the host list through `external`, so thin lists keep
  their order; buffer views are logged once and left as they are.
- Pipeline GetInformationX (0x58) returns E_NOTIMPL with a null blob,
  logging each kind asked for once, rather than an unfilled slot.
- XAppCaptureTakeScreenshot asks for the next presented frame, which
  is read back on the present list and saved as an RGB PNG under the
  title's data folder (screenshots/photo-<secs>-<n>.png). The PNG
  encoder and read-back move from the diagnostics capture into
  `screenshot`, which capture now uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The newer layouts were chosen only for a device created as
ID3D12Device11. A title's runtime stub passes its own build to
InitializeApiImpl*: 26100.7901 for the title, 26100.9661 for newer
stubs. A stub at least the
title's build now gets them whatever interface the device is created
as; older or unknown stubs keep the interface rule. The first build
seen counts (the title's image initialises before its DLLs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
DeserializeComputePipelineStateX (device 0x218) failed, so the title
went without the FidelityFX upscaler's pipelines it loads that way. A
compute description's parts (register packet, pipeline metadata, code,
code metadata) are the entries of the FSPX blobs the upscaler's own
shader containers carry: they are put back into such a blob, as the
ACCC part of a container, and become a pipeline like any other. All 29
blobs in the title's upscaler read back as the same program (ignored
test, VICTORY_FFX_DLL). VICTORY_DESERIALIZE_COMPUTE=0 keeps the old
failure.

Graphics descriptions (0x1c8) still fail: their 388-byte register packet
and stage metadata are another layout, and their parts are in the
title's packed data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Graphics pipelines the console serialized (device 0x1c8) still fail: their register packet and stage metadata are not decoded, and their parts are only in the title's packed data. VICTORY_DESERIALIZE_DUMP=<dir> saves each distinct description's parts (packet, metadata, each stage's code and metadata) in a folder of its own, so the layouts can be worked out from a title run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream already answers the blocking calls as their async twins do
(4af086d); its versions are kept, and XGameSaveInitializeProvider now
also fails with E_INVALIDARG when the title gives no room for the
provider, clearing it first otherwise. XGameSaveFiles gets a folder per
configuration of the only user, beside the container saves, handed out
as the root of a drive of its own (as persistent local storage is), and
its remaining quota.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XMemGetWorkingSetStatistics wrote the first 0x50 bytes; newer titles' structure is 0x78, so such a title read DirectStorageUsed, the peak use and the page-table sizes from whatever its stack held. A title whose runtime stub is at least build 26100.9661 now gets them: the peak of what it used, zero for the rest, as a retail console without tools memory. The structure has no size field, so titles of older or unknown builds still get the first 0x50 bytes only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title calls SuspendX (queue 0xb8) when the system suspends it, and it failed as a method we lacked. SuspendX now sends what the title gave the queues to the card and settles what is in flight, as before a fence wait; ResumeX succeeds. GetClockCalibration (0x98) reads the GPU clock lists write their timestamps with and the CPU's performance counter together.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XUserGetMaxUsers gives one (the only user). The UTF-16 token call fails through its block with the documented failed-to-get-token error, as the UTF-8 one does; gamer pictures fail through theirs (they come from the service). Issue resolution, in both string forms, has nothing to resolve. XUserGetSignOutDeferral reports the documented deferral-not-available (the user never signs out). XUserAddByIdWithUiAsync gives the user for its id and no user for any other. XUserGetDefaultAudioEndpointUtf16 and XUserFindControllerForUserWithUi stay unanswered: the header documents no offline answer for them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The message dialog (0x18/0x20) is a host dialog with the title's
buttons; it ends with the button chosen, the cancel button when
dismissed. The error dialog (0x70/0x78) shows the code and context in a
host message box. Achievements close at once with nothing to show, as
the profile card does. Invites, the multiplayer-activity invite and
state sharing close as dismissed (E_ABORT): no one to reach offline. The
player picker picks nobody when nobody is required, else is dismissed.
The notification position hint and XGameUiSetUiCallbacks succeed (our
dialogs always stand in for the system's). Web authentication, the
inline text entry, the manage-space page and the Set*UiResponse calls
stay unanswered. The file is now rustfmt-clean.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
xgameruntime.lib (2610) reaches XErrorReport, XErrorSetCallback and
XErrorSetOptions through QueryApiImpl (area 8ca467f7), so our XErrorReport
export was bypassed and the setters failed. The area is now served: a
report is logged and passed to the title's callback; options are logged,
not acted on. XGameActivation (7f0fe8b8/2e4f76fe), XGameProtocol
(95fd18d2/026b010c) and the pending-invite calls of XGameInvite
(014d1cc3) take registrations that never fire offline; accepting a
pending invite is refused as a bad argument (none can be pending).

The newer XUser interfaces (store user, sign-out, platform prompts) and
the streaming, broadcast, capture-metadata and PlayFab save areas stay
unserved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XTaskQueueRegisterWaiter and XTaskQueueUnregisterWaiter (task-queue
slots 0xa0/0xa8) failed. A waiter now waits on its handle in the
system's thread pool; once the handle is signaled its callback is
submitted to the port, as XTaskQueueSubmitCallback would. The header
says the queue invokes it when the handle is satisfied and nothing of
a second time, so it is submitted once per registration. Unregistering
waits out a submission under way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
xmem.dll exports the title side can import and the module lacked,
which no host DLL provides: XMemGet/SetAllocationHysteresis (kept per
memory type and heap size), XMemPreallocateFreeSpace (no pool to fill),
XMemCreateWin32Heap (a host heap with the flags the host knows),
XMemGetTitleHeap (the process heap), XMemSet/GetWin32HeapName,
XMemSetOption (logged), XMemGet/ResetWriteWatch (the host's). XMEM_OPTION's
layout is checked. The statistics, tag, history and hook
exports stay unserved: their results are not known.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The device answered ID3D12Device1 to 8 and ID3D12Device11, but a query
for Device9 or Device10 was refused, although Device11 derives from
them on PC and the device's table already holds their methods. Both are
now levels the device answers to, with the ids from the Windows SDK's
d3d12.h. Device11's place in the list is a named constant, so the
newer-layout rule still keys on it. No play log shows a title asking
for either.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 21:08:08 +00:00
With b0c6fd1 the title's DeserializeComputePipelineStateX calls were
answered with pipelines made from the console code they carry. Many of
them were the title's own compute passes, not only FidelityFX's, and
that code does not translate (350 compute shaders, against 9 when they
are refused), so their dispatches were dropped and the scene stayed grey
behind the interface. Refused, as before b0c6fd1 and as on main, the
title builds those pipelines itself from shaders that translate.

Loading is now opt-in with VICTORY_DESERIALIZE_COMPUTE=1. Checked in the
game: grey with b0c6fd1 at every bisect step that had it, the scene back
with this change on the full branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github manually merged commit dda28fb170 into main 2026-11-29 08:21:51 +00:00
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/trustno1-coder--VIctory-NVIDIA!1510
No description provided.