diff --git a/.agents/skills/game-render-analysis/SKILL.md b/.agents/skills/game-render-analysis/SKILL.md index bd2cc96d3..11c4ea7ad 100644 --- a/.agents/skills/game-render-analysis/SKILL.md +++ b/.agents/skills/game-render-analysis/SKILL.md @@ -11,6 +11,43 @@ run from the repository root. This skill supplies a research workflow, not permi launch a game, modify an unrelated installation or publish a release. Follow the current user's scope; AC7 testing in this session is user-run, without autonomous launch or termination. +## Decide where the defect lives first + +AGENTS.md Rule 5 is the boundary for every change this skill leads to. The integration prepares +the inputs and presents the output; every technique between them is the core, shared by all games. +Classify a defect before touching code: + +- **Input defect, fix in the integration.** Something that reaches ReScaleFrame is missing, wrong, + stale or reported at the wrong moment: no object or camera motion for a material, a depth domain + or jitter the engine applies differently, a buffer captured before its producer ran, a shader + that lacks a motion pass, a HUD-less frame taken after UI, an engine event reported early or + late. Repair it at the source in `games//` or the engine integration, so the core receives + correct inputs. Do not teach the core to compensate for one game's input. +- **Technique defect, fix in the core.** The inputs are right and an upscaler, frame generator, + sharpening mode, latency or pacing technology still misbehaves: marker order, frame-end and + pacing rules, history resets and aborts, provider switching, presentation fallback, device + creation timing. That is fundamental. Fix it in the Runtime or the shared loader so every game + inherits it; never patch around it inside one adapter. The test: would another engine with the + same property hit it? Then it is core. +- **Parity.** Every integrated game offers the same features. A feature or option that works in + one game and is absent or greyed in another is a defect unless the hardware or the vendor makes + it impossible on that machine. Look for the logic that leaked into an adapter or a host. + +To tell the two apart, compare the same technique in a second game or host, and compare the +inputs against what the vendor requires (the shader-input audit below). A symptom that follows the +technique across games is core; one that follows the game across techniques is its inputs. A +symptom that differs per vendor in one game usually means an input that some vendors reconstruct +and others consume as given (for example frame generators that rebuild camera motion from matrices +versus ones that use the motion texture alone). + +When judging a regression, the reference is the build that was last installed and working in that +game (its deploy backup), mapped to a commit, not the tip of the main branch. That reference only +dates a change. It is never the definition of correct: code that equals the old build is a +faithful port, not correct inputs, and a fact neither version carries (a texture's row order, a +pass that runs later than assumed) is invisible to a diff. Establish what the game produces from +the game itself first: its installed assemblies, assets and shaders, the passes that write each +input, and each input's orientation, format, extent and space. Then check our code against that. + ## Resume from evidence Before proposing an experiment, read the current game evidence, implementation tracker and diff --git a/.agents/skills/game-render-analysis/references/reference-and-shader-audit.md b/.agents/skills/game-render-analysis/references/reference-and-shader-audit.md index 016613f1e..2874c41c6 100644 --- a/.agents/skills/game-render-analysis/references/reference-and-shader-audit.md +++ b/.agents/skills/game-render-analysis/references/reference-and-shader-audit.md @@ -81,3 +81,38 @@ latency claims. Update research, engine metadata and the implementation tracker with each unresolved required input, binding, repair and validation case. Do not mark the integration complete until these requirements are satisfied at the scope requested by the user. + +## Core rules (moved from AGENTS.md) + +Before designing a render integration from a working reference, inventory its full relevant +implementation, not selected hook or SDK snippets. Pin the revision and consumed dependencies; +account for every subsystem, feature and shader family, including shared code, settings, +lifecycle, failure recovery, compatibility restrictions and tests. Trace the complete frame +from native producers through reconstruction and final presentation. Maintain a comparison of +reference mechanisms against RSF: implemented, deliberately different with evidence, missing, +or unverified. A file list alone is not a semantic inventory. Reuse a recorded inventory while +its revision and assumptions remain valid; reopen it when new evidence contradicts them. + +For shipped games, inspect the matching executable and native shader bytecode as well as +reference source. Use REA when executable semantics require it, retaining actual tool evidence +and failed approaches. An unavailable decompiler does not turn reference names into native +proof. Shared engine ancestry, a nearby release, Address Library entries and matching strings +are leads, not permission to reuse layouts, ABI, shader conventions or hook ordering. + +Every SR/FG integration requires a full shader and buffer coverage audit. Account for graphics +and compute stages, permutations, actual resource bindings and formats, depth/motion writes, +previous object/instance/bone/deformation history, transparent and forward paths, particles, +water, volumes, UI and downstream consumers. Distinguish shader declarations from active draw +bindings and valid zero motion from missing writes. Determine and implement verified required +shader, buffer or producer repairs at their owner. Listing a missing input is not completing +that repair; fabricated vectors or substituted current history do not close the gap. + +Native, reduced-resolution and failure paths all need valid output. Once a reduced frame is +rendered, returning to native code is not proof that it will reconstruct the active rectangle. +Verify recovery and every later consumer. SDK success, a green build, a stationary image or a +single quality setting cannot establish visual or temporal correctness. Retain user-rejected +images as failed acceptance evidence and test all required qualities, motion and transitions. +Capture actual evaluation frames with matching source/view/resource identity; preparation-only +or partial captures cannot prove the failing frame. Keep unresolved required coverage and +repairs as completion blockers, without shrinking the user's goal or adopting a reference's +unsupported-mod policy as RSF's delivery policy. diff --git a/.agents/skills/game-render-analysis/references/session-lessons.md b/.agents/skills/game-render-analysis/references/session-lessons.md index 164056bba..0f355e68c 100644 --- a/.agents/skills/game-render-analysis/references/session-lessons.md +++ b/.agents/skills/game-render-analysis/references/session-lessons.md @@ -13,12 +13,12 @@ No new numerical in-game FPS comparison accompanied the final acceptance. | Question | Owner and evidence | | --- | --- | -| Native view size, UI, graph, queued lifetime | `games/ac7/src/native_renderer.cpp`, `render_scope.cpp`; [native refactor](../../../../docs/research/ac7-native-renderer-refactor-20261001.md) | +| Native view size, UI, graph, queued lifetime | `games/ac7/plugin/src/native_renderer.rs`, `render_scope.rs` (queued scopes, [Rust note](../../../../docs/research/rust-ac7-render-scopes.md)); [native refactor](../../../../docs/research/ac7-native-renderer-refactor-20261001.md) | | Per-view/runtime coordination | `runtime/orchestrator/src/native_sr.cpp`, `native_regions.cpp`, `plugin_session.cpp`; copied C ABI packets in `sdk/game/include/rescaleframe/game_renderer.h` | | Sparse velocity validity and camera motion | `runtime/graphics/src/motion_resolve.cpp`; [motion research](../../../../docs/research/ac7-motion-vectors.md) and [stability](../../../../docs/research/ac7-stability-20261001.md) | | Wing/cloud masking, cloud resolution | Game-owned TrueSky hooks and `games/ac7/src/truesky_depth.cpp`; [aircraft/cloud research](../../../../docs/research/ac7-plane-artifacts-20261002.md) | | Colour drift and producer precision | Native scene-format policy plus `runtime/graphics/src/colour_fidelity.cpp`; [colour research](../../../../docs/research/ac7-ui-hdr-20260930.md) | -| FSR/XeSS transfer, FSR4 capability | `runtime/orchestrator/src/sr_bridge.cpp`, `runtime/backends/fsr/src/fsr4_compat.cpp`; [interop research](../../../../docs/research/sr-interop-performance-20261002.md) | +| FSR/XeSS transfer, FSR4 capability | `runtime/orchestrator/src/sr_bridge.rs` (with `sr_bridge_platform.cpp`), `runtime/backends/fsr/src/fsr4_compat.cpp`; [interop research](../../../../docs/research/sr-interop-performance-20261002.md) | ## Failed assumptions that changed the design diff --git a/.agents/skills/truesky-render-integration/SKILL.md b/.agents/skills/truesky-render-integration/SKILL.md index c8be9fd00..d0085b669 100644 --- a/.agents/skills/truesky-render-integration/SKILL.md +++ b/.agents/skills/truesky-render-integration/SKILL.md @@ -10,6 +10,8 @@ Read [AGENTS.md](../../../AGENTS.md), relevant [render analysis](../game-render-analysis/SKILL.md) and [the AC7 depth reference](references/ac7-depth.md). TrueSky versions differ; these sites and the x1 kernel are specific to the fingerprinted AC7 DLL/effect. Preserve the user's testing scope. +Cloud depth, motion and resolution are inputs: repairing them is integration work and stays with the +game (AGENTS.md Rule 5). Do not add cloud-specific handling to the core to hide a bad input. ## Trace the complete cloud producer diff --git a/.agents/skills/truesky-render-integration/references/ac7-depth.md b/.agents/skills/truesky-render-integration/references/ac7-depth.md index bd1d89649..ea36f72f6 100644 --- a/.agents/skills/truesky-render-integration/references/ac7-depth.md +++ b/.agents/skills/truesky-render-integration/references/ac7-depth.md @@ -10,8 +10,10 @@ why earlier clean-looking results were regressions. It is specific to the instal `c6c58ea3a355ed345888b1528e84aa753c6fc69db9c8fb8789e729c7651004d0`, 1,711,616 bytes. - `mixed_resolution.fxo`: 45,263 bytes, CRC32 IEEE `78881ef3`; full SHA-256 and pass/shader fingerprints are in [the hook map](../../../../docs/research/ue418-hook-map.md). -- Runtime implementation: [native_renderer.cpp](../../../../games/ac7/src/native_renderer.cpp) - and [truesky_depth.cpp](../../../../games/ac7/src/truesky_depth.cpp). +- Runtime implementation: sites, bytes, fingerprint, install, rollback and restore in + [truesky.rs](../../../../games/ac7/plugin/src/truesky.rs); relay handlers and D3D11 checks in + [native_renderer/sky.rs](../../../../games/ac7/plugin/src/native_renderer/sky.rs); the x1 kernel in + [truesky_depth_bounds.hlsl](../../../../games/ac7/plugin/src/truesky_depth_bounds.hlsl). - Captures, revisions, precision results and limitations: [aircraft/cloud research](../../../../docs/research/ac7-plane-artifacts-20261002.md) and [engine evidence](../../../../games/ac7/engine.json). diff --git a/.agents/skills/ue418-render-integration/SKILL.md b/.agents/skills/ue418-render-integration/SKILL.md index f1d8aaee1..4726d39a3 100644 --- a/.agents/skills/ue418-render-integration/SKILL.md +++ b/.agents/skills/ue418-render-integration/SKILL.md @@ -10,6 +10,9 @@ For shared renderer concepts, use [unreal4-render-integration](../unreal4-render This skill adds the version-specific evidence for ReScaleFrame's AC7 integration. Read [the ownership reference](references/ac7-native-ownership.md) and the latest game evidence for an AC7 change. Build-specific RVAs/private layouts are not portable UE4.18 APIs. +What this skill covers is input and output work, which belongs to the AC7 integration. A defect in +how a technique behaves once its inputs are right belongs to the core (AGENTS.md Rule 5), even when +AC7 is where it was found. ## Match the right source and program diff --git a/.agents/skills/unreal4-render-integration/SKILL.md b/.agents/skills/unreal4-render-integration/SKILL.md index 98663d6f4..f1ebf27ac 100644 --- a/.agents/skills/unreal4-render-integration/SKILL.md +++ b/.agents/skills/unreal4-render-integration/SKILL.md @@ -12,6 +12,11 @@ Determine the game's engine branch and match the implementation before using any Perform the shared render-analysis skill's shader-input and motion-coverage audit for every integration, even when no specific visual defect has been reported. UE4 games can carry custom renderers; concepts transfer more reliably than layouts or addresses. +An Unreal integration only prepares the inputs and presents the output (AGENTS.md Rule 5): view, +target, depth, motion, jitter, UI and event facts are its work; how an upscaler, frame generator or +latency technology behaves is the core's, and a fix there must serve every engine. Unreal's render +thread overlaps the game thread, so report each event at its true moment and let the core order +them. For AC7/4.18 specifics, read [ue418-render-integration](../ue418-render-integration/SKILL.md). ## Find the native owner diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index a03e1eb32..0e2c44909 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -3,7 +3,9 @@ name: Verify on: push: branches: [main] + paths-ignore: ['**/*.md', 'docs/**', 'LICENSE', '.agents/**'] pull_request: + paths-ignore: ['**/*.md', 'docs/**', 'LICENSE', '.agents/**'] permissions: contents: read @@ -12,14 +14,66 @@ concurrency: group: verify-${{ github.ref }} cancel-in-progress: true +env: + # Incremental artifacts only help local rebuilds; in CI they bloat the cache. + CARGO_INCREMENTAL: 0 + LLVM_DIR: C:\llvm-22.1.8 + jobs: windows: runs-on: windows-2022 steps: + # The vendor SDK submodules (vendor/streamline, fidelityfx, fidelityfx-vulkan, xess) supply the headers that + # switch the DLSS, FSR and XeSS backends on; compiling and linking them needs no vendor GPU. About 950 MB of + # checkout at depth 1. The signed Streamline runtime (eng/fetch-vendor.ps1) is not fetched: nothing here loads it. - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + submodules: true + # rust-toolchain.toml names the toolchain; rustup no longer installs it implicitly. - name: Install pinned Rust toolchain shell: pwsh - run: rustup show + run: | + rustup toolchain install --no-self-update + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + rustup show + # Registry plus both target directories: verify.ps1's clippy uses target/, the CMake build + # uses build/windows-x64/cargo (cmake/rust_static.cmake). Stale artifacts are pruned on save. + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 + with: + workspaces: | + . -> target + . -> build/windows-x64/cargo + cache-on-failure: true + - name: Cache LLVM and bindgen + id: tools + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: | + C:\llvm-22.1.8 + ~\.cargo\bin\bindgen.exe + key: tools-llvm-22.1.8-bindgen-0.72.1 + # build.rs generates the C bindings with bindgen, which loads libclang (docs/tooling.md). + - name: Install pinned LLVM for bindgen + if: steps.tools.outputs.cache-hit != 'true' + shell: pwsh + run: | + $installer = Join-Path $env:RUNNER_TEMP 'LLVM-22.1.8-win64.exe' + Invoke-WebRequest -Uri 'https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.8/LLVM-22.1.8-win64.exe' -OutFile $installer + Start-Process -FilePath $installer -ArgumentList '/S', "/D=$env:LLVM_DIR" -Wait + # The runner image ships a newer bindgen; the committed-bindings check needs this exact version. + - name: Install pinned bindgen + if: steps.tools.outputs.cache-hit != 'true' + shell: pwsh + run: | + cargo install bindgen-cli --version 0.72.1 --locked --force + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - name: Use LLVM and bindgen + shell: pwsh + run: | + # bindgen takes its builtin headers from the clang it finds; without CLANG_PATH that is + # the runner's older C:\Program Files\LLVM, whose headers libclang 22 rejects. + "LIBCLANG_PATH=$env:LLVM_DIR\bin", "CLANG_PATH=$env:LLVM_DIR\bin\clang.exe" | Out-File -FilePath $env:GITHUB_ENV -Append + bindgen --version - name: Verify native and Rust components shell: pwsh run: ./eng/verify.ps1 -Configuration Release diff --git a/.gitignore b/.gitignore index bee26ad49..0eac0fc43 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,13 @@ __pycache__/ *.pyc /.local/ /references/ -/vendor/ +# Vendor SDK sources are pinned submodules (eng/dependencies.json); everything else under vendor/ is local. +/vendor/* +!/vendor/streamline +!/vendor/fidelityfx +!/vendor/fidelityfx-vulkan +!/vendor/xess +!/vendor/minhook /integrations/unity/com.kpc.rescaleframe/Runtime~/ /integrations/unity/com.kpc.rescaleframe/Plugins/x86_64/*.dll /captures/ @@ -21,3 +27,4 @@ __pycache__/ /ghidra_projects/ /tools/rea/node_modules/ /.claude/skills/reverse-engineer-anything/ +tests/**/bin/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..19acca229 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,20 @@ +[submodule "streamline"] + path = vendor/streamline + url = https://github.com/NVIDIA-RTX/Streamline.git + shallow = true +[submodule "fidelityfx"] + path = vendor/fidelityfx + url = https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK.git + shallow = true +[submodule "fidelityfx-vulkan"] + path = vendor/fidelityfx-vulkan + url = https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK.git + shallow = true +[submodule "xess"] + path = vendor/xess + url = https://github.com/intel/xess.git + shallow = true +[submodule "vendor/minhook"] + path = vendor/minhook + url = https://github.com/TsudaKageyu/minhook.git + shallow = true diff --git a/AGENTS.md b/AGENTS.md index 1c7c94010..92db0a82d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,7 +10,7 @@ Use natural, concise language in documentation, code comments, issues, commits, The orchestrator and shared runtime are general infrastructure. They must not contain game or engine integration policy. This boundary is mandatory for every adapter, including existing ones. -- Keep executable detection, fingerprints, RVAs, expected patch bytes, native engine symbols and +- Keep executable detection, site signatures, expected patch bytes, native engine symbols and layouts, engine startup, window-class selection, game settings translation, input conventions, and game-specific quality or lifecycle policy in `games//` or the relevant engine integration under `integrations/`. Frame timing, pacing and latency are not integration policy: @@ -69,46 +69,62 @@ One implementation serves every game and every vendor. game. Latency or vendor policy found in an adapter or host is a Rule 1 violation: move it into the orchestrator and leave the integration with the calls that report its engine's events. +## Rule 4: discover, do not pin + +An integration finds what it hooks in the game that is actually running. It must not depend on one +executable build. + +- Locate functions, patch sites and globals by discovery: byte signatures with wildcards for + relocations and displacements, exported or managed names, strings, and operands decoded from the + code that references a global or a structure field. Resolve them at start-up. +- Verify at the found site. A signature must match exactly once, and the expected bytes are still + checked there before a hook or patch is written, so a wrong match refuses and names the site. +- A whole-file hash, build id or version string is evidence to log. It never gates detection, + start-up, packaging or deployment. No exact-build allow lists and no fixed address tables. +- Structure offsets that no code reference reveals may stay as documented constants, validated by a + structural check where one exists. +- When a site is not found, refuse that feature, say which site, and keep the game running. + +## Rule 5: one integration, every feature; inputs and output in the integration, the technique in the core + +A game integrated once gets everything ReScaleFrame can do. The integration prepares the inputs +and presents the output. Everything between the two is the core, shared by every game. + +- The integration owns the inputs: finding the engine's colour, depth, motion vectors, camera, + jitter, exposure, masks, UI and HUD-less frames; making the engine produce the ones it does not + produce by default; correcting them at the source (missing object or camera motion, a wrong depth + domain, a jittered or stale buffer, a shader pass the engine lacks); reporting when the engine's + events really happen (Rule 3); and tagging every optional vendor hint it can supply. It also owns + putting the result back: the engine's output target, presentation hand-off, UI composition and + the engine's own settings and resolution plumbing. +- The core owns every technique: each upscaler, frame generator, sharpening mode, latency and + pacing technology, their vendor SDKs, sequencing, history and resets, fallbacks, presentation + mechanisms, the overlay and every option in it. +- Where a fix goes follows from that. A defect in what reaches ReScaleFrame (an input is missing, + wrong, late, or reported at the wrong moment) is fixed in the integration, at the source. A + defect in how a technique works (marker order, frame-end and pacing rules, history resets, a + provider switch, a present fallback, device creation timing) is fundamental: fix it in the core + or the shared loader so every game inherits it. Ask whether another engine with the same property + would hit it; if so it is core. Do not compensate in the core for one game's bad input, and do + not patch around a core defect inside one adapter. +- Every integrated game offers the same feature set. What the overlay offers comes from the + Runtime, one source for every host, never from a list an adapter or a host keeps for itself. + "This host cannot do it" and "nobody wired it" are defects to fix, not reasons to hide or grey out + an option. The only value that may be shown disabled is one the hardware or the vendor makes + impossible on this machine, decided by a capability query at run time, and it says why. +- A feature added for one game is added to the shared path, and is not done until every integrated + game has it. ## Research and tool setup ### Reference completeness and shader coverage -Before designing a render integration from a working reference, inventory its full relevant -implementation, not selected hook or SDK snippets. Pin the revision and consumed dependencies; -account for every subsystem, feature and shader family, including shared code, settings, -lifecycle, failure recovery, compatibility restrictions and tests. Trace the complete frame -from native producers through reconstruction and final presentation. Maintain a comparison of -reference mechanisms against RSF: implemented, deliberately different with evidence, missing, -or unverified. A file list alone is not a semantic inventory. Reuse a recorded inventory while -its revision and assumptions remain valid; reopen it when new evidence contradicts them. - -For shipped games, inspect the matching executable and native shader bytecode as well as -reference source. Use REA when executable semantics require it, retaining actual tool evidence -and failed approaches. An unavailable decompiler does not turn reference names into native -proof. Shared engine ancestry, a nearby release, Address Library entries and matching strings -are leads, not permission to reuse layouts, ABI, shader conventions or hook ordering. - -Every SR/FG integration requires a full shader and buffer coverage audit. Account for graphics -and compute stages, permutations, actual resource bindings and formats, depth/motion writes, -previous object/instance/bone/deformation history, transparent and forward paths, particles, -water, volumes, UI and downstream consumers. Distinguish shader declarations from active draw -bindings and valid zero motion from missing writes. Determine and implement verified required -shader, buffer or producer repairs at their owner. Listing a missing input is not completing -that repair; fabricated vectors or substituted current history do not close the gap. - -Native, reduced-resolution and failure paths all need valid output. Once a reduced frame is -rendered, returning to native code is not proof that it will reconstruct the active rectangle. -Verify recovery and every later consumer. SDK success, a green build, a stationary image or a -single quality setting cannot establish visual or temporal correctness. Retain user-rejected -images as failed acceptance evidence and test all required qualities, motion and transitions. -Capture actual evaluation frames with matching source/view/resource identity; preparation-only -or partial captures cannot prove the failing frame. Keep unresolved required coverage and -repairs as completion blockers, without shrinking the user's goal or adopting a reference's -unsupported-mod policy as RSF's delivery policy. +The full procedure and its rules live in [the reference and shader audit](.agents/skills/game-render-analysis/references/reference-and-shader-audit.md). +Before any SR/FG integration or render change, follow it: a semantic inventory of the working reference, a complete shader and buffer coverage audit, +and valid output on native, reduced-resolution and failure paths. Unresolved required coverage is a completion blocker. Repository skills use the open [Agent Skills format](https://agentskills.io/specification) under `.agents/skills//SKILL.md`. Keep one shared skill source with standard YAML metadata. Clients with different discovery paths can load the linked file explicitly; do not fork its instructions per agent. -Every reverse-engineering result must explain the question, why the approach was chosen, how it was found, the evidence, and where and when the runtime uses it. Record relevant fingerprints, source revisions, units, frame/view identity, resource lifetime, failed approaches, and uncertainty. Keep `games//engine.json`, research notes, and the implementation tracker consistent. +Every reverse-engineering result must explain the question, why the approach was chosen, how it was found, the evidence, and where and when the runtime uses it. Record the builds the signatures were derived and verified on (their hashes as evidence only), source revisions, units, frame/view identity, resource lifetime, failed approaches, and uncertainty. Keep `games//engine.json`, research notes, and the implementation tracker consistent. Every commit and PR includes its research or links to the relevant notes. For changes without a new experiment, give the rationale and checks performed. Never invent research or describe a source review as a runtime test. When evidence corrects an earlier conclusion, retain a concise account of what changed and why. @@ -116,11 +132,11 @@ Check the environment before recommending installation. [docs/tooling.md](docs/t ## Project boundaries -- Keep all first-party code in this monorepo. Do not split the loader, orchestrator, SDK, UI, or game plugins into separate repositories or submodules. +- Keep all first-party code in this monorepo. Do not split the loader, orchestrator, SDK, UI, or game plugins into separate repositories or submodules. The rule is about first-party code: vendor SDK sources are pinned shallow submodules under `vendor/` (see Out-of-tree material). - The orchestrator owns plugin lifecycle, vendor SDKs, graphics interoperability, settings, and presentation. A game plugin owns its game detection, hooks, renderer preparation, input conventions, and output reinsertion. - Loading the orchestrator is distinct from activating a graphics pipeline. It selects/prepares the plugin first. - Keep public native interfaces as C ABI contracts. Do not pass STL containers, Rust types, ownership-ambiguous allocations, or exceptions across DLL boundaries. -- A recognized executable fingerprint is not proof of working hooks or rendering support. Report capability and validation status honestly. +- A recognized game is not proof of working hooks or rendering support. Report capability and validation status honestly. - Keep standalone use independent of WSGM. The initial complete AC7 goal includes SR, MFG, and latency integration. ## Delivery @@ -145,7 +161,7 @@ Check the environment before recommending installation. [docs/tooling.md](docs/t ## Build and verify -`eng/verify.ps1` is the final pre-release native/lint gate and matches CI. Run it at the end of a work session before releasing, not mid-work where its fixtures can disrupt the user’s computer work. It compares `VERSION` against the Cargo workspace +`eng/verify.ps1` is the final pre-release native/lint gate and matches CI. Run it at the end of a work session before releasing, not mid-work where its fixtures can disrupt the user�s computer work. It compares `VERSION` against the Cargo workspace version, configures, builds, and tests the native tree, then runs `cargo fmt --check` and `cargo clippy -D warnings`. Run `cargo test --workspace --locked` separately when Rust behaviour is affected; the script does not execute those tests. @@ -198,16 +214,14 @@ remain scaffolds. AC7 links runtime objects into its proxy, while Unity loads th | Target | Output name | Role | | --- | --- | --- | -| `rsf_bootstrap` | `ReScaleFrame.Bootstrap.dll` | version-only scaffold for the intended injected entry | | `rsf_orchestrator` | `ReScaleFrame.Runtime.dll` | vendor SDKs, plugin lifecycle, GPU resources, presentation | | `rsf_game_ac7` | `ReScaleFrame.Game.AC7.dll` | native AC7 detection, hooks and engine data | -| `rsf_game_project_wingman` | `ReScaleFrame.Game.ProjectWingman.dll` | exact-build detection scaffold, rendering refused | -| `rsf_game_rdr2` | `ReScaleFrame.Game.RDR2.dll` | exact-build detection scaffold, rendering refused | +| `rsf_game_project_wingman` | `ReScaleFrame.Game.ProjectWingman.dll` | detection scaffold (sites found by signature), rendering refused | +| `rsf_game_rdr2` | `ReScaleFrame.Game.RDR2.dll` | detection scaffold (sites found by signature), rendering refused | | `rsf_asi_rdr2` | `ReScaleFrame.RDR2.asi` in `rdr2/bin/` | RDR2 entry loaded by the game's ASI loader | | `rsf_game_unity_mono` | `ReScaleFrame.Game.UnityMono.dll` | shared Mono/Harmony URP DX12 adapter | | `rsf_proxy_ac7` | `dinput8.dll` in `ac7/bin/` | dedicated AC7 carrier | | `rsf_proxy_dinput8` | `ReScaleFrame.Loader.dll`, `carriers/version.dll` aliases | shared Windows shim; Unity drop-in carrier | -| `rsf_launcher` | `ReScaleFrame.exe` | help/version scaffold; launching and profiles pending | | `rsf_game_sdk` | `ReScaleFrame::GameSDK` (INTERFACE) | the C header both sides compile against | Working consequences of the ownership split above: @@ -238,12 +252,14 @@ has cost a run of the game to find that out. The jitter gate, the velocity blend separate-translucency halving were all settled this way after other approaches were not. The rule that makes it safe is the expected bytes. Every patch names what it expects to find and -writes only where it finds it, so a game update moves the code and the patch refuses instead of -corrupting an instruction. It is announced either way, because a patch that silently did nothing is +writes only where it finds it. The site itself is found by signature (Rule 4), so a game update that +moves the code is followed, and one that changes it makes the patch refuse instead of corrupting an +instruction. It is announced either way, because a patch that silently did nothing is indistinguishable from one that worked until something downstream fails. Patch after decryption, next to the others in `apply_*_patch`, and record the site in -`docs/research/ue418-hook-map.md` with its RVA, its bytes and the source it corresponds to. Name the +`docs/research/ue418-hook-map.md` with its signature, its bytes, the RVA in the researched build as +evidence, and the source it corresponds to. Name the function in the Ghidra project while the evidence is in front of you. ## Native ABI @@ -257,14 +273,14 @@ ReScaleFrame is MIT. Never copy GPL or other copyleft code into it, including po or algorithms; write first-party code from permissive sources or from behaviour. The existing exceptions keep their upstream terms and are listed in `docs/dependencies.md`. -Mechanics that the header and `tests/plugin_contract.cpp` jointly enforce: +Mechanics that the header and `tests/game-sdk/src/contract.rs` jointly enforce: - Size-checked call structures lead with `struct_size`; embedded metadata is part of its enclosing ABI. Entry points reject a short call structure with `RSF_ERROR_INVALID_ARGUMENT` and a mismatched `abi_version` with `RSF_ERROR_ABI_MISMATCH`. - Extend structs by appending fields and bumping `RSF_GAME_ABI_VERSION`, never by reordering. - Plugin-returned strings are immutable, plugin-owned, and valid until the DLL unloads. Probe strings are borrowed for the duration of the call. -- Current game ABI is 24. `game_renderer.h` defines leased rendering passes, CPU events and host +- Current game ABI is 26. `game_renderer.h` defines leased rendering passes, CPU events and host services; `game_frame.h` defines frame/camera ABI 1. The older ABI 2 sketches in the representation plan are historical design, not the current contract. Native resource pointers cross under explicit callback leases; frame identity alone does not establish final Present ownership. @@ -287,10 +303,19 @@ lower latency. Do not soften README or status wording ahead of the code. ## Out-of-tree material -Game binaries, Epic engine source, vendor SDKs, reference checkouts, captures, and Ghidra projects -stay untracked. `.local/`, `references/`, `vendor/`, `captures/`, and `dumps/` are gitignored. Only -the executable name and hash appear in published research. See `docs/dependencies.md` before adding -any third-party code or binary. +Game binaries, Epic engine source, vendor runtime binaries, reference checkouts, captures, and Ghidra +projects stay untracked. `.local/`, `references/`, `captures/`, `dumps/` and everything under `vendor/` +except the SDK submodules are gitignored. Only the executable name and hash appear in published research. +See `docs/dependencies.md` before adding any third-party code or binary. + +The vendor SDK sources the build compiles against are shallow submodules pinned in `eng/dependencies.json`: +`vendor/streamline`, `vendor/fidelityfx` (SDK 2.4.0), `vendor/fidelityfx-vulkan` (SDK 1.1.4, the Vulkan FSR +source build), `vendor/xess` and `vendor/minhook` (MinHook v1.3.4, which Cargo and CMake build from there +without a network fetch). After cloning, run `git submodule update --init --depth 1` and +`./eng/fetch-vendor.ps1`; the second fetches the signed Streamline runtime from the pinned release zip into +`vendor/streamline-sdk` and the package layout into `vendor/runtimes`, verifying every hash. Change a vendor +pin in `eng/dependencies.json` and the submodule commit together; `eng/fetch-vendor.ps1` refuses a mismatch. +Never edit inside a submodule: patches to vendor source are applied to copies by the scripts that need them. The procedure this project uses to analyse a game is written down in [docs/research/methodology.md](docs/research/methodology.md), with the operational version as a diff --git a/CMakeLists.txt b/CMakeLists.txt index eb9a15521..0aa16d014 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,14 +8,15 @@ if(NOT WIN32 OR NOT CMAKE_SIZEOF_VOID_P EQUAL 8) endif() if(NOT MSVC) - # mingw would otherwise emit libReScaleFrame.Bootstrap.dll. Windows DLL names are exact, and + # mingw would otherwise emit libdinput8.dll. Windows DLL names are exact, and # a forwarder has to match the name the game imports, so the cross build keeps MSVC's naming. set(CMAKE_SHARED_LIBRARY_PREFIX "") set(CMAKE_SHARED_MODULE_PREFIX "") endif() -# A cache entry left by godot-cpp (see integrations/godot/CMakeLists.txt) would force the Release CRT -# onto every target in Debug; clear it so the default per-configuration CRT applies. +# A cache entry left by an earlier godot-cpp configure (the Godot extension no longer uses it) would +# force the Release CRT onto every target in Debug; clear it so the default per-configuration CRT +# applies. unset(CMAKE_MSVC_RUNTIME_LIBRARY CACHE) set(CMAKE_CXX_STANDARD 20) @@ -47,16 +48,26 @@ endif() # IDXGISwapChain::Present both in the table and at the function's entry and re-asserts either when # displaced, so a table patch and the overlay chase each other; a detour with a trampoline built # from the genuine bytes sits in the same chain without ever routing through the entry again. -# BSD-2-Clause, pinned to v1.3.4. +# BSD-2-Clause, pinned by third_party/minhook/minhook.lock.json. The source is the vendor/minhook +# submodule at that revision, which the Cargo build of rsf-minhook-sys compiles as well; without it +# FetchContent clones the same revision. +file(READ "${PROJECT_SOURCE_DIR}/third_party/minhook/minhook.lock.json" rsf_minhook_lock) +string(JSON rsf_minhook_rev GET "${rsf_minhook_lock}" revision) +if(EXISTS "${PROJECT_SOURCE_DIR}/vendor/minhook/src/hook.c" AND NOT FETCHCONTENT_SOURCE_DIR_MINHOOK) + set(FETCHCONTENT_SOURCE_DIR_MINHOOK "${PROJECT_SOURCE_DIR}/vendor/minhook") +endif() include(FetchContent) FetchContent_Declare(minhook GIT_REPOSITORY https://github.com/TsudaKageyu/minhook.git - GIT_TAG c3fcafdc10146beb5919319d0683e44e3c30d537 # v1.3.4 + GIT_TAG ${rsf_minhook_rev} GIT_SHALLOW FALSE) FetchContent_MakeAvailable(minhook) include(CTest) +include(cmake/rust_static.cmake) +include(cmake/vendor.cmake) add_subdirectory(sdk/game) +add_subdirectory(runtime/common) add_subdirectory(loader) add_subdirectory(runtime/contract) add_subdirectory(runtime/graphics) @@ -87,7 +98,8 @@ add_subdirectory(games/unity-mono) add_subdirectory(integrations/unity) add_subdirectory(integrations/godot) add_subdirectory(games/minecraft) -add_subdirectory(apps/launcher) if(BUILD_TESTING) add_subdirectory(tests) endif() +# Last, once every target exists: each binary drops the Rust archives another archive it links carries. +rsf_resolve_embedded_archives() diff --git a/Cargo.lock b/Cargo.lock index 7d8d484bd..3da884e91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +# This file is automatically @generated by Cargo.# It is not intended for manual editing.version = 4[[package]]name = "accesskit"version = "0.24.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d3b7f7f85a7e5f68090000ed7622545829afd484d210358702ae4cb97dd0c320"dependencies = [ "uuid",][[package]]name = "ahash"version = "0.8.12"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"dependencies = [ "cfg-if", "once_cell", "version_check", "zerocopy",][[package]]name = "aho-corasick"version = "1.1.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"dependencies = [ "memchr",][[package]]name = "arrayvec"version = "0.7.8"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56"[[package]]name = "ash"version = "0.38.0+1.3.281"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f"[[package]]name = "autocfg"version = "1.5.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"[[package]]name = "bindgen"version = "0.72.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"dependencies = [ "bitflags", "cexpr", "clang-sys", "itertools 0.13.0", "log", "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex 1.3.0", "syn 2.0.119",][[package]]name = "bitflags"version = "2.13.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"[[package]]name = "bytemuck"version = "1.25.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"dependencies = [ "bytemuck_derive",][[package]]name = "bytemuck_derive"version = "1.12.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "fc0e56a716f1e132ff6bf4bdac1c944a3fcdc1cae65f70a4a2a1ac3b401d2d1f"dependencies = [ "proc-macro2", "quote", "syn 3.0.5",][[package]]name = "cc"version = "1.11.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "33ef9e3e8154a45c7a95cff4c1299702106ad94062d7bb85fdc5d3a5afd91d45"dependencies = [ "find-msvc-tools", "shlex 2.0.1",][[package]]name = "cexpr"version = "0.6.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"dependencies = [ "nom",][[package]]name = "cfg-if"version = "1.0.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"[[package]]name = "clang-sys"version = "1.9.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a"dependencies = [ "glob", "libc", "libloading",][[package]]name = "color"version = "0.3.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2ec7c5eb7a16992b1904d76c517d170ab353b0e0b3d5a0c81a8a0cd1037893cf"dependencies = [ "bytemuck",][[package]]name = "ecolor"version = "0.35.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6758be723a3f298bbfda4db75748bc2ba0abafe096b6383c7c32da264764fbc3"dependencies = [ "emath",][[package]]name = "egui"version = "0.35.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2796c98d50b79631281d516343a6f6e93c0666462ca36e2c93b39f25d7793325"dependencies = [ "accesskit", "ahash", "bitflags", "emath", "epaint", "itertools 0.14.0", "log", "nohash-hasher", "profiling", "smallvec", "unicode-segmentation",][[package]]name = "either"version = "1.18.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"[[package]]name = "emath"version = "0.35.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "cd4ec073c9898516584d8c6cfdcee95b530b3d941cd5031ef4050aa36812308b"[[package]]name = "epaint"version = "0.35.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "4e60a8888b51da911df23918fd7301359b1d43a406a0ff3b8863af093dd7fc6c"dependencies = [ "ahash", "ecolor", "emath", "epaint_default_fonts", "font-types", "harfrust", "log", "nohash-hasher", "parking_lot", "profiling", "self_cell", "skrifa", "smallvec", "unicode-general-category", "unicode-segmentation", "vello_cpu",][[package]]name = "epaint_default_fonts"version = "0.35.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "13ee4e1f553a3584c301f3a56ff1a775f1384781396cea301c8d952e9b93f560"[[package]]name = "euclid"version = "0.22.14"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06"dependencies = [ "num-traits",][[package]]name = "fearless_simd"version = "0.4.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b97b65636e5b9ef369943878ac74335ba1c55c1cb6adbf1e2c293c624248d693"[[package]]name = "find-msvc-tools"version = "0.1.15"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48"[[package]]name = "foldhash"version = "0.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"[[package]]name = "font-types"version = "0.11.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "5b38ad915f6dadd993ced50848a8291a543bd41ca62bc10740d5e64e2ab4cfd7"dependencies = [ "bytemuck",][[package]]name = "glifo"version = "0.1.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d99fc21d493812643aae86d53b7bbd02f376434a90317e8a790bc209fdd6605e"dependencies = [ "bytemuck", "foldhash", "hashbrown", "log", "peniko", "skrifa", "smallvec", "vello_common",][[package]]name = "glob"version = "0.3.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"[[package]]name = "guillotiere"version = "0.7.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6b17e70c989c36bad147b27a58d148c0741c51448aa5653436547323e524d0ab"dependencies = [ "euclid",][[package]]name = "harfrust"version = "0.7.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0431e8e389aa0f1e72bb9d1c2db8957a1a7a3580e8ed97db819c14837aac9b3e"dependencies = [ "bitflags", "bytemuck", "read-fonts", "smallvec",][[package]]name = "hashbrown"version = "0.17.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"dependencies = [ "foldhash",][[package]]name = "itertools"version = "0.13.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"dependencies = [ "either",][[package]]name = "itertools"version = "0.14.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285"dependencies = [ "either",][[package]]name = "itoa"version = "1.0.18"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"[[package]]name = "jni-sys"version = "0.3.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"[[package]]name = "kurbo"version = "0.13.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "4b60dfc32f652b926df6192e55525b16d186c69d47876c3ead4da5cc9f8450e2"dependencies = [ "arrayvec", "euclid", "polycool", "smallvec",][[package]]name = "libc"version = "0.2.189"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"[[package]]name = "libloading"version = "0.8.9"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"dependencies = [ "cfg-if", "windows-link",][[package]]name = "linebender_resource_handle"version = "0.1.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"[[package]]name = "lock_api"version = "0.4.14"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"dependencies = [ "scopeguard",][[package]]name = "log"version = "0.4.34"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"[[package]]name = "memchr"version = "2.8.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"[[package]]name = "minimal-lexical"version = "0.2.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"[[package]]name = "nohash-hasher"version = "0.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"[[package]]name = "nom"version = "7.1.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"dependencies = [ "memchr", "minimal-lexical",][[package]]name = "num-traits"version = "0.2.19"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"dependencies = [ "autocfg",][[package]]name = "once_cell"version = "1.21.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"[[package]]name = "parking_lot"version = "0.12.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"dependencies = [ "lock_api", "parking_lot_core",][[package]]name = "parking_lot_core"version = "0.9.12"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", "windows-link",][[package]]name = "peniko"version = "0.6.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "839c8299360d2e998bdb106dc0a6cd71dcc5f4df51df1b620361bf50e283cca6"dependencies = [ "bytemuck", "color", "kurbo", "linebender_resource_handle", "smallvec",][[package]]name = "polycool"version = "0.4.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "50596ddc09eb5ad5f75cacd40209568e66df71baf86e1499a0e99c4cff12a5a6"dependencies = [ "arrayvec",][[package]]name = "prettyplease"version = "0.2.37"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"dependencies = [ "proc-macro2", "syn 2.0.119",][[package]]name = "proc-macro2"version = "1.0.107"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"dependencies = [ "unicode-ident",][[package]]name = "profiling"version = "1.0.18"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5"[[package]]name = "quote"version = "1.0.47"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"dependencies = [ "proc-macro2",][[package]]name = "read-fonts"version = "0.39.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "c4ed38b89c2c77ff968c524145ad65fb010f38af5c7a224b53b81d47ac2daa81"dependencies = [ "bytemuck", "font-types",][[package]]name = "redox_syscall"version = "0.5.18"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"dependencies = [ "bitflags",][[package]]name = "regex"version = "1.13.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9807af0e638c12e753aa1b4e601791bf2a8f71274023c8bbeec12fc149950857"dependencies = [ "aho-corasick", "memchr", "regex-automata", "regex-syntax",][[package]]name = "regex-automata"version = "0.4.19"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "41d60ef07df457506a0a1a2073112eb4aae5733dbd2813c3da77d1b0fd441158"dependencies = [ "aho-corasick", "memchr", "regex-syntax",][[package]]name = "regex-syntax"version = "0.8.12"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6"[[package]]name = "rescaleframe-overlay"version = "0.1.2"dependencies = [ "egui", "rsf-game-sys",][[package]]name = "rsf-ac7"version = "0.1.2"dependencies = [ "cc", "rsf-bindgen", "rsf-game-sys", "rsf-graphics", "rsf-minhook-sys", "rsf-shader-compiler", "windows",][[package]]name = "rsf-ac7-capture-fixture"version = "0.1.2"dependencies = [ "rsf-ac7", "rsf-orchestrator", "rsf-runtime-common", "rsf-shader-compiler", "rsf-test-support", "windows",][[package]]name = "rsf-anomaly"version = "0.1.2"dependencies = [ "rsf-bindgen", "rsf-game-sys", "rsf-shader-compiler", "windows", "windows-sys",][[package]]name = "rsf-bindgen"version = "0.1.2"dependencies = [ "bindgen", "regex",][[package]]name = "rsf-capture-fixtures"version = "0.1.2"dependencies = [ "ash", "rsf-bindgen", "rsf-game-sys", "windows", "windows-sys",][[package]]name = "rsf-exposure-probe"version = "0.1.2"dependencies = [ "rsf-bindgen", "rsf-game-sys", "windows",][[package]]name = "rsf-fallout4"version = "0.1.2"dependencies = [ "cc", "rsf-bindgen", "rsf-game-sys", "rsf-minhook-sys", "rsf-runtime-common", "rsf-steam", "windows", "windows-sys",][[package]]name = "rsf-fsr4-compat"version = "0.1.2"dependencies = [ "ash", "rsf-bindgen", "rsf-game-sys", "rsf-minhook-sys", "rsf-runtime-common", "windows",][[package]]name = "rsf-game-sdk-fixtures"version = "0.1.2"dependencies = [ "ash", "rsf-anomaly", "rsf-bindgen", "rsf-game-sys", "rsf-orchestrator", "rsf-unity-mono", "windows", "windows-sys",][[package]]name = "rsf-game-sys"version = "0.1.2"dependencies = [ "rsf-bindgen", "windows-sys",][[package]]name = "rsf-generation-fixtures"version = "0.1.2"dependencies = [ "rsf-bindgen", "rsf-game-sys", "rsf-test-support", "windows", "windows-sys",][[package]]name = "rsf-godot"version = "0.1.2"dependencies = [ "rsf-bindgen", "rsf-game-sys", "windows", "windows-sys",][[package]]name = "rsf-graphics"version = "0.1.2"dependencies = [ "cc", "rsf-bindgen", "rsf-game-sys", "windows", "windows-sys",][[package]]name = "rsf-loader"version = "0.1.2"dependencies = [ "rsf-bindgen", "rsf-game-sys", "rsf-windows", "windows", "windows-sys",][[package]]name = "rsf-loader-fixtures"version = "0.1.2"dependencies = [ "rsf-bindgen", "rsf-game-sys", "serde_json", "windows", "windows-sys",][[package]]name = "rsf-minecraft"version = "0.1.2"dependencies = [ "jni-sys", "rsf-game-sys", "windows-sys",][[package]]name = "rsf-minhook-sys"version = "0.1.2"dependencies = [ "cc",][[package]]name = "rsf-orchestrator"version = "0.1.2"dependencies = [ "ash", "cc", "rsf-bindgen", "rsf-fsr4-compat", "rsf-game-sys", "rsf-graphics", "rsf-minhook-sys", "rsf-runtime-common", "rsf-runtime-submission", "rsf-shader-compiler", "rsf-streamline-vk", "rsf-vk-xess-fg", "windows", "windows-sys",][[package]]name = "rsf-overlay-fixtures"version = "0.1.2"dependencies = [ "rsf-bindgen", "rsf-game-sys", "windows",][[package]]name = "rsf-overlay-service-fixtures"version = "0.1.2"dependencies = [ "rsf-game-sys", "rsf-test-support", "windows",][[package]]name = "rsf-presentation-api-fixtures"version = "0.1.2"dependencies = [ "rsf-game-sys", "windows-sys",][[package]]name = "rsf-presentation-fixtures"version = "0.1.2"dependencies = [ "rsf-ac7", "rsf-bindgen", "rsf-game-sys", "rsf-orchestrator", "rsf-test-support", "windows",][[package]]name = "rsf-project-wingman"version = "0.1.2"dependencies = [ "cc", "rsf-game-sys", "rsf-windows", "windows-sys",][[package]]name = "rsf-rdr2"version = "0.1.2"dependencies = [ "rsf-bindgen", "rsf-game-sys", "rsf-minhook-sys", "rsf-windows", "windows", "windows-sys",][[package]]name = "rsf-runtime-common"version = "0.1.2"dependencies = [ "windows-sys",][[package]]name = "rsf-runtime-submission"version = "0.1.2"[[package]]name = "rsf-shader-compiler"version = "0.1.2"dependencies = [ "windows", "windows-sys",][[package]]name = "rsf-skyrim-se"version = "0.1.2"dependencies = [ "cc", "rsf-bindgen", "rsf-game-sys", "rsf-steam", "rsf-windows", "windows", "windows-sys",][[package]]name = "rsf-steam"version = "0.1.2"dependencies = [ "cc", "rsf-game-sys", "rsf-windows", "windows-sys",][[package]]name = "rsf-streamline-vk"version = "0.1.2"dependencies = [ "ash", "cc", "rsf-bindgen", "windows-sys",][[package]]name = "rsf-test-support"version = "0.1.2"dependencies = [ "windows",][[package]]name = "rsf-translucency-fixtures"version = "0.1.2"dependencies = [ "rsf-game-sys", "windows",][[package]]name = "rsf-unity-mono"version = "0.1.2"dependencies = [ "ash", "rsf-bindgen", "rsf-game-sys", "rsf-orchestrator", "rsf-runtime-common", "rsf-runtime-submission", "rsf-windows", "windows", "windows-sys",][[package]]name = "rsf-vk-fsr3"version = "0.1.2"dependencies = [ "rsf-game-sys",][[package]]name = "rsf-vk-xess-fg"version = "0.1.2"dependencies = [ "rsf-game-sys", "windows-sys",][[package]]name = "rsf-vulkan-fg-fixtures"version = "0.1.2"dependencies = [ "ash", "rsf-bindgen", "rsf-game-sys", "rsf-orchestrator", "windows-sys",][[package]]name = "rsf-vulkanstory-ngx"version = "0.1.2"dependencies = [ "libc", "windows-sys",][[package]]name = "rsf-windows"version = "0.1.2"dependencies = [ "rsf-game-sys", "rsf-minhook-sys", "windows-sys",][[package]]name = "rustc-hash"version = "2.1.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"[[package]]name = "scopeguard"version = "1.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"[[package]]name = "self_cell"version = "1.3.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2ab42ca02749e120097e328d91d415325bdf43b1c72c4c8badf37375fe40a813"[[package]]name = "serde"version = "1.0.229"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"dependencies = [ "serde_core",][[package]]name = "serde_core"version = "1.0.229"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"dependencies = [ "serde_derive",][[package]]name = "serde_derive"version = "1.0.229"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"dependencies = [ "proc-macro2", "quote", "syn 3.0.5",][[package]]name = "serde_json"version = "1.0.154"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"dependencies = [ "itoa", "memchr", "serde", "serde_core", "zmij",][[package]]name = "shlex"version = "1.3.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"[[package]]name = "shlex"version = "2.0.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"[[package]]name = "skrifa"version = "0.42.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0c34617370ae968efb7161bb2beb517d9084659aae19e24b89e3db25b46e4564"dependencies = [ "bytemuck", "read-fonts",][[package]]name = "smallvec"version = "1.16.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f"[[package]]name = "syn"version = "2.0.119"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"dependencies = [ "proc-macro2", "quote", "unicode-ident",][[package]]name = "syn"version = "3.0.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9"dependencies = [ "proc-macro2", "quote", "unicode-ident",][[package]]name = "thiserror"version = "2.0.20"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f"dependencies = [ "thiserror-impl",][[package]]name = "thiserror-impl"version = "2.0.20"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"dependencies = [ "proc-macro2", "quote", "syn 3.0.5",][[package]]name = "unicode-general-category"version = "1.1.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0b993bddc193ae5bd0d623b49ec06ac3e9312875fdae725a975c51db1cc1677f"[[package]]name = "unicode-ident"version = "1.0.24"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"[[package]]name = "unicode-segmentation"version = "1.13.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"[[package]]name = "uuid"version = "1.26.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b5772d71c9be8a8a6ac2117d949c5b224c1b72241bb611d9a3012edcf8af7812"[[package]]name = "vello_common"version = "0.0.9"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "19d672facaa2d697285a786cd9d44d614cd2ce54cdc022504bf339f8fff3b750"dependencies = [ "bytemuck", "fearless_simd", "guillotiere", "hashbrown", "log", "peniko", "smallvec", "thiserror",][[package]]name = "vello_cpu"version = "0.0.9"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "588691169aed86b5c8fb487266afee01323234e6fd0a3f2aaec0eaa8e4007f23"dependencies = [ "bytemuck", "glifo", "hashbrown", "vello_common",][[package]]name = "version_check"version = "0.9.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"[[package]]name = "windows"version = "0.62.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"dependencies = [ "windows-collections", "windows-core", "windows-future", "windows-numerics",][[package]]name = "windows-collections"version = "0.3.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"dependencies = [ "windows-core",][[package]]name = "windows-core"version = "0.62.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"dependencies = [ "windows-implement", "windows-interface", "windows-link", "windows-result", "windows-strings",][[package]]name = "windows-future"version = "0.3.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"dependencies = [ "windows-core", "windows-link", "windows-threading",][[package]]name = "windows-implement"version = "0.60.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"dependencies = [ "proc-macro2", "quote", "syn 2.0.119",][[package]]name = "windows-interface"version = "0.59.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"dependencies = [ "proc-macro2", "quote", "syn 2.0.119",][[package]]name = "windows-link"version = "0.2.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"[[package]]name = "windows-numerics"version = "0.3.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"dependencies = [ "windows-core", "windows-link",][[package]]name = "windows-result"version = "0.4.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"dependencies = [ "windows-link",][[package]]name = "windows-strings"version = "0.5.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"dependencies = [ "windows-link",][[package]]name = "windows-sys"version = "0.61.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"dependencies = [ "windows-link",][[package]]name = "windows-threading"version = "0.2.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37"dependencies = [ "windows-link",][[package]]name = "zerocopy"version = "0.8.56"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb"dependencies = [ "zerocopy-derive",][[package]]name = "zerocopy-derive"version = "0.8.56"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1"dependencies = [ "proc-macro2", "quote", "syn 2.0.119",][[package]]name = "zmij"version = "1.0.23"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" version = 4 [[package]] @@ -23,23 +24,58 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + [[package]] name = "arrayvec" version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" +[[package]] +name = "ash" +version = "0.38.0+1.3.281" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" + [[package]] name = "autocfg" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" +[[package]] +name = "bindgen" +version = "0.72.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex 1.3.0", + "syn 2.0.119", +] + [[package]] name = "bitflags" -version = "2.13.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" [[package]] name = "bytemuck" @@ -58,14 +94,44 @@ checksum = "fc0e56a716f1e132ff6bf4bdac1c944a3fcdc1cae65f70a4a2a1ac3b401d2d1f" dependencies = [ "proc-macro2", "quote", - "syn 3.0.5", + "syn 3.0.9", +] + +[[package]] +name = "cc" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ef9e3e8154a45c7a95cff4c1299702106ad94062d7bb85fdc5d3a5afd91d45" +dependencies = [ + "find-msvc-tools", + "shlex 2.0.1", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", ] [[package]] name = "cfg-if" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + +[[package]] +name = "clang-sys" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" +dependencies = [ + "glob", + "libc", + "libloading", +] [[package]] name = "color" @@ -96,7 +162,7 @@ dependencies = [ "bitflags", "emath", "epaint", - "itertools", + "itertools 0.14.0", "log", "nohash-hasher", "profiling", @@ -106,9 +172,9 @@ dependencies = [ [[package]] name = "either" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" +checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" [[package]] name = "emath" @@ -161,6 +227,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97b65636e5b9ef369943878ac74335ba1c55c1cb6adbf1e2c293c624248d693" +[[package]] +name = "find-msvc-tools" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" + [[package]] name = "foldhash" version = "0.2.0" @@ -192,6 +264,12 @@ dependencies = [ "vello_common", ] +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + [[package]] name = "guillotiere" version = "0.7.0" @@ -222,6 +300,15 @@ dependencies = [ "foldhash", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.14.0" @@ -231,6 +318,18 @@ dependencies = [ "either", ] +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "kurbo" version = "0.13.1" @@ -245,9 +344,19 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.189" +version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] [[package]] name = "linebender_resource_handle" @@ -266,9 +375,21 @@ dependencies = [ [[package]] name = "log" -version = "0.4.34" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" + +[[package]] +name = "memchr" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "nohash-hasher" @@ -276,6 +397,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -336,6 +467,16 @@ dependencies = [ "arrayvec", ] +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.119", +] + [[package]] name = "proc-macro2" version = "1.0.107" @@ -379,16 +520,523 @@ dependencies = [ "bitflags", ] +[[package]] +name = "regex" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9807af0e638c12e753aa1b4e601791bf2a8f71274023c8bbeec12fc149950857" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d60ef07df457506a0a1a2073112eb4aae5733dbd2813c3da77d1b0fd441158" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6" + [[package]] name = "rescaleframe-overlay" version = "0.1.2" dependencies = [ "egui", + "rsf-game-sys", +] + +[[package]] +name = "rsf-ac7" +version = "0.1.2" +dependencies = [ + "cc", + "rsf-bindgen", + "rsf-game-sys", + "rsf-graphics", + "rsf-loader", + "rsf-minhook-sys", + "rsf-orchestrator", + "rsf-shader-compiler", + "rsf-test-support", + "rsf-windows", + "windows", +] + +[[package]] +name = "rsf-ac7-capture-fixture" +version = "0.1.2" +dependencies = [ + "rsf-ac7", + "rsf-orchestrator", + "rsf-runtime-common", + "rsf-test-support", + "windows", +] + +[[package]] +name = "rsf-ac7-plugin" +version = "0.1.2" +dependencies = [ + "rsf-ac7", + "rsf-game-sys", + "rsf-graphics", + "rsf-minhook-sys", + "rsf-shader-compiler", + "rsf-test-support", + "rsf-windows", + "windows", +] + +[[package]] +name = "rsf-ac7-render-scope-fixture" +version = "0.1.2" + +[[package]] +name = "rsf-anomaly" +version = "0.1.2" +dependencies = [ + "rsf-bindgen", + "rsf-game-sys", + "rsf-graphics", + "rsf-minhook-sys", + "rsf-shader-compiler", + "rsf-test-support", + "rsf-windows", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-bindgen" +version = "0.1.2" +dependencies = [ + "bindgen", + "regex", +] + +[[package]] +name = "rsf-capture-fixtures" +version = "0.1.2" +dependencies = [ + "ash", + "rsf-bindgen", + "rsf-game-sys", + "rsf-graphics", + "rsf-orchestrator", + "rsf-test-support", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-exposure-probe" +version = "0.1.2" +dependencies = [ + "rsf-bindgen", + "rsf-game-sys", + "rsf-minhook-sys", + "rsf-orchestrator", + "rsf-test-support", + "windows", +] + +[[package]] +name = "rsf-fallout4" +version = "0.1.2" +dependencies = [ + "cc", + "rsf-bindgen", + "rsf-game-sys", + "rsf-minhook-sys", + "rsf-runtime-common", + "rsf-steam", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-fsr4-compat" +version = "0.1.2" +dependencies = [ + "ash", + "rsf-bindgen", + "rsf-game-sys", + "rsf-minhook-sys", + "rsf-runtime-common", + "rsf-streamline-vk", + "windows", +] + +[[package]] +name = "rsf-game-sdk-fixtures" +version = "0.1.2" +dependencies = [ + "ash", + "rsf-anomaly", + "rsf-bindgen", + "rsf-game-sys", + "rsf-graphics", + "rsf-orchestrator", + "rsf-rdr2", + "rsf-test-support", + "rsf-unity", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-game-sys" +version = "0.1.2" +dependencies = [ + "cc", + "rsf-bindgen", + "windows-sys", +] + +[[package]] +name = "rsf-generation-fixtures" +version = "0.1.2" +dependencies = [ + "rsf-bindgen", + "rsf-game-sys", + "rsf-test-support", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-godot" +version = "0.1.2" +dependencies = [ + "rsf-bindgen", + "rsf-game-sys", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-graphics" +version = "0.1.2" +dependencies = [ + "cc", + "rsf-bindgen", + "rsf-game-sys", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-loader" +version = "0.1.2" +dependencies = [ + "rsf-bindgen", + "rsf-game-sys", + "rsf-windows", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-loader-fixtures" +version = "0.1.2" +dependencies = [ + "rsf-bindgen", + "rsf-game-sys", + "rsf-loader", + "rsf-test-support", + "serde_json", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-minecraft" +version = "0.1.2" +dependencies = [ + "jni-sys", + "rsf-game-sys", + "rsf-orchestrator", + "windows-sys", +] + +[[package]] +name = "rsf-minhook-sys" +version = "0.1.2" +dependencies = [ + "cc", +] + +[[package]] +name = "rsf-orchestrator" +version = "0.1.2" +dependencies = [ + "ash", + "cc", + "rsf-bindgen", + "rsf-fsr4-compat", + "rsf-game-sys", + "rsf-graphics", + "rsf-minhook-sys", + "rsf-runtime-common", + "rsf-runtime-submission", + "rsf-shader-compiler", + "rsf-streamline-vk", + "rsf-test-support", + "rsf-vk-fsr3", + "rsf-vk-xess-fg", + "serde", + "serde_json", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-overlay-fixtures" +version = "0.1.2" +dependencies = [ + "rsf-bindgen", + "rsf-game-sys", + "rsf-minhook-sys", + "rsf-orchestrator", + "rsf-test-support", + "windows", +] + +[[package]] +name = "rsf-overlay-panel-fixture" +version = "0.1.2" +dependencies = [ + "rsf-game-sys", +] + +[[package]] +name = "rsf-overlay-service-fixtures" +version = "0.1.2" +dependencies = [ + "rsf-game-sys", + "rsf-test-support", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-presentation-api-fixtures" +version = "0.1.2" +dependencies = [ + "rsf-game-sys", + "windows-sys", +] + +[[package]] +name = "rsf-presentation-fixtures" +version = "0.1.2" +dependencies = [ + "rsf-ac7", + "rsf-ac7-plugin", + "rsf-bindgen", + "rsf-game-sys", + "rsf-minecraft", + "rsf-orchestrator", + "rsf-test-support", + "windows", +] + +[[package]] +name = "rsf-process-fixtures" +version = "0.1.2" +dependencies = [ + "rsf-game-sys", + "rsf-test-support", + "windows", +] + +[[package]] +name = "rsf-project-wingman" +version = "0.1.2" +dependencies = [ + "cc", + "rsf-game-sys", + "rsf-windows", + "windows-sys", +] + +[[package]] +name = "rsf-rdr2" +version = "0.1.2" +dependencies = [ + "rsf-bindgen", + "rsf-game-sys", + "rsf-loader", + "rsf-minhook-sys", + "rsf-test-support", + "rsf-windows", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-runtime-common" +version = "0.1.2" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "rsf-runtime-submission" +version = "0.1.2" + +[[package]] +name = "rsf-shader-compiler" +version = "0.1.2" +dependencies = [ + "rsf-game-sys", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-skyrim-se" +version = "0.1.2" +dependencies = [ + "cc", + "rsf-bindgen", + "rsf-game-sys", + "rsf-steam", + "rsf-windows", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-steam" +version = "0.1.2" +dependencies = [ + "cc", + "rsf-game-sys", + "rsf-windows", + "windows-sys", ] [[package]] -name = "rsf-upscaler" +name = "rsf-streamline-vk" version = "0.1.2" +dependencies = [ + "ash", + "cc", + "rsf-bindgen", + "rsf-game-sys", + "windows-sys", +] + +[[package]] +name = "rsf-test-support" +version = "0.1.2" +dependencies = [ + "ash", + "rsf-game-sys", + "windows", +] + +[[package]] +name = "rsf-translucency-fixtures" +version = "0.1.2" +dependencies = [ + "rsf-game-sys", + "rsf-test-support", + "windows", +] + +[[package]] +name = "rsf-unity" +version = "0.1.2" +dependencies = [ + "ash", + "rsf-bindgen", + "rsf-game-sys", + "rsf-orchestrator", + "rsf-runtime-common", + "rsf-runtime-submission", + "rsf-windows", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-unity-mono" +version = "0.1.2" +dependencies = [ + "rsf-game-sys", + "rsf-orchestrator", + "rsf-runtime-common", + "rsf-unity", + "rsf-windows", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-vk-fsr3" +version = "0.1.2" +dependencies = [ + "rsf-game-sys", + "windows-sys", +] + +[[package]] +name = "rsf-vk-xess-fg" +version = "0.1.2" +dependencies = [ + "rsf-game-sys", + "windows-sys", +] + +[[package]] +name = "rsf-vulkan-fg-fixtures" +version = "0.1.2" +dependencies = [ + "ash", + "rsf-game-sys", + "rsf-orchestrator", + "rsf-test-support", + "rsf-vk-xess-fg", + "windows", + "windows-sys", +] + +[[package]] +name = "rsf-vulkanstory-ngx" +version = "0.1.2" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "rsf-windows" +version = "0.1.2" +dependencies = [ + "rsf-game-sys", + "rsf-minhook-sys", + "windows-sys", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" [[package]] name = "scopeguard" @@ -402,6 +1050,60 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ab42ca02749e120097e328d91d415325bdf43b1c72c4c8badf37375fe40a813" +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + [[package]] name = "skrifa" version = "0.42.1" @@ -414,9 +1116,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.16.0" +version = "1.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f" +checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8" [[package]] name = "syn" @@ -431,9 +1133,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.5" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" dependencies = [ "proc-macro2", "quote", @@ -442,22 +1144,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.20" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.20" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 3.0.5", + "syn 3.0.9", ] [[package]] @@ -468,9 +1170,9 @@ checksum = "0b993bddc193ae5bd0d623b49ec06ac3e9312875fdae725a975c51db1cc1677f" [[package]] name = "unicode-ident" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" [[package]] name = "unicode-segmentation" @@ -480,9 +1182,9 @@ checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] name = "uuid" -version = "1.26.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5772d71c9be8a8a6ac2117d949c5b224c1b72241bb611d9a3012edcf8af7812" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" [[package]] name = "vello_common" @@ -518,28 +1220,147 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core", + "windows-link", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + [[package]] name = "zerocopy" -version = "0.8.56" +version = "0.8.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb" +checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.56" +version = "0.8.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1" +checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f" dependencies = [ "proc-macro2", "quote", "syn 2.0.119", ] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/Cargo.toml b/Cargo.toml index 1f83ae202..4f7285b30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,50 @@ [workspace] -members = ["ui/overlay", "runtime/backends/rsf-upscaler"] +members = [ + "ui/overlay", + "tests/overlay", + "tests/process", + "tests/ac7-render-scope", + "tests/overlay-panel", + "tests/overlay-service", + "tests/support", + "tests/capture", + "tests/presentation", + "tests/presentation/api", + "tests/translucency", + "tests/game-sdk", + "tests/ac7-capture", + "tests/generation", + "tests/vulkan-fg", + "runtime/backends/fsr/compat", + "runtime/vulkan/fsr3", + "runtime/vulkan/ngx", + "runtime/vulkan/streamline/lifecycle", + "runtime/vulkan/xess-fg", + "runtime/common", + "runtime/graphics/rust", + "runtime/graphics/submission", + "runtime/orchestrator", + "runtime/shader_patch/compiler", + "loader", + "tests/loader", + "sdk/game", + "games/ac7", + "games/ac7/plugin", + "games/anomaly", + "games/fallout4", + "games/minecraft", + "games/project-wingman", + "games/rdr2", + "games/skyrim-se", + "games/unity-mono", + "integrations/unity", + "integrations/godot", + "integrations/steam", + "integrations/windows", + "third_party/minhook", + "tools/exposure_probe", + "tools/bindgen", +] resolver = "3" [workspace.package] @@ -11,6 +56,10 @@ publish = false license = "MIT" [workspace.dependencies] +ash = { version = "=0.38.0", default-features = false, features = ["std"] } +cc = "1" +windows = { version = "0.62.2", default-features = false } +windows-sys = "0.61" egui = "=0.35.0" [workspace.lints.rust] diff --git a/LICENSE b/LICENSE index 40bf57b46..b9de04f9e 100644 --- a/LICENSE +++ b/LICENSE @@ -2,6 +2,9 @@ MIT License Copyright (c) 2026 KillerPixelCrew +The DirectXMath-derived operations in sdk/game/src/xm.rs are +Copyright (c) Microsoft Corporation. + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights diff --git a/PORT.md b/PORT.md new file mode 100644 index 000000000..84fa99fa3 --- /dev/null +++ b/PORT.md @@ -0,0 +1,4256 @@ +# Remaining C++ port checklist + +The **62 agent assignments** below cover the 804 port inventory entries from `de8b7510` and all 508 open Rust review findings from `1605ae07` on `rust/orchestrator-anomaly`. Each item belongs to one chunk. Paths are relative to the repository root. + +## C bindings + +Bindings are generated at build time by the crate that owns each header (`build.rs` through +`tools/bindgen`): `rsf-game-sys` for the public `rescaleframe/*.h` headers, and each Runtime, +loader, game, integration and test crate for its own private headers, re-exporting the owners it +builds on as `crate::sys`. File paths below that name `*_abi.rs` modules describe the code before +that move. Only vendor-SDK bindings and those compiled by bare rustc stay committed; their +generators say why and take `--check`. + +## Picking up a chunk + +1. Choose a chunk from the [assignment index](#assignment-index) and use its ID when dispatching the work. Its file checkboxes, fixtures and Rust findings form the brief for one agent. Within a chunk, address the high-severity findings first. +2. The primary Rust citation or native file path identifies the owner. Read other cited locations as evidence. If a fix also changes a file assigned to another chunk, agree on one writer and hand off the caller changes. Coordinate edits to shared crate roots, build targets and binding generators the same way. +3. Implement related findings together when they share a cause. Check off each original entry only after its own evidence supports closure. Report the commit, changed paths, closed items and anything still pending. The user owns build and test execution. + +### Chunks with high-severity findings + +| Chunk | First issue to investigate | High findings | +| --- | --- | ---: | +| [F01 · Fallout 4 startup and CPU ownership](#f01) | Fallout 4 worker address shadows the worker function. | 1 | +| [R02 · RDR2 camera, renderer and presentation](#r02) | RDR2 unit test constructs a struct with a field private to another module. | 1 | +| [N07 · Anomaly SR swap, jitter and temporal history](#n07) | Engine fields may still reference twin resources after a failed restore. | 1 | +| [W01 · Project Wingman integration](#w01) | Wingman compute packet lifetime can exceed its render graph. | 1 | +| [U02 · Unity package session and routing](#u02) | Unity window subclass teardown can break the forwarding chain. | 1 | +| [U04 · Unity Vulkan bridge](#u04) | A Unity Vulkan resize can replace a shared image while GPU work still uses it. | 1 | +| [G02 · Frame tap, constants and scene promotion](#g02) | Frame-tap slots, overridden constants, pending Map pointers and promoted views share restoration obligations. | 4 | +| [V04 · Streamline and NGX Vulkan](#v04) | Vulkan capture allocation failure can close the same native owner twice. | 1 | + +## Assignment index + +Files include implementation, header, fixture and supporting entries. The findings column counts open Rust review entries. Each link opens the complete assignment. + +| Area | Chunk | Files | Findings | +| --- | --- | ---: | ---: | +| Core, loader and overlay | [C01 · GameSDK, contracts and plugin sessions](#c01) | 17 | 3 | +| | [C02 · Render host and frontend](#c02) | 12 | 14 | +| | [C03 · Shared settings and utilities](#c03) | 6 | 4 | +| | [C04 · Generation policy, frame identity and leases](#c04) | 28 | 8 | +| | [C05 · CPU receipts, latency and pacing](#c05) | 19 | 12 | +| | [L01 · Loader entry and carrier forwarding](#l01) | 18 | 0 | +| | [L02 · Loader census and diagnostics](#l02) | 23 | 0 | +| | [O01 · Shared overlay input and windows](#o01) | 13 | 4 | +| | [O02 · Shared overlay rendering and panel](#o02) | 20 | 23 | +| Graphics and presentation | [G01 · Graphics observers and device identity](#g01) | 14 | 3 | +| | [G02 · Frame tap, constants and scene promotion](#g02) | 12 | 10 | +| | [G03 · Graphics state, composition and resource roles](#g03) | 31 | 6 | +| | [G04 · Colour, depth, motion and fullscreen passes](#g04) | 31 | 5 | +| | [G05 · Sharpening and shader assets](#g05) | 24 | 4 | +| | [G06 · Shader patching and compilation](#g06) | 7 | 4 | +| | [G07 · Texture and frame capture](#g07) | 18 | 13 | +| | [D01 · D3D11 rendering host](#d01) | 8 | 8 | +| | [D02 · D3D11 presentation and shared surfaces](#d02) | 12 | 4 | +| | [D03 · SR sessions and bridging](#d03) | 19 | 11 | +| | [D04 · D3D12 SR and generation hosts](#d04) | 12 | 16 | +| | [D05 · D3D11 and D3D12 DLSS](#d05) | 13 | 12 | +| | [D06 · D3D12 Streamline generation and compatibility](#d06) | 15 | 7 | +| | [D07 · D3D12 FidelityFX and XeSS](#d07) | 13 | 1 | +| | [D08 · OpenGL interop and rendering](#d08) | 5 | 10 | +| | [V01 · Vulkan SR and provider admission](#v01) | 12 | 10 | +| | [V02 · Vulkan FG and shared WSI](#v02) | 15 | 4 | +| | [V03 · Vulkan DX12 interop and generation](#v03) | 7 | 5 | +| | [V04 · Streamline and NGX Vulkan](#v04) | 21 | 15 | +| | [V05 · FidelityFX Vulkan bridges](#v05) | 27 | 13 | +| | [V06 · XeSS Vulkan bridges](#v06) | 15 | 7 | +| Games | [A01 · AC7 carrier and renderer lifecycle](#a01) | 10 | 9 | +| | [A02 · AC7 render scopes, views and scene effects](#a02) | 19 | 8 | +| | [A03 · AC7 F9 motion capture](#a03) | 7 | 7 | +| | [A04 · AC7 velocity shader transforms](#a04) | 5 | 7 | +| | [A05 · AC7 velocity pass and history](#a05) | 7 | 7 | +| | [N01 · Anomaly startup and observation](#n01) | 23 | 8 | +| | [N02 · Anomaly input and overlay](#n02) | 14 | 4 | +| | [N03 · Anomaly geometry](#n03) | 10 | 3 | +| | [N04 · Anomaly motion and foliage](#n04) | 23 | 12 | +| | [N05 · Anomaly shader loading and temporal patches](#n05) | 9 | 2 | +| | [N06 · Anomaly SR stage and reconstruction](#n06) | 18 | 18 | +| | [N07 · Anomaly SR swap, jitter and temporal history](#n07) | 12 | 9 | +| | [N08 · Anomaly frame generation](#n08) | 9 | 8 | +| | [F01 · Fallout 4 startup and CPU ownership](#f01) | 7 | 11 | +| | [F02 · Fallout 4 render inputs and resolution](#f02) | 15 | 10 | +| | [F03 · Fallout 4 render hook transactions](#f03) | 3 | 12 | +| | [R01 · RDR2 startup, settings and input](#r01) | 10 | 9 | +| | [R02 · RDR2 camera, renderer and presentation](#r02) | 9 | 12 | +| | [R03 · RDR2 capture and diagnostics](#r03) | 6 | 11 | +| | [S01 · Skyrim startup, CPU input and compatibility](#s01) | 12 | 13 | +| | [S02 · Skyrim rendering and presentation](#s02) | 15 | 12 | +| | [W01 · Project Wingman integration](#w01) | 10 | 10 | +| | [M01 · Minecraft native integration](#m01) | 2 | 6 | +| Engine and platform integrations | [I01 · Steam and Windows integration](#i01) | 4 | 2 | +| | [U01 · Unity Mono startup and configuration](#u01) | 8 | 7 | +| | [U02 · Unity package session and routing](#u02) | 3 | 9 | +| | [U03 · Unity D3D11 and D3D12 bridges](#u03) | 8 | 7 | +| | [U04 · Unity Vulkan bridge](#u04) | 4 | 7 | +| | [U05 · Unity Editor preview](#u05) | 3 | 3 | +| | [E01 · Godot engine hooks and render graph](#e01) | 19 | 5 | +| | [E02 · Godot host services and D3D12](#e02) | 8 | 14 | +| | [E03 · Godot Vulkan](#e03) | 5 | 10 | +| **Total** | | **804** | **508** | + +## Simplification + +Goal: remove code, build logic, tests and docs that do not earn their place by function. Behaviour is preserved and the existing tests verify it. Line counts below are context, not targets. +An entry is checked off only when the code is removed (or folded into the named surviving copy) and the tests that cover it pass. The source surveys are gitignored, so every finding and its evidence is carried here. +ID prefixes: `S` first survey section, `OC` orchestrator core, `OV` orchestrator Vulkan and backends, `RS` runtime shared and loader, `GO` other games and integrations, `GM` Anomaly and AC7 audit, `T` tests, `BT` build and tooling, `DOC` docs, `D` decision, `X` correctness item. Merged entries cite every source ID. +Confidence: h high, m medium, l low. The survey and audits ran read-only on `rust/orchestrator-anomaly`; nothing was built or run. + +### Decisions needed + +Status is open unless stated. Each line gives the choice, the options and the auditor's recommendation. + +- **D1 Legacy D3D11 compatibility renderer in `dlss_bridge.c` (RS-A3).** Choice: keep the binding-matcher fallback that runs only when native AC7 activation is refused, or make that a hard "native controller or no SR" failure and delete the plans behind it (`scene_promote.h`, `depth_replay.h`, `present_blit.h`, `ui_identify.h`, `ui_layer.h`, `constant_twin.h`, `resource_roles.h`, and the orchestrator `frame_tap`, `scene_promote`, `depth_replay`, `ui_layer`, `constant_twins` plus `tests/frame_tap.c`, `tests/g02/*`). No size claim; user-visible because a refused hook would fail instead of degrading. `rsf_frame_tap_install` stays either way (AC7 motion capture reads `on_geometry`). Auditor: code is clearly fallback and docs call the matcher "not a default"; rule on it. +- **D2 `serde_json` for the shader-pack parse (RS-C1).** Choice: replace the pinned yyjson C dependency with `serde_json` (already in `Cargo.lock` through `tests/loader`) or a small hand reader. Auditor: replace, if a new crate dependency in a shipping DLL is acceptable. +- **D3 GPL sharpening isolation (RS-C3).** Choice: keep `pass_payload.c` and the GPL-3.0-only shader headers in one C unit, or move to `.hlsl`/`.spv` files with `include_str!`/`include_bytes!` and one GPL-licensed Rust module. Auditor: low priority; keep until the licence owner confirms the C unit is not the isolation boundary. +- **D4 Overlay panel as a separate DLL (RS-E2).** Choice: keep `rescaleframe_overlay.dll` (egui isolation, ABI 20 header) or depend on the crate as an rlib and drop the loader, five externs, fixture and staging scripts. Auditor: keep if the isolation is wanted; low confidence. +- **D5 RDR2 overlay/cursor probe in the generic render host (OC-F1).** Choice: delete it, or replace with a synthetic overlay test. Auditor: delete once the RDR2 cursor research is ruled closed; move the other two INI keys to `settings_store`. +- **D6 `input_dump.c` forwarders (OC-D3).** Choice: keep the C forwarder ring that renames exports and publishes a services table, or export the public names from Rust and call services directly. Auditor: move to Rust (medium; needs the `runtime/graphics` owner for `texture_dump.c`). +- **D7 VulkanStory owners (S2.4, OV-D1, BT-16, S4 vulkanstory). DECIDED (revised, see Rulings):** XeSS-FG, FSR4 and FSR4-FG already have one owner; FSR3 keeps its VulkanStory owner as a Cargo package that shares the orchestrator's FidelityFX binding. +- **D8 Godot harness (BT-20).** Choice: keep or archive about 2,800 lines (`eng/build-godot*.ps1`, `prepare-godot.ps1`, `patch-godot.py`, `godot-*.ps1`, `capture-godot.ps1`, `test-godot*.ps1`, `tools/analyze-godot-*.py`, `tools/diagnostics/*`). Godot is not in the release set. No auditor recommendation (owner's decision). +- **D9 Bootstrap and launcher scaffolds (RS-C4, BT-11).** Choice: remove `ReScaleFrame.Bootstrap.dll`, `ReScaleFrame.exe`, their two Rust exports and `launcher_version`, or keep them as announced scaffolds (or make them Rust `[[bin]]`). Auditor: remove until a launcher is built (medium; reverses an announced plan). +- **D10 Fixture-crate merges (BT-22).** Choice: merge the 11 `tests/*` staticlib crates (presentation + api, overlay + overlay-service, capture + ac7-capture, translucency) or leave them. Auditor: low confidence; decide after T6/BT-02 and the support crate (T9). +- **D11 GPL SPDX headers in `tools/` and `tests/*.py` versus the MIT tree (T8, BT-19).** Choice: relicense, replace the headers, or record an exception in `docs/dependencies.md`. Auditor: needs a licence ruling (`docs/dependencies.md` not checked). +- **D12 Tracked Unity DLLs and build output (T7, GO-C1).** Choice: `git rm --cached` and ignore `bin/` now (h), and separately whether to rewrite history to purge 3.3 MB of Unity binaries from `dee20e58`. Auditor: owner decides the history rewrite. +- **D13 RDR2 research capture code (GO-E2).** Choice: delete about 5,500 lines of capture, probe and trace code, put it behind a `research` cargo feature compiled only into developer builds, or keep. Auditor: delete if the research is finished, otherwise the feature gate. +- **D14 Fallout 4 diagnostic receipts (GO-E3).** Choice: remove the once-per-key proof-gate receipts in `cpu_events.rs` (about 300 lines) or keep them as the evidence tool for run-and-read-log loops. Auditor: keep only while an investigation is current (low confidence). +- **D15 T1 move versus gate.** Choice: gate the orchestrator fixtures behind a `test-fixtures` feature (mechanical) or move the 18-file `graphics_fixture` family to a test crate (needs visibility changes). Auditor: gate now at minimum; move later where the checks need only Graphics C ABI. +- **D16 T12 embedded pairs.** Choice: keep all 14 CTest entries, or keep the DLL-linked test per pair plus one embedded smoke test for AC7's linked consumption. Auditor: reduce (medium-low; some embedded variants cover symbols the DLL does not export). +- **D17 T16 manual experiments.** Choice: mark every manual target `EXCLUDE_FROM_ALL` (h), and whether the `d3d11-host-device-fixtures` code (about 2,850 lines of Rust plus C) is still a wanted experiment. No auditor recommendation on the second. +- **D18 Doc evidence salvage (DOC-D2, DOC-D3, DOC-D1).** Choice: which facts of the evidence-bearing `rust-*` notes move into game notes before deletion. Auditor: delete the 109 low-evidence notes, salvage the list in DOC-D2 first. +- **D19 `PORT.md` retirement (DOC-D1).** Choice: keep `PORT.md` as the tracker (it currently hosts this section) or move this section to its own file and delete `PORT.md` with a "Retained C++ and why" table. Auditor: retire it after the 30 unchecked entries are carried over. +- **D20 Wingman carrier (BT-10, RS-C5).** Choice: delete `rsf_proxy_wingman`, `wingman_loader.c`, `package-wingman.py` and the install note, or keep. Auditor: one `xinput1_3` carrier (`rsf_proxy_plugin`); the Wingman plugin scaffold itself stays (medium). +- **D21 AC7 carrier inside the shared shim (RS-A2, BT-03).** Choice: drop the AC7 sources from `rsf_proxy_dinput8` after confirming no shipped flow loads AC7 through `carriers/version.dll`. Auditor: drop; high that the double build exists, medium that no flow depends on it. +- **D22 Streamline owners and admission (OV-H1, OV-H2).** Choice: one D3D owner (`streamline_host`) that SR borrows plus the Vulkan lifecycle, one admission module with two inputs (digest or NVIDIA key). Design change, behaviour differs in when each path initialises. Auditor: medium. +- **D23 Public status of `rsf_dlssgvk_*` and `rsf_fgvk_create{,_for_backend}` exports (OV-A1).** Choice: treat as API or delete. Auditor: delete; only `tests/vulkan-fg/src/dispatch.rs` names them and Godot uses `rsf_fgvk_create_with_host`. +- **D24 Private bridge result codes (OV-G3).** Choice: keep `-13001..-13003`/`-10001..-10002` at the standalone VulkanStory exports only, or everywhere. Auditor: return backend codes internally; low-medium until VulkanStory's reads are checked (moot once D7's shim lands). +- **D25 Unity package code location (GO-D1).** Choice: move `package_state*`, `d3d11_*`, `vulkan_*`, `bridge_*` from `games/unity-mono` into a crate under `integrations/unity`, removing the `mono-plugin` feature split. A move, not a deletion; medium. +- **D26 Bindgen strategy (S5).** Choice: one owner crate per header family with committed output plus `--check`, or bindgen at build time in each owner (needs libclang: no `libclang.dll` or LLVM found on the dev machine; pin `LIBCLANG_PATH` in `verify.yml`). Vendor-header outputs (FidelityFX, XeSS, NVAPI, Godot Vulkan) stay committed unless pinned vendor headers are provisioned. Auditor: first make one owner per header (removes about 18,200 redundant lines either way), then decide. +- **D27 Shim INI readers (RS-B4).** Choice: keep `shim.rs` lenient `GetPrivateProfile*` (absolute paths, `AutoStart` default 1) or move to the strict `config::parse`; changes accepted configurations. Auditor: keep lenient, delete only the log closure (low). +- **D28 Anomaly evidence scripts and shader tool (T17, BT-15).** Choice: move `tests/anomaly_*_evidence.py` to `tools/` with one helper module; delete or archive `tools/anomaly_shader_tool.py` and its cluster. Auditor: move (T17, medium); delete or move to `docs/research` after owner confirms (BT-15, medium). +- **D29 Research-reproduction scripts (BT-19).** Choice: delete or move beside their notes. Auditor: move beside the note (AGENTS.md wants research reproducible). +- **D30 Minecraft status generator (GO-E4).** Choice: hand-maintain `status.rs` and the Java accessors or keep the generator. Auditor: low confidence, about 90 lines. +- **D31 Per-monitor-v2 DPI request (GO-B7).** Choice: adopt Fallout 4's verifying form in `sdk/game` for Skyrim too, which changes Skyrim behaviour if verification is stricter. Auditor: medium. +- **D33 SEH `__try/__finally` as Rust `Drop` guards (GM, "Not flagged").** Choice: replace `__try/__finally` around trampolines (`games/anomaly/src/native_observer_platform.c:121-139`, `bootstrap_platform.c:32-49`, `sr_stage_platform.c:58-78`, `games/ac7/src/motion_capture_trampolines.c:22-29`) with Rust `Drop` guards in `extern "C-unwind"` detours (a foreign MSVC exception unwinding through `C-unwind` frames runs Rust drops), deleting most trampoline C, or keep the C. Changes unwind semantics in shipped hooks. Auditor: coordinator rules before anyone tries. +- **D32 AGENTS.md and vendored skill copies (DOC-D7.5, DOC-D7.6, DOC-D6).** Choice: shrink the AGENTS.md "Reference completeness" paragraphs to three lines linking the skill; delete the vendored `.agents/skills/reverse-engineer-anything/` if not customised (not diffed); split `representation-plan.md` keeping only its appendix. Auditor: low, low, medium. + +#### Rulings (coordinator, 2026-11-22) + +- **D2** replace yyjson with `serde_json`; drop the yyjson pin and download logic. **D3** keep the GPL sharpening C unit as the isolation boundary. **D4** keep the overlay as a separate DLL (egui isolation). **D5** delete the RDR2 probe from the render host (Rule 1); move its two INI keys to `settings_store`. **D6** export the public names from Rust and call services directly. +- **D7** revised after the stage B check: XeSS-FG (`runtime/vulkan/xess-fg/session.rs`, shared by the Runtime and `VulkanStoryXessFg.dll`), FSR4 SR (`fsr4/owner.rs` in `rsf-fsr4-compat`, linked by both) and FSR4-FG (orchestrator only) already have one owner each; `vulkan_xess_fg.rs` is the provider layer above the XeSS session, not a second owner. FSR3 is the only duplicate, and `vulkan_ffx_fg.rs` is not a drop-in: it takes the swapchain through the corrected SDK's WSI hook route and the provider frame API, while `VulkanStoryFsr3.dll` exposes SR plus an explicit FG-context and swapchain-proxy API driven by VulkanStory's managed host. A shim would be a new adapter of about 1,000 lines that changes the shipped DLL. Ruling: keep `fsr3/owner.rs` as VulkanStoryFsr3's owner, build it as a Cargo package, share one FidelityFX binding with the orchestrator and remove its internal versioned tables and Rust-only C ABI; for XeSS and FSR4 fix packaging and S2.1/S2.3/S2.5 only. **D8** keep the Godot harness (tooling for a live integration), but delete scripts no workflow or doc names. **D9** remove the bootstrap and launcher scaffolds; Git history keeps them. **D10** merge fixture crates after the T9 support crate exists. **D13** put RDR2 research capture behind a `research` feature excluded from release builds. **D14** keep the Fallout 4 receipts. +- **D15** gate behind `test-fixtures` now; move to test crates where a check needs only the C ABI. **D16** reduce to one DLL-linked test per pair plus one embedded AC7 smoke test. **D17** `EXCLUDE_FROM_ALL` for manual targets; keep the D3D11 host device fixtures. **D18** salvage the DOC-D2 facts, then delete the low-evidence notes. **D19** keep PORT.md as the record of retained native code (retirement withdrawn 2026-11-24). +- **D20** delete the Wingman carrier and packager. **D21** drop the AC7 sources from the shared shim. **D22** one Streamline D3D owner plus one admission module. **D23** delete the `rsf_dlssgvk_*` and `rsf_fgvk_create{,_for_backend}` exports. **D24** backend codes internally; moot after D7. **D25** move the Unity package code to a crate under `integrations/unity`. **D26** one owner per header; build-time generation for in-repo headers; vendor-header outputs stay committed with `--check`. +- **D27** keep the lenient shim INI reader; delete the log closure. **D28** move the evidence scripts to `tools/` with one helper; delete `anomaly_shader_tool.py` and its cluster unless a doc names it as methodology. **D29** move research scripts beside their notes. **D30** no change. **D31** adopt the verifying DPI form in `sdk/game` for both games. **D32** no AGENTS.md change without the user; delete the vendored skill copy only if it matches upstream; split `representation-plan.md`. **D33** allowed only after a throwing fixture proves Rust drops run on a foreign MSVC exception through `extern "C-unwind"`. Stage B (games/anomaly, games/ac7) did not take it: proving it needs a fixture run. The C termination handlers stay and use `foreign_guard.h`. +- **D1** (user): delete the legacy AC7 binding-matcher renderer; a refused native path runs without SR. Orchestrator half done: `constant_twins`, `depth_replay`, `scene_promote`, `ui_layer` and `tests/ui_layer.rs` with its CTest are deleted (the orchestrator has no `frame_tap` module; it lives in rsf-graphics). **D11** (user): relicense the first-party GPL-headed scripts to MIT (done). **D12** (user): untrack the Unity build output and purge it from history (done). + +### Correctness and licensing issues found by the audit + +- [x] **X1 T2 + BT-18 + GM-G4 Shipping AC7 plugin is built with the `warp-fixture` feature.** With `BUILD_TESTING=ON` (every preset in `CMakePresets.json:11,27`), `games/ac7/CMakeLists.txt:2-6` builds `rsf-ac7 --features warp-fixture` and links it into `rsf_game_ac7`; `tools/package-ac7.py:108` and `tools/package-release.py:83-90,116` ship that DLL (and the carriers linking `rsf_ac7_rust` through `rsf_ac7_view`, `CMakeLists.txt:10-13`), which carries the `TEST_MODULE`/`TEST_ENGINE` engine-address override and about 90 KB of fixture code. Keep: a plain `rsf_ac7_rust` archive for `rsf_game_ac7` and a separate `rsf_ac7_fixture_rust` archive (one CMake line; `rsf_add_rust_static` already isolates target dirs per feature) for `ac7_native_graph`, `ac7_velocity_shader`, `d3d11_present_bridge` (links `rsf_ac7_rust`, `tests/CMakeLists.txt:654`); confirm `package-ac7.py` runs from a `BUILD_TESTING=OFF` tree. Where: `games/ac7/CMakeLists.txt:2-6,32`, `games/ac7/src/native_renderer.rs:48-50,216-250`, `games/ac7/src/lib.rs:75-77`, `tests/ac7_native_graph.rs` (44 KB, 1,222 lines, `#[path]` at `native_renderer.rs:48-50`), `tests/ac7_velocity_shader_fixture.rs` (195 lines) and `tests/ac7_velocity_warp.rs` (46 KB); production functions branch on test state: `game_module()`/`engine_address()` read `TEST_MODULE`/`TEST_ENGINE` (`native_renderer.rs:216-250`), TrueSky `module()` reads `TEST_TRUESKY_MODULE` (`native_renderer/sky.rs:364-371`), more gated items at `native_renderer/graph.rs:302`, `sky.rs:500`, `velocity_geometry.rs:560`, `velocity_renderer/replay.rs:137`; keep the link order of `rsf_ac7_render_scope` versus `rsf_ac7_rust` (`CMakeLists.txt:25-28`) for the fixture archive. Test: ctest `ac7_native_graph`, `ac7_velocity_shader`. Confidence: h (CMake logic), m (whether the linker keeps it; the release build using the preset). **Done:** rsf_game_ac7 and the carriers link the plain rsf_ac7_rust archive; the warp-fixture archive (rsf_ac7_fixture_rust, defined in tests/CMakeLists.txt) replaces it in the three fixture executables, and rsf_ac7_render_scope links neither. The production TEST_MODULE/TEST_ENGINE branches are still in the crate (X2/D15). +- [x] **X2 S7.1 + OC-B1 + OV-F1 + T1 Test fixtures compiled into the shipping orchestrator.** About 11,800 lines of fixture code (7,351 in 18 `tests/*.rs` files pulled in through `#[path]`, about 4,400 in-crate) are built into every non-test build; the crate has no `[features]` section; every export is called only by test executables, and `cfg(not(test))` gates are the reverse of a test gate. They also pull a WARP device harness, `CreateEventW` and `ash` into the shipping crate. Keep: a `test-fixtures` feature enabled only by a second `rsf_add_rust_static(... --features test-fixtures)` archive for the ctest executables (as `rsf_ac7_rust` and `rsf_anomaly_*_fixture_rust` do), then (D15) move the Graphics-only checks into a test crate or cargo integration tests (S7.2). `native_fg_cpu/fixture_calls.rs` also justifies `Platform::checked` and the `rsf_nfg_cpu_platform` record, which go once tests call the Rust owner. Where (gate in brackets): `runtime/orchestrator/src/lib.rs:121-123` [cfg(windows)] -> `tests/graphics_fixture.rs:7-42` (17 files: colour_transport, d3d11_state, depth_scale, exposure_normalization, fullscreen_pass, motion_decode, motion_resolve, native_reinsert, native_sr_vulkan, resource_roles, sampler_bias, sharpening, sharpening_d3d12, sharpening_settings, sharpening_vulkan, sharpening_vulkan_cpu, ui_layer, plus `graphics_fixture_device.rs`; exports `rsf_depth_scale_fixture`, `rsf_d3d11_state_fixture`, `rsf_colour_transport_fixture`, `rsf_ui_layer_fixture`, `rsf_motion_resolve_fixture`, `rsf_sharpening_vulkan_cpu_fixture` (991 lines)); `src/auxiliary_sr.rs:2-4` [not(test)] -> `tests/auxiliary_sr.rs` (845); `src/dlss_pipeline/exports.rs:5-7` [none] -> `tests/sr_backend_switch_device.rs` (401) + `exports/fixture.rs` (338, `rsf_fixture_sr_pipeline`, called by `tests/sr_pipeline_main.c`); `src/dlss_streamline/exports.rs:4-5` [not(test)] `exports/fixture.rs` (178, `rsf_fixture_dlss_backend`); `src/sr_session.rs:4` [none] `fixture.rs` (291, `rsf_sr_session_fixture`); `src/sr_bridge.rs:5-6` [not(test)] `fixture.rs` (301, `rsf_sr_bridge_fixture`); `src/shader_patch.rs:9-10` [not(test)] `fixture.rs` (272) + `fixture/device.rs` (429), `rsf_shader_patch_corpus_main/_device_main`; `src/streamline_sr/sdk.rs:5-6` [not(test)] `sdk/layout_fixture.rs` (321, `rsf_fixture_dlss_sr_layout`); `src/fsr4_fg_bridge.rs:27-28` [none] `state_fixture.rs` (510, `rsf_fixture_fsr4fg_bridge_state`); `src/vulkan_fsr4_sr.rs:31-32` [none] `state_fixture.rs` (833, `rsf_fixture_fsr4sr_state`, `rsf_fixture_fsr4sr_public_abi`); `src/native_fg_cpu.rs:115` [none] `fixture_calls.rs` (132, eleven `rsf_core_native_*` exports). Confidence: h that they are ungated and test-only, m on move versus gate. **Done:** the fixture exports sit behind a `test-fixtures` feature (`runtime/orchestrator/Cargo.toml`), a second archive built only under `BUILD_TESTING` is linked by the 30 executables that set `RSF_ORCHESTRATOR_FIXTURES` (end of `tests/CMakeLists.txt`, `runtime/orchestrator/CMakeLists.txt`), and the dead code only fixtures used (`Sharpen12::dispatches`, `Platform::checked`, `shader_patch/dxbc.rs`, `dxbc_chunks`, the DXBC half of `shader_hash`) is gated with them (commit "Build the orchestrator fixture exports only into a test-fixtures archive"). Open under S7.2: moving the Graphics-only checks into test crates (decision D15: they use orchestrator-internal modules, so the move needs visibility changes). `rsf_nfg_cpu_platform` stays: production fills it. +- [x] **X3 S7.1 + T3 + GO-C2 + GM-G4 Test fixtures compiled into shipping game crates.** Four to five game-crate drivers are in every build with no run-time use; Wingman's camera fixture also runs twice (`cargo test` and ctest `wingman_camera_contract`). Rdr2 gates its fixtures with features (`capture_state.rs:18`, `camera.rs:13`), which is the pattern. Keep: the existing per-crate features (`sr-fixtures`, `native-hook-fixture`) or `#[cfg(test)]`; delete `tests/wingman_camera.c`, its CMake target and the `no_mangle` export and keep the `#[test]`; Skyrim fixture behind a `fixtures` feature or a `windows`-gated Rust test using `VirtualAlloc` + `PAGE_NOACCESS` instead of the C SEH read. Where: `games/anomaly/src/lib.rs:79-80` `sr_jitter_fixture` <- `tests/anomaly_sr_jitter_fixture.rs` (456, no gate); `games/anomaly/src/native_geometry.rs:7-10` `fixture` (193) + `fixture_abi` (127) + `native_geometry/fixture_platform.h` [cfg(windows) only; five `rsf_test_anomaly_geometry_*` exports called only by `tests/anomaly_geometry_hooks.c` and `anomaly_geometry_tests.c`; gate on a `geometry-fixture` feature or `cfg(test)`]; `games/anomaly/src/lib.rs:77-78` `sr_fixture_readback.rs` (96) [cfg(windows) only; callers are only `sr-fixtures` modules `sr_stage/jitter_device.rs:6`, `sr_d3d11/temporal_device.rs:11`; gate on `sr-fixtures`]; `games/project-wingman/src/camera.rs:158-160` `camera_fixture.rs` (83-85) [cfg(windows)], `camera_fixture.rs:17,85-88`, `tests/wingman_camera.c`, `tests/CMakeLists.txt:96-98`; `games/skyrim-se/src/cpu_policy.rs:5` `mod fixture;` (`cpu_policy/fixture.rs:7`, 240; used by `tests/skyrim_input_main.c`, `tests/CMakeLists.txt:414-417`). About 1,100 lines plus 30 of C/CMake. Confidence: h (Wingman, anomaly), m (Skyrim, the ctest uses the real C SEH read). **Done:** Anomaly `sr_jitter_fixture`, `sr_fixture_readback` and `native_geometry::fixture` are behind `sr-fixtures` and the two ctest executables link the `sr-fixtures` archive (the default `rsf_anomaly_rust` archive had no other consumer and is gone); Wingman `camera_fixture` is `cfg(test)` with its `no_mangle` export, `tests/wingman_camera.c` and the CTest entry deleted (the `#[test]` stays); Skyrim `cpu_policy::fixture` is behind a `fixtures` feature with a second archive for `skyrim_input` (kept the real C SEH read the ctest exercises; the `VirtualAlloc` Rust test is not written). `sr-fixtures` also needed `ptr::null` restored in `sr_temporal/runtime_fixture.rs`. +- [x] **X4 T8 + BT-19 GPL SPDX headers in an MIT tree.** `tests/test_capture_sequence.py:1` and `tests/test_game_pan.py:1`, `tools/capture-sr-sequence.py`, `analyze-sr-captures.py`, `pan-game-camera.py`, `runtime-action.py`, `send-game-key.py` and four `package-*.py` carry `SPDX-License-Identifier: GPL-3.0-only`; AGENTS.md License section says MIT. Keep: n/a (needs a ruling, D11); also see `THIRD_PARTY.md` GPL-3.0-only sharpening ports (D3). Where: files above. Confidence: l (`docs/dependencies.md` not checked). +- [x] **X5 T7 + GO-C1 Tracked third-party binaries and build output.** `tests/unity-package-layout/bin/Release/net10.0/` is tracked (commit `dee20e58`): `UnityEngine.CoreModule.dll` (2,030,512 B), `UnityEngine.MathematicsModule.dll` (740,784), `UnityEngine.BurstModule.dll` (337,832), `Unity.Scripting.dll` (70,568), `UnityEngine.ScriptingModule.dll` (65,968), and `ReScaleFrame.Unity.LayoutTests.{exe,dll,deps.json,runtimeconfig.json}`; 3.3-3.4 MB. `dotnet run` regenerates them (`eng/test-unity-sharpening.ps1:7`, passes `UnityManagedDirectory`); `.gitignore:3` ignores `**/obj/`, `:4` only `runtime/managed/**/bin/`. AGENTS.md keeps licensed engine material out of Git and these are Unity player assemblies. Keep: `git rm -r --cached tests/unity-package-layout/bin` and add `tests/**/bin/` to `.gitignore`; history rewrite is D12. Where: `tests/unity-package-layout/bin/**`, `ReScaleFrame.Unity.LayoutTests.csproj` (`HintPath`), `.gitignore:3-4`. Confidence: h. +- [x] **X6 DOC-D5 + GO-F1 + OV-J + BT-16 + BT-13 Stale ABI versions, facts and file names in live docs.** Game ABI is 24 (`sdk/game/include/rescaleframe/game_api.h:8`) but "13" is claimed in `docs/design.md:17`, `games/project-wingman/README.md:7`, `runtime/orchestrator/README.md` (plugin_session row), `docs/representation-plan.md:5` (also overlay ABI 9 versus 16), `docs/documentation-audit.md:20`, and `engine.json` `current_validation` blocks (`games/ac7/engine.json:17,841`, `games/drag-n-wash/engine.json:30`, `games/project-wingman/engine.json:7`, `games/rdr2/engine.json:6`: `"game_abi": 13` or `19`). AGENTS.md "Native ABI" says `game_frame.h` frame/camera ABI 1; it is frame 2, camera 1 (`sdk/game/README.md` says 2). AGENTS.md Architecture table lists 11 targets and omits `rsf_game_anomaly`, `rsf_game_skyrim_se`, `rsf_game_fallout4`, `rsf_minecraft`, `rsf_godot`, Steam and Windows targets. `runtime/orchestrator/README.md` module table names `native_sr_d3d12`, `native_fg_d3d12`, `fg_providers`, `gpu_policy`, `unity_sr_host`, `overlay_d3d12`, `runtime`, `FrameDump`, none of which exists. `integrations/godot/NATIVE.md:325,368,420,482,559` documents platform table versions 2 to 5 while code is `PLATFORM_VERSION = 9` (`platform.rs:18`, `sizeof == 472`, `runtime_platform.c:54`). READMEs name deleted `.cpp` files: `games/unity-mono/README.md:14,16,17,21,41,76,92` (`bridge.cpp`, `package.cpp`, `runtime_graphics.cpp`, `vulkan_bridge.cpp`; now `.c`, `runtime_graphics.cpp` gone), `games/rdr2/README.md:54` (`social_club_guard.c`), `games/skyrim-se/README.md:43` (`plugin.c`, `native_creation.c`), `.agents/skills/truesky-render-integration/references/ac7-depth.md` (2 broken links). `runtime/backends/README.md:5,15` says Streamline stays in C++ while `runtime/backends/dlss/CMakeLists.txt:4-6` says it lives in the Rust orchestrator; `streamline_sr/sdk.rs:2-3` and `streamline_load.h:13-14` cite the deleted `dlss_streamline.cpp`. `runtime/vulkan/fsr3/sdk-fixes/README.md:47,52` and `fsr4/README.md:9` cite `scripts/build-runtime.ps1`, `sdk/minhook`, `sdk/fidelityfx` submodules that do not exist (no `.gitmodules`; `fsr4/build.ps1:12,19,34-37` says MinHook "defaults to the sdk/minhook submodule"). `tests/CMakeLists.txt:361` claims "CI builds it both ways" but `verify.yml` has one job and no vendor directory. `tools/README.md` lists 8 of 76 tracked files. Link check reports 573 broken links, 547 in `PORT.md`. Keep: fix each line or, for `engine.json` `current_validation`, delete the number and link `docs/current-status.md`; replace the orchestrator README module table with a directory pointer. Where: files above. Confidence: h. **Status (reduce-rb-docs):** Done. Game ABI claims fixed in `docs/design.md`, `docs/current-status.md` (ABI table now 24, frame 2 / camera 1, backend 4, FG 2, overlay 20), the Wingman and orchestrator READMEs and the `engine.json` `current_validation` blocks (number dropped); the orchestrator README module table is a directory pointer; Godot `NATIVE.md` no longer documents platform table versions 2 to 5; unity-mono, rdr2, skyrim-se READMEs and the truesky skill use current file names; `runtime/backends/README.md` and the `dlss_streamline.cpp` comments say Streamline is Rust; the fsr3/fsr4 READMEs name the VulkanStory host as owner of the `sdk/` submodules and scripts; `tests/CMakeLists.txt` comment fixed; `tools/README.md` groups every tool. Not done by ruling: the two AGENTS.md items (frame ABI 1 sentence, 11-target Architecture table), D32. +- [x] **X7 T0 `tests/CMakeLists.txt:451` is missing `)`.** `target_link_libraries(rsf_resource_roles PRIVATE rsf_orchestrator_rust ReScaleFrame::Graphics rsf_build_options` has no closing parenthesis; the unclosed call swallows `add_test(NAME resource_roles ...)` and every later line, so `cmake --preset windows-x64` should stop at parse. Introduced by `47dcce26` (2026-11-22). Verified still present at HEAD (`4b24cdc6`). Keep: the same call with `)` at the end of line 451. Where: `tests/CMakeLists.txt:451`. Confidence: h on the text, m on CMake's exact error. +- [x] **X8 T8 + BT-04 Python tests that no gate runs.** `tests/package_release_test.py` (14.5 KB; tests `tools/package-release.py`), `package_anomaly_test.py`, `test_capture_sequence.py` (tests `tools/capture-sr-sequence.py`), `test_game_pan.py` (tests `tools/pan-game-camera.py`), `test_streamline_selected_device_patch.py`, `anomaly_temporal_shader_test.py`, `anomaly_foliage_shader_test.py` run in no CTest entry, no `eng/verify.ps1` step and no workflow; `package_release_test.py`, `test_capture_sequence.py` and `test_game_pan.py` are named by no file at all. Only `anomaly_support.cmake:15,57,183` wire `anomaly_shader_test.py`, `generate-anomaly-sr-profile.py --check` and `anomaly_sr_evidence.py --measure-self-test`. The foliage and temporal shader tests need licensed `.local/anomaly/vanilla` data and are referenced only from shader READMEs. Keep: one `add_test(NAME python_tool_tests COMMAND ${Python3_EXECUTABLE} -I -m unittest discover -s tests -p "*_test.py")` (rename the `test_*.py` pair), letting skip rules cover missing `.local` data, or move the local-data scripts to `tools/`. Registering may expose tests that no longer pass. Where: files above, `tests/anomaly_support.cmake:15,57,183`, `eng/verify.ps1`. Confidence: h that they are unwired, m that none is deliberately manual. **Done:** python_tool_tests discovers tests/*_test.py (the test_*.py trio is renamed; both Anomaly shader tests skip without the licensed corpus). The packager tests run green. +- [x] **X9 T3b Anomaly `sr_swap` test modules compile and run nothing under `cargo test`.** `games/anomaly/src/sr_swap/tests.rs` (1,118), `tests/scenarios.rs` (895) and `tests/scenarios/entry.rs` (171) contain zero `#[test]` attributes yet `sr_swap.rs:1614` gates them `cfg(any(test, ...))`; they run only through the ctest launcher `tests/anomaly_sr_swap.c`. Keep: gate on the feature alone, or make them real `#[test]`s. The other `tests.rs` modules of the 72 fixture or test-support files (24,676 lines) were not checked one by one. Where: `games/anomaly/src/sr_swap.rs:1614`, `games/anomaly/src/sr_swap/tests.rs`. Confidence: h (sr_swap), l (others). **Reconciled against the tree:** Unfinished: there is still no `#[test]` in `games/anomaly/src/sr_swap/tests.rs`, `tests/scenarios.rs` or `tests/scenarios/entry.rs`; `games/anomaly/src/sr_swap.rs:1404,1472-1473` gate them `any(test, all(windows, feature = "sr-fixtures"))` and they run only through `rsf_anomaly_sr_swap_fixture` (`tests/scenarios/entry.rs:71`), called from the C `main` in `tests/anomaly_sr_swap.c` (ctest `anomaly_sr_swap_contract`, `tests/anomaly_support.cmake:59-62`). No technical constraint holds it: `rsf_anomaly_sr_engine_layout()` is Rust. Remaining work: gate on the feature alone or turn the cases into `#[test]`s. **Round 3 (r3-anomaly):** done. Every case in `sr_swap/tests.rs` and `tests/scenarios.rs` already carried `#[cfg_attr(test, test)]`, so cargo test ran them; the ctest launcher ran the same cases a second time by name. Its two unique checks are tests too: `engine_layout_matches_the_fixture` reads `sr_profile.rs` directly, and `stage3_matches_the_independent_camera_oracle` uses `temporal_fixture::swap_camera`, which now builds under `cfg(test)` (the module is self-contained). `tests/anomaly_sr_swap.c`, `tests/scenarios/entry.rs`, the ctests `anomaly_sr_swap_contract`, `anomaly_sr_sun_cascades_contract` and `anomaly_sr_reconstruction_window_contract`, and `sr_swap.h` (its only includer was the launcher) are deleted; `rsf_anomaly_sr_engine_layout` is a plain Rust function, and the test modules and `sr_swap::destroy` are `cfg(test)` only. +- [x] **X10 OV-E1 SEH guards around Rust `extern "C"` functions cannot contain an SDK exception.** In `native_sr_fsr4_vulkan.c:68-130` seven wrappers (`bridge_create`, `bridge_plan`, `create_fence`, `create_image`, `bridge_evaluate`, `bridge_prepare_destroy`, `bridge_destroy`) guard Rust functions (`RsfFsr4BridgeCreate` `runtime/vulkan/fsr4/native.rs:522`, `RsfFsr4BridgePlan` `:535`, `rsf_vk_fsr4_create_shared_fence` `:574`, `rsf_vk_fsr4_create_shared_image` `:548`, `RsfFsr4BridgeEvaluate` `:589`, `rsf_vk_fsr4_prepare_destroy` `:480`, `rsf_vk_fsr4_destroy_checked` `:487`). The FidelityFX calls inside use plain `extern "C"` pointers (no `C-unwind` anywhere in `runtime/vulkan/fsr4`), so a C++ exception unwinding into a Rust `"C"` frame is undefined behaviour or an abort and the outer `__except` never returns `FEATURE_FAILED`. Only the two guards that call host callbacks directly (`open_graphics` `:54`, `split` `:102`) work. Keep: the Streamline lifecycle pattern: SDK pointers `extern "C-unwind"` (`runtime/vulkan/streamline/lifecycle/src/sdk_api.rs`, 19 uses) called through the one C guard (`sdk_guard.c:21-28`) from Rust; delete the seven wrappers. No test throws through these today; add a fixture that throws from a fake SDK entry. Where: above. Confidence: m-h (language-defined behaviour; no throwing fixture run). **Reconciled against the tree:** Unfinished: the seven wrappers are still at `runtime/orchestrator/src/native_sr_fsr4_vulkan.c:54-115` (`RSF_FOREIGN_TRY` around the Rust `RsfFsr4Bridge*`/`rsf_vk_fsr4_*` functions), `rg C-unwind runtime/vulkan/fsr4` is empty, and no fixture throws from a fake SDK entry. Files: the FidelityFX pointer declarations in `runtime/vulkan/fsr4/` and `runtime/backends/fsr/compat/src/`, plus the C file above. OV-A2 and OV-A3 wait on this. **Done (round 3, Vulkan C):** `PfnFfx{CreateContext,DestroyContext,Query,Dispatch}` in `runtime/backends/fsr/compat/src/ffx_abi.rs` are `extern "C-unwind"` (generator: `--override-abi` in `tools/generate-d3d12-vendor-bindings.py`); `native_sr_fsr4_vulkan.c` and `native_sr_fsr4_vulkan_platform.h` are deleted. The FSR4 SR table is a Rust static (`NATIVE` in `vulkan_fsr4_sr.rs`) whose bridge entries call the Rust-ABI functions of `rsf_fsr4_compat::vulkan_bridge` inside `rsf_streamline_vk::sdk_api::guarded_or` (the one C guard, `sdk_guard.c`), and whose host-callback entries (`graphics::open` procedure resolution, `split`) call the host pointers as `C-unwind` inside the same guard, as `vulkan_latency.rs` `invoke_checked` does. The `InitOnceExecuteOnce` interop binding is a static reference to `dx12_vulkan_platform::PLATFORM`. Fixture: `vulkan_bridge::tests::the_runtime_guard_contains_an_exception_thrown_by_the_sdk` raises SEH code 0xE06D7363 from a fake `ffxQuery` and checks the guard returns its code and the Rust frames unwound. Kept: the Rust table itself, the seam `vulkan_fsr4_sr/state_fixture.rs` fakes every entry through; the VulkanStory/managed `extern "C"` bridge exports in `vulkan_bridge/native.rs` stay unguarded (an SDK exception there now aborts instead of being undefined). +- [x] **X11 OV-B1 Intra-crate `extern "C"` re-declarations of the crate's own `#[no_mangle]` functions.** 134 declaration sites for 114 names in the Vulkan/backends area (179 sites, 155 names across the orchestrator; scripts `orch-vulkan-intra-extern*.py`, gitignored) let the linker resolve calls the compiler never type-checks, so drift is silent undefined behaviour; e.g. `streamline_host/native.rs:65-70` types `log` as a local `Log` alias while `streamline_sr/native.rs:41-46` uses `crate::render_abi::rsf_backend_log_fn`. It also forces `unsafe` at every call and keeps each callee `#[no_mangle]`. Keep: `use crate::module::function`; drop `#[no_mangle]`/`extern "C"` where no C, `.def` or `GetProcAddress` caller remains (`rsf_dlss_pipeline_*` are public in `dlss_pipeline.h` and keep their export). Where: `streamline_host/native.rs:45-72` (`rsf_core_fg12_*` defined `d3d12_generation/admission.rs:52,105,194,264`, `rsf_core_streamline_log_*` `streamline_log.rs:22,41,52`, `rsf_core_vk_sdk_unload` `sdk_module.rs:170`, `rsf_streamline_load_interposer` `streamline_sr/native.rs:41`, `rsf_dlss_sdk_verify_signature` `streamline_sr/signature.rs:397`); `sr12/native.rs:41-90` (nine `rsf_dlss_native12_*`, defined `dlss_native12/exports.rs:78-227`); `dlss_pipeline/platform.rs:24-73` (13 `rsf_dlss_*` from `dlss_streamline/exports.rs:24-127`, plus `rsf_motion_decode_*`, `rsf_colour_*`, `rsf_native_fg_*`); `d3d11_sr_api.rs:12-27` (13 `rsf_dlss_pipeline_*`, `dlss_pipeline/exports.rs:18-110`); `native_fg_cpu/platform.rs:21-30`, `fg12/native.rs:20-45`, `dlss_streamline/sdk.rs:25-28`, `streamline_sr/native.rs:19-20`, `dlss_native12/sdk.rs:19` (`rsf_streamline_host_*`, `streamline_host/native.rs:1077-1289`); `vulkan_fsr4_fg.rs:60-80,484` (`RsfFsr4Fg*` from `fsr4_fg_bridge.rs:803-914`, `rsf_dx12vk_interop_*` `dx12_vulkan_interop.rs:414-471`, `rsf_dx12gvk_*` `vulkan_dx12_fg/platform.rs:666,704`); `vulkan_xess_fg.rs:124-134` (same interop set again); `vulkan_sr_session/linked.rs:92-115` (five `rsf_core_srvk_session_*`, `vulkan_sr_session.rs:27-139`). All under `runtime/orchestrator/src/`. Confidence: h. Progress (round 2, SR/FG): `fg_dispatch.rs` (19 declarations) and `native_fg/platform.rs` (14) import the definitions; the type check found `rsf_input_dump_named_texture` declared over `rsf_named_frame_dump` while `input_dump` defines it over its own `NamedRequest` mirror. Kept: `dlss_pipeline/platform.rs` and `native_fg_cpu/platform.rs`, whose leaf tables store type-erased `Raw`/`c_void` pointers (the real functions take `*mut Host`, `*mut Pass`, `*mut Mutex`), so importing them needs new wrappers; and the `rsf_core_fg12_*` set in `streamline_host/native.rs` (D3D12 generation owner). **Reconciled against the tree:** about half done: single-line redeclarations of production `#[no_mangle]` names in `runtime/orchestrator/src/` are 82 (the entry counted 179 including multi-line blocks). Kept: `dlss_pipeline/platform.rs` (20) and `native_fg_cpu/platform.rs` (12) because their leaf tables store type-erased `Raw`/`c_void` pointers (callers `dlss_pipeline.rs`, `native_fg_cpu.rs`); `vulkan_latency.rs` (12) declares the `rsf_vk_sl_*` ABI of the separate `rsf-streamline-vk` crate (`sl.def`, a real cross-crate boundary); `vulkan_fsr4_fg.rs` (11) and `vulkan_xess_fg.rs` (4) because `InteropOps` types `Handle` (goes with OV-A1); `vulkan_sr_session/linked.rs` (2) is the Godot `#[path]` link seam (`integrations/godot/native/vulkan/native.rs:24`). Unfinished: `d3d11_sr_api.rs:12-27` (9), `d3d11_observer_capture/dump.rs` (3), `sr_legacy.rs` (2), `auxiliary_sr/platform.rs` (2), `graphics_d3d11.rs` (2), `fullscreen_pass/d3d11.rs`, `native_translucency.rs`, `input_dump/native.rs` (one each): replace the redeclaration with `use`. **Round 3 (r3-orchestrator):** `d3d11_sr_api.rs`, `d3d11_observer_capture/dump.rs`, `sr_legacy.rs`, `auxiliary_sr/platform.rs`, `graphics_d3d11.rs`, `fullscreen_pass/d3d11.rs` and `native_translucency.rs` import the definitions (`dlss_pipeline::exports`, `native_sr`, `motion_decode`, `input_dump`, and `rsf_graphics::{d3d11_state, texture_dump, constant_buffer_read, frame_tap}`); `dump.rs` had typed the decode pass as `c_void`. Kept: `input_dump/native.rs:79` `rsf_common_sha256_file` (rsf-runtime-common is only a dev-dependency because the Runtime DLL links the RuntimeCommon CMake archive, `lib.rs:19`; a normal dependency would link it twice) and the C leaves `rsf_call_native_log` (`plugin_callbacks.c`) and `rsf_observer11_guard_texture_extent` (`runtime/graphics/src/observer_exception_guards.c`). The type-erased tables and the OV-A1 sets above stay with S3.1 and OV-A1. +- [x] **X12 RS-B6 `rsf_streamline_absolute_path` is a weaker re-implementation of `windows_path::absolute_wide_path`.** `runtime/orchestrator/src/streamline_policy.rs:46-56` checks `\\` and `X:\` only (no UNC server/share rule, no drive-letter check); `sdk/game/src/windows_path.rs:29-40` is stricter and used by four crates (`runtime/vulkan/fsr4/owner.rs:715`, `fsr4_fg_bridge.rs:8`, `plugin_session.rs:6`, `vulkan_timing.rs:30`). Its only caller is `streamline_sr/native.rs:69`. Keep: `absolute_wide_path(path, 32767)`; behaviour is stricter on `\\server` alone. Where: above plus its test. Confidence: h. Done (round 2, SR/FG): `streamline_sdk::load_interposer` uses `absolute_wide_path`; a second copy, the runtime-directory filter in `streamline_host::create_host`, uses `absolute_path`; the copy, its test and three constants are deleted. Round 2 (hosts): the D3D11 presentation, SR12, SR bridge, OpenGL pipeline, D3D12 overlay, overlay service, D3D11 host and FG12 blocks now import their callees; still open in `native_fg_cpu/platform.rs` and the Vulkan/backends files. +- [x] **X13 GO-B1 Inconsistent SEH filter: Skyrim creation thunks swallow access violations.** `games/skyrim-se/src/native_creation.c:69,82` use `EXCEPTION_EXECUTE_HANDLER` while every other copy of the guard filters on the C++ exception code `0xE06D7363` only. Keep: pick one filter in the shared guard (see the foreign-exception guard entry in Cross-cutting mechanisms) and apply it to Skyrim deliberately. Where: above. Confidence: h (inconsistency), m (which behaviour is wanted). Done (reduce-rb-games): Runtime and host callbacks contain foreign C++ exceptions only (RSF_FOREIGN_CATCH), so Skyrim's creation thunks and CPU-event host call no longer swallow access violations, like every other Runtime call; reads of engine memory and the third-party Community Shaders initializer keep the all-fault RSF_FAULT_CATCH. Recorded in the Skyrim commit and `native_creation.c`. +- [x] **X14 BT-08 `eng/verify.ps1` clippy never lints the shipping feature sets.** `cargo clippy --workspace --all-targets --locked` (`eng/verify.ps1:33`, no `--all-features`) lints the feature-off configuration while CMake ships `--features native-entry` (`games/anomaly/CMakeLists.txt:5`) and `--features mono-plugin` (`games/unity-mono/CMakeLists.txt:5`); the plugin entry code is not gated. The inverse-polarity `not(feature = "mono-plugin")` gates (`games/unity-mono/src/bridge_native.rs:29-58,153,180,321-449`) are also why those crates compile twice. Keep: make the plugin entry the default and the standalone archive the exception, or add the feature sets to the clippy command (needs a clippy run). Where: `eng/verify.ps1:33`, `games/anomaly/Cargo.toml:30-37`, `games/unity-mono/Cargo.toml`. Confidence: h (gap), l (best fix). **Done:** verify.ps1 runs clippy a second time with --all-features (native-entry, mono-plugin and every fixture feature); the inverse-polarity cfgs stay. +- [x] **X15 S5 Committed bindings that cannot be reproduced, and no drift check.** Four bindgen outputs have no generator in the repository: `games/skyrim-se/src/cpu_call_abi.rs`, `runtime/orchestrator/src/d3d11_observer_hooks/hde_abi.rs`, `tests/vulkan-fg/src/dispatch_abi.rs`, `tests/vulkan-fg/src/ffx_abi.rs` (936 lines; FFX again). `eng/verify.ps1` runs only `cargo fmt --check` and the build; no generator runs in CI and only the two Anomaly profile scripts have `--check`, so bindings can diverge silently from headers (layout asserts catch size changes but not renamed or added fields). `fsr4-fg/bridge_objects_abi.rs` does come from `fsr4-fg/generate-bindings.py:37-47`. Keep: add the four to a generator (or delete the files with their consumers) and one driver with `--check` (see BT-06). Where: files above. Confidence: h. **Done:** stage A gave every committed binding a generator and --check; verify.ps1 now runs tools/generate-rust-bindings.py --check when bindgen-cli is installed. + +### Cross-cutting mechanisms + +Most items come from five patterns left by the port; fix patterns first. Suggested order: one binding owner per header (S5), then Rust-only C ABI to Rust and the bindgen-only headers, then Streamline and FFX records, then in-crate platform tables and shared helpers, then fixtures out of production crates and onto `cargo test`, then the VulkanStory owners (decided, D7). + +- [x] **S1 mechanism 1 + S5 Per-consumer bindgen.** Each crate and test crate runs bindgen on the same public header with its own allowlist, so recursive records are emitted again in every output. 195 committed bindgen files, 2,635 names, 638 names defined in more than one file, about 18,200 redundant lines including layout tests (measured from an item's line to the next top-level item plus its layout-test block, about +-15%; `_bindgen_ty_*` anonymous enums are false duplicates but small). Keep: one `-sys` module per header family, depended on by every consumer: `sdk/game` (`rsf_game_sys`) for `game_api.h`, `game_frame.h`, `d3d11_host.h`, `render_host.h`, `overlay_api.h` and the other `rescaleframe/*.h` contract headers; `runtime/orchestrator` only for headers no other crate reads; `loader` for the census and diagnostics headers; tests and games depend on the owner. Where: same header, several outputs: `overlay_api.h` 4 outputs; `d3d11_host.h` 4 (`sdk/game/src/d3d11_reduced_abi.rs`, `d3d11_chain_abi.rs`, `d3d11_host_abi.rs`, `tests/game-sdk/src/d3d11_host_calls.rs`); `gl_pipeline.h` 3; `module_dump.h` 2 (`loader/src/diagnostics/dump_abi.rs`, `tests/loader/src/windows/module_dump_abi.rs`, all 3 records shared); `shared_surface.h` 2 (unity-mono and `tests/presentation`, all 5 records shared); `ac7_sites.h` 2 (5 of 6 records shared); `native_cpu.h`, `native_fg.h`, `native_fg_cpu_platform.h`, `sharpening_settings.h`, `d3d11_observer.h`, `game_api.h` 2 each. Worst records by copies: `rsf_native_fg_options` 12, `rsf_backend_result` 12, `rsf_fg_status` 11, `rsf_native_fg_status` 11, `rsf_native_cpu_counters` 10, `rsf_render_settings` 9, `rsf_srvk_setup` 8, `rsf_fgvk_setup` 7, `rsf_overlay_service_setup` 5, `rsf_camera_frame` 5; also 9 each of `rsf_backend_log_fn`, `RSF_REFLEX_OFF`, `RSF_FG_OFF`, `RSF_RENDER_FRONTEND_ABI_VERSION`, `rsf_fg_mode`, `rsf_pacing_owner`, `rsf_reflex_mode`, `RSF_SRVK_ABI_VERSION`, `rsf_vk_function`, `rsf_vk_get_proc`. Largest redundant shares: `tests/presentation/src/present_fixture_loops_abi.rs` 1,195 lines, `gl_pipeline_fixture_abi.rs` 1,010, `runtime/vulkan/fsr3/sdk_abi.rs` 938, `tests/vulkan-fg/src/dlss_abi.rs` 725, `tests/overlay-service/src/abi.rs` 687, `tests/game-sdk/src/unity_sr_d3d12_abi.rs` 612, `tests/generation/src/session_abi.rs` 550, `ui/overlay/src/wire.rs` 527. Totals by area (195 files, 53,742 lines in the 187 the generators list; about 57,000 in all `*abi*.rs`): tests 16,344 (38 files), orchestrator 13,507 (53), godot 5,538 (5), anomaly 4,949 (17), sdk/game 2,814 (14), ac7 2,365 (12), unity-mono 1,766 (11), runtime/vulkan 1,449 (6), loader 1,296 (15), fallout4 1,255 (4). Confidence: h. **Done (tree check):** bindgen runs from owners' build scripts through one helper, `tools/bindgen` (`rsf-bindgen`); 21 `build.rs` files use it (`sdk/game/build.rs`, `runtime/orchestrator/build.rs`, `loader/build.rs`, the games, the test crates), and `PUBLIC_INCLUDE_DIRS` in `tools/bindgen/src/lib.rs` makes every other crate take the `rescaleframe/*.h` items from `rsf-game-sys` instead of binding them again. Committed `*abi*.rs` files fell from 195 to 24 (vendor-SDK bindings, `ui/overlay/src/abi.rs` and hand-written records). +- [x] **S5 Bindgen-only headers with no C or C++ includer.** 20 headers exist only to feed bindgen for Rust-to-Rust interfaces (about 7,045 generated lines; a lower bound because headers included only by other headers count as included). Keep: a Rust definition of each record; delete the header and its binding. Where (generated lines): `tests/vulkan-fg/dlss_abi.h` 1,919; `runtime/orchestrator/src/native_fg_fsr4_vulkan_platform.h` 1,143; `integrations/godot/native/host_abi.h` 663; `tests/game-sdk/render_host_fixture_abi.h` 470; `src/overlay_wrapped12_platform.h` 396; `src/native_fg_cpu_platform.h` 395; `src/auxiliary_sr_platform.h` 305; `src/sharpening_vulkan.h` 300; `tools/exposure_probe/dlss_abi.h` 288; `src/overlay_panel.h` 229; `src/d3d11_output_platform.h` 218; `games/anomaly/src/motion_draw_fixture.h` 126; `runtime/orchestrator/include/rescaleframe/overlay_saved_options.h` 119; `src/latency_antilag.h` 113; `src/native_fg_platform.h` 110; `runtime/backends/dlss/src/streamline_generation_records.h` 108; `tests/generation/latency_abi.h` 69; `games/ac7/src/cloud_depth_platform.h` 47; `games/ac7/src/contact_shadow.h` 15; `games/fallout4/src/resolution_stages.h` 12 (orchestrator `src/` paths are under `runtime/orchestrator/`). Related orphans: OC-D1, OV-B3, RS-D2, RS-D3. Confidence: h. **Done (rounds 1 to 4):** 19 of the 20 are deleted and each record is Rust beside its user. Rounds 1 and 2: `overlay_wrapped12_platform.h`, `auxiliary_sr_platform.h`, `sharpening_vulkan.h`, `overlay_panel.h`, `native_fg_platform.h`, `streamline_generation_records.h`, `cloud_depth_platform.h`, `contact_shadow.h`. Round 3: `integrations/godot/native/host_abi.h`, `games/fallout4/src/resolution_stages.h`, `tools/exposure_probe/dlss_abi.h`, `tests/generation/latency_abi.h`, `tests/game-sdk/render_host_fixture_abi.h`, `latency_antilag.h`, `native_fg_cpu_platform.h`, `d3d11_output_platform.h`, `games/anomaly/src/motion_draw_fixture.h`. Round 4: `tests/vulkan-fg/dlss_abi.h` and `native_fg_fsr4_vulkan_platform.h`, together with `native_fg_dx12_vulkan_platform.h`, `native_fg_dlss_vulkan_platform.h` and `native_fg_dlss_vulkan_capture_ledger.h`: the FSR4 and DLSS-G FG fixtures that bound them moved into the orchestrator (`vulkan_dx12_fg/fsr4_state_fixture.rs`, `vulkan_dlss_fg/fixture.rs`, test-fixtures) over the Rust `Ops`, `GraphicsOps`, `InteropOps` and `Platform` records, and the capture `Source`/`Target` records are Rust. `overlay_saved_options.h` is not Rust-to-Rust: it is a public contract header that rsf-game-sys binds. Further bindgen-only headers outside this list are under S1.1. +- [ ] **S1 mechanism 2 + S1.1 + S2.1 + S3.2 + OV-B2 Rust-only C ABI between two pieces of Rust.** 825 production `#[unsafe(no_mangle)]` functions, 304 of them named by no C, C++, header, `.def`, CMake, C#, Java, GDScript or Python file; macro-generated ones (`rsf_core_d3d11p_*`, `d3d11_present.rs:2708`) are not counted. They sit behind raw-pointer signatures, null checks and `unsafe`, often behind a header that exists only to feed bindgen. `pub(crate)` functions also stay `#[no_mangle] extern "C"` with raw owner handles: `mfg_state.rs:312-483` (`rsf_core_mfg_create/prime/prepare/status/release/destroy`, `rsf_core_mfg_create() -> *mut Owner` at `:313`, called from `streamline_host/native.rs:300,394,890`), `vulkan_antilag.rs:508-614` (7, called from `vulkan_latency.rs:400-577`), `vulkan_pcl.rs:61-79`, `streamline_log.rs:22-52`. Keep: plain `pub(crate) fn` with Rust types (methods on `Box`), `#[no_mangle]` only where a C, `.def` or `GetProcAddress` caller exists. Caveat: found textually; a function reached only through a C-filled function-pointer table or a computed `GetProcAddress` name could be a false positive, so spot-check each file's list before deleting. Where, by area: runtime/orchestrator 123, games/rdr2 53, runtime/vulkan 38, games/ac7 37, games/anomaly 26, games/skyrim-se 18, games/fallout4 6, games/unity-mono 3. Per-file counts (runtime/orchestrator unless prefixed): vulkan `fsr4-fg/sdk_commands.rs` 24, rdr2 `capture_state/metadata.rs` 12, anomaly `motion/foliage.rs` 11, vulkan `fsr4/sdk_commands.rs` 11, `fg12.rs` 11, rdr2 `capture_state/recordings.rs` 11, ac7 `motion_capture_records.rs` 10, `streamline_generation_records.rs` 10, `frame_capture12.rs` 10, `streamline_host/generation.rs` 10, `d3d12_host/fg.rs` 7, `vulkan_latency_frames/streamline.rs` 7, `vulkan_antilag.rs` 7, `d3d12_host/sr.rs` 7, `input_dump/abi.rs` 6, `mfg_state.rs` 6, rdr2 `capture_state/d3d12.rs` 6, ac7 `velocity_history.rs` 6, rdr2 `capture_state/shots.rs` 5, `vulkan_latency_frames.rs` 5, ac7 `velocity_commit.rs` 5, `vulkan_sr/xess/graphics.rs` 5, ac7 `motion_capture_observations/colour.rs` 5, rdr2 `capture_state/gpu_leases.rs` 5, anomaly `native_observer.rs` 5, skyrim `cpu_hooks.rs` 5, `d3d11_present_facade.rs` 4, skyrim `presentation.rs` 4, `frame_capture12/native.rs` 4, skyrim `sampling.rs` 4, anomaly `sr_tonemap.rs` 3, `streamline_log.rs` 3, `vulkan_pcl.rs` 3, `d3d12_host.rs` 3, ac7 `motion_capture_session.rs` 3, ac7 `motion_capture_observations/buffers.rs` 3, rdr2 `camera_probe.rs` 3, `reflex_audit.rs` 3; two each: `settings_store.rs`, `d3d11_present_dxgi.rs`, unity-mono `bridge_state.rs`, vulkan `fsr4/standalone.rs`, ac7 `motion_capture_observations/geometry.rs`, anomaly `ini.rs`, rdr2 `scene.rs`, `renderer.rs`, `diagnostics.rs`, `capture_state/pipeline.rs`, fallout4 `resolution.rs`, anomaly `overlay.rs`; one each: skyrim `resolution.rs`, fallout4 `depth_domains.rs`, `sr_session.rs`, fallout4 `cpu_events.rs`, anomaly `shader_loader/reflection.rs`, `vulkan_fg_resources/device.rs`, anomaly `input.rs`, ac7 `velocity_stream.rs`, ac7 `motion_capture_records/artifacts.rs`, vulkan `fsr3/exports.rs`, anomaly `motion.rs`, fallout4 `render_inputs.rs`, fallout4 `screen.rs`, skyrim `plugin.rs`, `frame_limit.rs`, rdr2 `asi.rs`, rdr2 `capture_state/artifacts.rs`, `frame_capture_vk.rs`, `fg_leases.rs`, rdr2 `engine_settings.rs`, `d3d12_fence.rs`, skyrim `compatibility/initializer.rs`, `auxiliary_sr/platform.rs`, unity-mono `package_state/services.rs`, skyrim `cpu_events.rs`, skyrim `cpu_sources.rs`, `native_scene.rs`, ac7 `motion_capture_observations.rs`. Fully dead (zero Rust references): `games/anomaly/src/motion/foliage.rs:236-237` `rsf_anomaly_foliage_begin` and `games/fallout4/src/render_inputs.rs:1445` `rsf_fallout4_inputs_verify`. Rust-only but called from Rust (e.g. `rsf_ac7_capture_shader_facts` 7 refs, `rsf_anomaly_motion_pack_pixel` 9) become plain functions. Confidence: h (m for any single export until spot-checked). **Status (round 4, constraint annotations only):** a fresh census of production `#[no_mangle]` names that no C, C++, header, `.def`, CMake, C#, GDScript, Python or other-crate Rust file names found 41. Round 4 unexported 18 of them, each called only by Rust in its own crate: rdr2 `asi_start_runtime`; the Godot `rsf_godot_effect_record_motion`/`_effect_properties`/`_extension_configure`/`_extension_status`/`_vk_creation_resolver`/`_vk_render_begin`/`_vk_capture_present` (gdextension callers); `rsf_core_xessvk_initialize`/`_shutdown`, `rsf_core_xessgvk_present`, `rsf_core_ffxgvk_present`/`_generation_record`/`_note_generated`, `rsf_core_vkfg_bind_images`, `rsf_core_vk_sdk_pin`; `rsf_d3d11_state_save_independent` (tests/d3d11_state.rs now imports it from rsf_graphics); AC7 `rsf_ac7_translucency_scale` (tests/ac7_session.rs, a `#[path]` module of rsf-ac7, calls the carrier by path). The fixture and header removals (S5, S1.1) unexported another 30 that only a bindgen-only header or a moved fixture named (`rsf_core_fsr4gvk_*`, `rsf_fsr4gvk_interop_create`, `rsf_dx12gvk_graphics`/`_present_marshaled`, `rsf_core_dlgvk_*`, `rsf_dlgvk_leaves`, `rsf_core_dlss_capture_*`, `rsf_core_sharpenvk_*`, `rsf_core_xeg12_*`, `rsf_core_fsr12_*`, `rsf_fixture_fsr4fg_bridge_state`). Kept, each because a Rust caller in another archive reaches it over the C link, so the symbol is its interface: `frame_capture12.rs` (6, `integrations/godot/native/host.rs:39-63`), `frame_capture_vk.rs` (9, `integrations/godot/native/vulkan/native/capture.rs`), `vulkan_sr_session.rs` (5, declared by `vulkan_sr_session/linked.rs`, which Godot compiles through `#[path]` at `integrations/godot/native/vulkan/native.rs:24`), `games/minecraft/native/lib.rs` (2, `tests/presentation/src/gl_pipeline_fixture.rs:48-54`), `integrations/steam/src/lib.rs` `rsf_steam_d3d11_chain_prepare` (`games/fallout4/src/creation.rs:87` declares it with its own bindings over the C ABI; Skyrim calls it by path; both archives embed rsf-steam). Kept for C callers: `rsf_anomaly_geometry_active`/`_set_foliage` (`tests/anomaly_geometry_hooks.c`), `rsf_fsr4vk_info` (`tests/native_sr_fsr4_vulkan_main.c`), the `rsf_core_xessgvk_*`/`rsf_xessvk_interop_*` that `native_fg_xess_vulkan*.{c,h}` name. Signatures stay `extern "C"` where the function is also an entry of a function-pointer table its tests fill (`vulkan_latency.rs` `Platform`, `XessOps`); that is the S3.1 seam, not an export. **Tip check (port-md-entry-review):** the counts and file list in the body describe the tree before rounds 1 to 4. `mfg_state.rs`, `vulkan_antilag.rs`, `vulkan_pcl.rs` and `streamline_log.rs` carry no `no_mangle` now (`rsf_core_mfg_create` is a plain `pub(crate) fn`, `mfg_state.rs:305`, called from `streamline_host/native.rs:232`); `rsf_anomaly_foliage_begin` and `rsf_fallout4_inputs_verify` are gone; `rsf_core_xessvk_initialize` stays exported only under the `test-fixtures` feature (`vulkan_sr/xess.rs:190`). What stays exported without a C or header caller is the Kept set above, each checked: `frame_capture12.rs` 6 (`integrations/godot/native/host.rs:39-63`), `frame_capture_vk.rs` 9 (`integrations/godot/native/vulkan/native/capture.rs:11-19`), `vulkan_sr_session.rs` 5 (`vulkan_sr_session/linked.rs`, `#[path]` at `integrations/godot/native/vulkan/native.rs:24`), `games/minecraft/native/lib.rs` 2 (`rsf_minecraft_observer_install`/`_close`, declared at `tests/presentation/src/gl_pipeline_fixture.rs:48-54`), `integrations/steam/src/lib.rs:658`. Constraint: the caller is a separately linked archive (the Godot native crate, the `tests/presentation` fixture) or, for the Fallout 4 plugin, a crate whose generated bindings type the call differently, and two Rust archives in one image can share only a C-ABI symbol, not a Rust path. The census behind the "41" is not repeated here; the per-name claims above are what was checked. Follow-up at fefcfe90: removed 13 additional private linker names covering Vulkan capture, DLSS preset reads, Steam D3D11 preparation, and the Minecraft fixture observer. Godot Vulkan now uses the public Runtime host API. Godot D3D12 still calls six readback entries across separately linked archives, and actual native, MASM, fixture, and dynamic callers retain their symbols. +- [ ] **S3.1 + S2.3 mechanism 3 Versioned in-crate function-pointer "platform"/"leaves" tables.** 280 `struct *Platform|Leaves|Ops|Calls|Services|Native` definitions exist in production code; many carry `struct_size`/`version`, an `AtomicPtr` publish step and a validation function although the only production binding is a `static` of Rust functions in the same crate. Keep: direct calls; where a test needs a seam, a `#[cfg(test)]` module swap, the `impl_host_methods!` pattern (`render_host.rs:122-130`, `callback_host.rs:81-89`, `render_host_methods.rs`) or a generic parameter, never a versioned runtime table; versioning only on tables an external host fills. Version constants to remove: `fsr3/owner.rs:36,41` (`PLATFORM_ABI_VERSION`, `FG_PLATFORM_ABI_VERSION`), `fsr4/owner.rs:38`, `xess-fg/session_records_abi.rs:5` (`RSF_XESS_BRIDGE_PLATFORM_ABI_VERSION = 8`), `runtime/backends/fsr/compat/src/abi.rs:5`, skyrim `LEAVES_VERSION = 4`/`PLATFORM_VERSION = 4`, rdr2 `PLATFORM_VERSION = 2`, anomaly `PLATFORM_ABI = 13`, godot `PLATFORM_VERSION = 9`. Per-owner entries: OC-C1, OC-C2, OV-A2..A5, S2.3 + OV-C2, GO-A1..A5, GM-G1.1 to G1.3 (anomaly), GM-G5 (ac7). Estimated several thousand lines across games. Confidence: h. **Status (round 4, constraint annotations only):** the version constants this entry lists are gone; the one survivor, `RSF_SKYRIM_CREATION_PLATFORM_VERSION` (`games/skyrim-se/src/native_creation_platform.h:17`), versions a table C fills (`native_creation.c:36`), which the Keep allows. The per-owner entries (OC-C1, OC-C2, OV-A1 to OV-A5, S2.3 + OV-C2, GO-A1 to GO-A5, GM-G1.1 to G1.3, GM-G5) are closed; S1.1 holds only constraint annotations. The unversioned tables that remain have an external filler (C leaves such as the Anomaly SR stage's `games/anomaly/src/sr_stage_platform.c`, which `sr_stage/native.rs` calls by name and whose detour trampolines call back into the Rust stage (`sr_stage_platform.h:161`); `sr_stage.rs` itself keeps only a `bound` flag; vendor SDK entries) or are the seam a unit test or ctest fixture fills with CPU doubles (`vulkan_latency.rs:63` `Platform`, filled by the ctest fixture `tests/game-sdk/src/vk_latency.rs:204,212` from a separate archive, so a `cfg(test)` swap cannot reach it; `vulkan_sr/xess.rs:73` `XessOps`; `vulkan_dx12_fg.rs:231,425` `GraphicsOps`/`InteropOps`, which `vulkan_fsr4_fg.rs` uses; `vulkan_dlss_fg_abi.rs:66` `Platform`; `dlss_vulkan_capture.rs:52` `Platform`, with the production `LEAVES` at `dlss_vulkan_capture/leaves.rs:441` and a unit-test table at `owner_tests.rs:249`). `d3d12_generation/xess.rs` and `vulkan_sharpening.rs` no longer hold such a table; none carries a version, `struct_size` or publish step. **Round 5:** the `impl_host_methods!` pattern is gone (one leaf list in `render_host_native.rs`); the runtime, loader and overlay tables are resolved or annotated in "Round 5: runtime, loader, sdk/game and ui/overlay". +- [x] **S1 mechanism 4 + S1.5 + RS-B3 Cross-crate `#[path]` inclusion instead of dependencies.** About 230 `#[path = "..."]` lines pull source files from other crates or from `tests/`; some files end up compiled twice in one crate (forcing `allow(dead_code)` and duplicate types), and `runtime/common` has no rlib. Keep: path dependencies on owning crates (`rlib` + `staticlib` where a staticlib is also needed). Where: see OV-C1, OV-D1, RS-B3, GO-D1 and these: `overlay_saved_abi.rs` from `runtime/orchestrator/src/` into `games/unity-mono/src/runtime_setup.rs:71`, `games/rdr2/src/runtime_worker.rs:38`, `games/anomaly/src/overlay.rs:28`; `integrations/vulkanstory/native/fsr3.rs` and `ngx.rs` into `runtime/vulkan/fsr3/owner.rs:31` and `runtime/vulkan/ngx/src/lib.rs:6` (inverts the Rule 1 dependency); `shared_surface_abi.rs` in unity-mono repeats all 5 records of `tests/presentation/src/shared_surface_abi.rs`. Confidence: h. **Reconciled against the tree:** `#[path]` lines fell from about 230 to 101 in `*.rs`, 22 of them crossing a crate boundary; the `overlay_saved_abi.rs` includes, the `shared_surface_abi.rs` copy and the VulkanStory `fsr3.rs`/`ngx.rs` includes are gone. Kept: `integrations/godot/native/vulkan/native.rs:24` (Godot's link seam for `vulkan_sr_session/linked.rs`) and the `tests/` fixture files included into production crates behind `test-fixtures`/`warp-fixture` (`runtime/orchestrator/src/lib.rs:115`, `auxiliary_sr.rs:3`, `games/ac7/src/lib.rs:56-65`, `games/anomaly/src/lib.rs:79`; X2/X3). Unfinished: `runtime/diagnostic_preferences.rs` is path-included by `runtime/orchestrator/src/lib.rs:147` and `runtime/vulkan/xess-fg/capture.rs:136` (and itself includes `sdk/game/src/profile_text.rs`), and `runtime/orchestrator/src/lib.rs:310` includes `runtime/vulkan/fsr3/sdk_abi.rs` although `rsf-vk-fsr3` is a Cargo package: make both dependencies. **Round 3 (r3-orchestrator):** `runtime/diagnostic_preferences.rs` is now `rsf_game_sys::diagnostic_preferences` (both users depend on rsf-game-sys, which owns `profile_text`); the two `#[path]` includes and its second `profile_text` copy are gone. Not taken here: the `runtime/vulkan/fsr3/sdk_abi.rs` include in `runtime/orchestrator/src/lib.rs` (Vulkan area). **Done (round 3, Vulkan C):** `rsf-vk-fsr3` is also an rlib and owns `pub mod sdk_abi`, which the orchestrator (`ffx_vk_abi`) and `tests/vulkan-fg` (`ffx` feature) import as a dependency instead of the two `#[path]` includes. The remaining cross-crate `#[path]` lines are the kept Godot seam and the `test-fixtures` includes named above. +- [x] **S5 Generate bindings at build time per owner instead of committing every consumer's copy.** After the owner-crate step, `bindgen = "=0.72.1"` as a `[build-dependencies]` entry in each owning `-sys` crate (one `build.rs` each; `runtime/orchestrator/build.rs` already runs `cc` and CMake). Keep: committed bindings (or provision pinned vendor headers first, as `orchestrator/build.rs` does for yyjson through `yyjson.cmake`) for vendor SDK headers in the gitignored `/vendor/` (FidelityFX `fsr3/fsr4/fsr4-fg/d3d12_*/fsr_abi.rs`, XeSS `*/xess_abi.rs` and `vulkan_sr/xess_sdk_abi.rs`, NVAPI `reflex_nvapi_abi.rs`, Godot Vulkan headers `creation/abi.rs`), with a `--check` regeneration in CI. libclang is needed at build time: `bindgen.exe` 0.72.1 is at `C:\Users\N1GHT\.cargo\bin\bindgen.exe` but no `libclang.dll`, `C:\Program Files\LLVM` or VS `VC\Tools\Llvm` was found; GitHub's `windows-2022` image normally ships LLVM, pin `LIBCLANG_PATH` in `verify.yml` rather than assume. Depends on D26. Confidence: m. **Done (tree check, D26):** the in-repo headers are generated at build time by each owner's `build.rs` (see the first S1 mechanism 1 entry), `.github/workflows/verify.yml:23-30` installs the pinned LLVM 22.1.8 and sets `LIBCLANG_PATH`, and `tools/bindgen/src/lib.rs` names the same pin. Kept: the vendor-header outputs stay committed (`runtime/orchestrator/src/reflex_nvapi_abi.rs`, `d3d12_sr/xess_abi.rs`, `d3d12_generation/fsr_abi.rs`, `vulkan_sr/xess_sdk_abi.rs`, `runtime/vulkan/fsr3/sdk_abi.rs`, `runtime/vulkan/xess-fg/{bridge,sdk,session_records}_abi.rs`, `runtime/backends/fsr/compat/src/ffx_abi.rs`) because their generators need the gitignored SDK checkouts (`tools/generate-d3d12-vendor-bindings.py`, `runtime/vulkan/fsr3/generate-bindings.py`) and run by hand; `eng/verify.ps1:34-36` runs `tools/generate-rust-bindings.py --check` where `bindgen-cli` exists. +- [x] **S1.8 + S3.3 + S4 + GO-B3 + OV-I2 + RS-F MinHook declared again in many modules.** `MH_Initialize`/`MH_CreateHook`/`MH_EnableHook` are re-declared where `integrations/windows/src/minhook.rs:12-71` already wraps them (`initialize`, `create`, `queue`, `apply`, `enable_idempotent`, `disable`, `remove_idempotent`); skyrim and steam use it. Keep: `rsf_windows::minhook` (make `enable` and `remove` `pub`, add rdr2's `MH_StatusToString` at `rdr2 platform.rs:48`), moved into `runtime/common` if the runtime must not depend on `integrations/`; delete Wingman's C `create/enable/disable` helpers. Link order holds (fallout4's CMake links `minhook` into the same DLL). Where: orchestrator `d3d11_observer_hooks/route.rs:40`, `d3d12_observer.rs:22`, `overlay_input.rs:341` (`minhook::PLATFORM`, `:340`), `reflex_audit.rs:59`, `shader_patch/platform.rs:28`; `games/ac7/src/native_renderer/leaves.rs:40`; `games/fallout4/src/lib.rs:87-92` (5 externs) and `:80-86` (3 status constants); `games/rdr2/src/platform.rs:36-60` (8 externs, test stub `:56`, `asi.rs:25-26` `MH_OK`, `MH_ERROR_ALREADY_INITIALIZED`; `rdr2/Cargo.toml:23` already depends on `rsf-windows`); `games/project-wingman/src/native_platform.c:38-60`; `runtime/backends/fsr/compat/src/native.rs:17-22`; `tools/exposure_probe/src/ngx.rs:23`; `tests/overlay/src/hotkey.rs:36`; `runtime/vulkan/fsr4/build.ps1:57-67` compiles MinHook by hand with gcc. The Anomaly and AC7 hook-batch duplication is GM-G8.1. About 150 lines plus the Wingman C helpers. Confidence: h. Partial (reduce-rb-games): RDR2 uses `rsf-minhook-sys`, Wingman `rsf_windows::minhook` (its C helpers deleted). Left: AC7 (GM-G5/G8.1), anomaly C wrappers (GM-G8.1), FSR compat and tool copies. Orchestrator part done: the declarations are in `rsf-minhook-sys` (build fix), which now also carries the `MH_STATUS` values; `route.rs`, `d3d12_observer.rs`, `overlay_input.rs`, `reflex_audit.rs` and `shader_patch/platform.rs` import them instead of keeping local copies. Other crates (`integrations/windows/src/minhook.rs`, ac7, fallout4, rdr2, fsr compat) still declare their own status constants (item-3 fixes: `integrations/windows` and the FSR compat now import them from `rsf-minhook-sys`). **Done (tree check):** no Rust file declares `MH_Initialize`/`MH_CreateHook`/`MH_EnableHook` any more; the one declaration is `third_party/minhook/src/lib.rs:29-37` (`rsf-minhook-sys`), used by `integrations/windows`, orchestrator, ac7, fallout4, rdr2, fsr compat, overlay tests and the exposure probe. Kept: the C MinHook callers `loader/census/src/census_platform.c:62-74` (the census table keeps `rsf_loader_rust` free of `MH_*` for the thin, shim and plugin carriers, RS-A4), `games/ac7/src/ac7_hooks.c:7-22` and `games/anomaly/src/native_hooks_platform.c` (GM-G8.1) and `tests/anomaly_overlay_hooks.c:32-42`; `runtime/vulkan/fsr4/build.ps1:57-67` is the VulkanStory host's standalone build. +- [x] **RS-B1 + GO-B4 + OV-H3 + S4 SHA-256 implemented in many places.** File hashing via BCrypt: `integrations/windows/src/digest.rs:24-56` (`sha256_file -> [u8;32]`, used by unity-mono, skyrim-se, steam), `runtime/common/src/lib.rs:36-136` (`hash_file`, exports `rsf_common_sha256_file` and `rsf_common_sha256_file_hex`; callers `runtime/vulkan/xess-fg/bridge.c:662`, `games/rdr2/src/attach_entry.c:10`, `asi_entry.c:13`, `runtime/orchestrator/src/input_dump.c:14`, `loader/proxy/src/dinput8_proxy.c:54`, `runtime/backends/fsr/compat/src/fingerprint.rs:16,52`, `games/fallout4/src/creation.rs:168-186`; `_hex` has one caller via its own `extern`), `loader/src/windows/plugin.rs:82-134` (`Algorithm`, `Hash` guards, `digest()` hex), `games/project-wingman/src/windows.rs:30-77` (48-line BCrypt copy, `fingerprint -> [u8;65]`), `games/skyrim-se/src/platform.rs:214-225` (`hex_sha256`), `games/anomaly/src/digest.rs:50` and `games/ac7/src/contact_shadow.rs:73-118` (GM-G8.3), `games/unity-mono/src/bridge_native.rs:417-432` (compares raw bytes). Other implementations: `loader/src/diagnostics/sha256.rs` (74 lines, hand FIPS 180-4, for byte slices, used by `image.rs`, `sidecar.rs`, `sections_abi.rs`), `lifecycle/src/win32/verified.rs:7-9,86-100` (legacy CryptoAPI `CryptCreateHash`), `runtime/orchestrator/src/mfg_midpoint.rs:292-320` (`BCryptHash`). Keep: `rsf_windows::sha256_file` plus one `sha256_hex` (and `sha256` over bytes and over a handle, since `verified.rs` must hash what it loads) next to it; the C callers keep one exported symbol; `loader` and `runtime/common` depend on `rsf-windows` (an rlib). Loader's byte-slice hasher: use BCrypt one-shot over memory, or keep it only if the loader must avoid BCrypt (no reason found). Confidence: h (file hashing), m (`diagnostics/sha256.rs`). **Done (tree check):** Wingman, anomaly, AC7 and the loader's software SHA-256 are gone; `rsf_windows::{sha256_file, sha256_file_hex, sha256_hex}` (`integrations/windows/src/digest.rs:24-85`) serve Skyrim (`games/skyrim-se/src/platform.rs:108`), the loader (`loader/src/diagnostics/image.rs:333`), unity-mono and Steam. Kept: `runtime/common/src/lib.rs:44` `hash_file` because both it and `rsf-windows` are staticlibs that C carriers and the Runtime link (an `rsf-windows` dependency risks duplicate symbols; its C callers are `runtime/vulkan/xess-fg/bridge.c`, `games/rdr2/src/attach_entry.c`, `loader/proxy/src/dinput8_proxy.c`); `runtime/vulkan/streamline/lifecycle/src/admission.rs:500` CryptoAPI because it hashes the module through the handle it then loads; `runtime/orchestrator/src/mfg_midpoint.rs:293-320` because `runtime/orchestrator/Cargo.toml` has no `rsf-windows` dependency (same duplicate-symbol reason). +- [x] **S3.3 + S6 + GO-B5 Guarded process-memory read: six Rust and several C implementations.** Keep: one C SEH leaf plus a Rust wrapper in `rsf_windows` or `runtime/common`, with `sdk/game/src/win32.rs` gaining `read_bytes(address, &mut [u8]) -> bool` and a typed `read`; Skyrim's C leaf stays only if the ctest needs a C pointer for `rsf_skyrim_input_fixture`. Where: `games/ac7/src/ac7_memory.c:28`, `games/skyrim-se/src/guarded_read.c:9-24` (also linked into the ctest, `tests/CMakeLists.txt:414`), `loader/census/src/guarded_platform.c:8,18,36` (plus cstr/wstr variants), `loader/src/diagnostics/memory.rs:102`, `runtime/orchestrator/src/mfg_midpoint.rs:334` (`read_guarded`), `games/fallout4/src/lib.rs:264,284` (typed `read`, `matches_bytes`; `:105-115` owns the `Plain` marker trait), `games/project-wingman/src/windows.rs:79-90`, `games/rdr2/src/native_platform.rs:68-75`, `games/skyrim-se/src/compatibility/initializer.rs:62`, `integrations/steam/src/lib.rs:160`, anomaly `native_memory.h` (GM-G8.2). About 100 lines. Confidence: h. Partial (reduce-rb-games): `rsf_game_sys::win32::{read_process, Plain, read}` replaces the Fallout 4, RDR2, Wingman and Skyrim-compatibility copies. Left: loader, orchestrator `mfg_midpoint`, Steam, AC7 and anomaly; Skyrim's C leaf stays (the input fixture passes it to C). Steam is done too. Kept: `loader/src/diagnostics/memory.rs` `read` returns partial copies across region boundaries (a different contract), and the census C reads stay C for their C callers. **Reconciled against the tree:** Fallout 4, RDR2, Wingman, Skyrim and Steam use `rsf_game_sys::win32::{read_process, read, Plain}` (`sdk/game/src/win32.rs:78`). Unfinished: direct `ReadProcessMemory` copies remain in `runtime/orchestrator/src/mfg_midpoint.rs:335`, `mfg_state.rs:127`, `d3d11_observer_hooks/route.rs:165` and `loader/src/census/static_scan.rs:123`; the orchestrator and loader already depend on rsf-game-sys. Kept: `loader/src/diagnostics/memory.rs:102` (returns partial copies across region boundaries), the census C reads `loader/census/src/guarded_platform.c:8,18,36` (called from C through `census_platform.c:141-144`), and the anomaly and AC7 C copies (GM-G8.2). **Round 3 (r3-orchestrator):** `mfg_midpoint.rs`, `mfg_state.rs`, `d3d11_observer_hooks/route.rs` and `loader/src/census/static_scan.rs` use `rsf_game_sys::win32::{read_process, read, read_bytes}`; `read_bytes(address, &mut [u8]) -> bool` is new in `sdk/game/src/win32.rs`. +- [x] **S3.3 + GO-B6 Host-log text leaf: 12 copies of "format, make a `CString`, call `host.log`", plus the guard leaves.** Keep: `rsf_game_sys::host_log(&rsf_game_host_services, &str)` once, calling through the shared guard; decide NUL handling once (`fallout4/src/lib.rs:226-232` strips NULs, `skyrim-se/src/session.rs:241-247` drops the message). Where: `games/fallout4/src/lib.rs:98-121,144-159` (`Ops::log`, `rsf_fallout4_native_log`), `fallout4/src/cpu_events.rs:211`, `skyrim-se/src/session.rs:233-248,256` (`log_text`, also `platform.rs:337`), `skyrim-se/src/cpu_events.rs:115`, `skyrim-se/src/observers.rs:114`, `rdr2/src/host.rs:41`, `rdr2/src/engine_settings.rs:165`, `rdr2/src/asi.rs:578`, `unity-mono/src/bridge_d3d11.rs:266`, `bridge_d3d12.rs:58,149`, `vulkan_bridge.rs:59`, `unity-mono/src/package_state/services.rs:255`, `project-wingman/src/observer.rs:475`, `integrations/steam/src/lib.rs:456,467`; C leaves `games/skyrim-se/src/render_detours.c:31`, `integrations/steam/src/exception_guards.c:42`, `integrations/unity/native/vulkan_bridge.c:147`; anomaly's own log leaves and wrappers are GM-G8.2. About 120 lines. Confidence: h. Done (reduce-rb-games) outside Anomaly/AC7: `rsf_game_sys::host_log`/`log_guarded` over `rsf_game_log_guarded` (NULs dropped); the Skyrim, Fallout 4, Wingman, Steam and Unity C log guards are deleted, and the unguarded Rust calls in RDR2, the Unity bridges and Unity Mono are guarded. +- [x] **S1.9 + S3.3 + S6 + S7.2 + RS-B4 Wide-string helpers outside the orchestrator, copied per crate.** `encode_utf16().chain(Some(0))` and ASCII-wide literals. Keep: `windows::core::HSTRING`/`w!` or one helper in `sdk/game` (`ffi_util.rs:18` `ascii_wide`, `win32.rs`). Where: `games/rdr2/src/asi.rs:249`, `games/skyrim-se/src/platform.rs:205`, `games/unity-mono/src/runtime_config.rs:178`, `games/anomaly/src/motion/stage.rs:134`, suffix variants `games/fallout4/src/session.rs:77` and `games/skyrim-se/src/session.rs:338`; `loader/src/windows.rs:17,21` `wide` copied in `tests/loader/src/windows.rs:35`; `loader/src/windows/shim.rs:162-170` `wide_literal`; tests: `tests/ac7_session.rs:145`, `tests/game-sdk/src/lib.rs:87`, `runtime/orchestrator/src/callback_host/tests.rs:366`, `runtime/vulkan/streamline/lifecycle/src/lifecycle/tests.rs:132`, `games/anomaly/src/sr_stage/tests.rs:634`, `games/unity-mono/src/package_state.rs:2318`. The orchestrator's own copies are in OC-E4. Confidence: h. **Done (rounds 1 to 4):** every `&str` copy listed here builds its string with `rsf_game_sys::ffi_util::{wide, wide_path}` (`sdk/game/src/ffi_util.rs`): RDR2, Skyrim and Fallout 4 (round 1); `integrations/godot/native/vulkan/native.rs`, `games/minecraft/native/jni.rs`, `runtime/shader_patch/compiler`, `runtime/graphics/rust/src/texture_dump/wic.rs`, `runtime/backends/fsr/compat/src/vulkan_bridge.rs`, `games/rdr2/src/camera_probe.rs`, `runtime/vulkan/streamline/lifecycle/src/admission.rs`, `games/anomaly/src/ini.rs` and its fixtures (round 3); `lifecycle/tests.rs` (item-3 fixes); `tests/overlay-service/src/lib.rs`, `tests/vulkan-fg/src/xess_interop.rs`, `tests/game-sdk/src/render_host_fixtures.rs` and `d3d12_generation/xell_fixture.rs` (round 4). Kept by this entry's rule, not open: the `OsStr` path encoders (`encode_wide().chain([0])`), which carry non-UTF-8 path units the `&str` helper cannot: `loader/src/windows.rs:21`, `tests/loader/src/windows.rs:30`, `sdk/game/src/diagnostic_preferences.rs:35` (its section and key already use `wide`) and the path field of `tests/overlay-service/src/lib.rs`. +- [x] **S1.7 + S3.3 Matrix inverse and 4x4 helpers copied.** `runtime/orchestrator/src/dlss_native12/xm.rs` (222 lines) and `games/fallout4/src/camera/xm.rs` (213) are the same bit-exact `XMMatrixInverse` transcription (`dlss_native12/xm.rs:11-12`: "a fix to either copy belongs in both"); `streamline_sdk.rs:379` `full_invert` is a third. "f32 to f64, `inverse_4x4`, reject non-finite" is repeated in `games/skyrim-se/src/camera.rs:47`, `games/project-wingman/src/camera.rs:41`, `games/ac7/src/view.rs:111`; `multiply_4x4` repeated in `skyrim-se/src/camera.rs:34` and `games/anomaly/src/camera.rs:108`. Keep: one `xm` module and `camera_math::inverse_4x4_f32` in `sdk/game/src/camera_math.rs`, which both crates already depend on. About 230 lines. Confidence: h. Partial (reduce-rb-games): one `rsf_game_sys::xm` (Fallout 4 copy) serves Fallout 4, the SR gate and the Vulkan Streamline camera; both old copies deleted. Left: `streamline_sdk.rs` `full_invert`, and the f32 inverse/multiply wrappers, which differ in their finiteness checks and accumulation width (sharing them changes results). **Done (tree check):** `sdk/game/src/xm.rs` is the one `XMMatrixInverse` transcription and `sdk/game/src/camera_math.rs:8-66` holds `multiply_4x4` and `inverse_4x4`; the two old copies are gone. Kept: `runtime/orchestrator/src/streamline_sdk.rs:346` `full_invert` (f32; its test `:428` compares it with the SDK helper) and the per-game f32 wrappers, because their finiteness checks and accumulation width differ and sharing them changes results. +- [x] **S3.3 + GO-B2 Plugin-entry boilerplate re-implemented in seven `lib.rs` files.** `detect()` with probe size check, exact-build `recognized()`, `rsf_game_plugin_api` size/ABI check and fill, lifecycle shells (`prepare`, `start`, `quiesce`, `stop`, `status`), and locally declared `RSF_OK`/`RSF_ERROR_*`/`RSF_DETECTION_*` constants (about 55 lines; `game_api.h:16-21` defines them as cast macros bindgen drops). `call_header::validate` (`sdk/game/src/call_header.rs:13`) has 3 users while 63 production files hand-roll `cast::().read() < size_of`. Keep: in `sdk/game`: `pub const RSF_OK`, `RSF_ERROR_*`, `RSF_DETECTION_*`; `call_header::validate` as the only validator; `session::Probe::detect(executable, sha256, machine)`; `publish_api(requested, out, info, detect, hooks)`; each adapter supplies identity strings and its five hooks (Rule 1 holds). Where: `call_header::validate` re-implemented in `games/rdr2/src/lib.rs:63`, `skyrim-se/src/session.rs:793`, `project-wingman/src/observer.rs:153`, variant `anomaly/src/native_observer.rs:578`; `Probe::from_raw` re-implemented in `skyrim-se/src/plugin.rs:75-107`, `fallout4/src/lib.rs:312-340`, `unity-mono/src/lib.rs:73-95`; executable-leaf comparison in `skyrim-se/src/plugin.rs:25-35`, `project-wingman/src/windows.rs:18-27`, `rdr2/src/asi.rs:264`; api fill in `rdr2/src/lib.rs:131-178`, `skyrim-se/src/plugin.rs:87,119-150`, `project-wingman/src/lib.rs:31,36-77`, `fallout4/src/lib.rs:324,344-380`, `unity-mono/src/lib.rs:73-140`, `ac7/src/lib.rs:97,107-112,185-216`, `anomaly/src/plugin_entry.rs:15`; lifecycle shells in `rdr2/src/lib.rs:78-122`, `wingman/src/observer.rs:170-275`, `skyrim-se/src/session.rs:810-870`, `fallout4/src/session.rs`, `unity-mono/src/lifecycle.rs`; constants in `fallout4/src/lib.rs:57-63`, `rdr2/src/lib.rs:46-52`, `rdr2/src/capture_state/{hooks,recordings,layout}.rs`, `skyrim-se/src/{plugin.rs:14-16,session.rs:29-32,creation.rs:18}`, `wingman/src/lib.rs:21-25`, `observer.rs:15-18`, `unity-mono/src/{lifecycle.rs:23-25,lib.rs,runtime_setup.rs}`, `integrations/steam/src/lib.rs:44`. About 400 lines (27 non-trivial lines appear in at least four of seven files). Confidence: h. Partial (reduce-rb-games): `rsf_game_sys` defines `RSF_OK`, `RSF_ERROR_*`, `RSF_GAME_UNKNOWN/RECOGNIZED`; RDR2, Skyrim, Wingman, Fallout 4 and unity-mono import them and the first four use `call_header::validate`. Left: AC7 and anomaly, and the `Probe::detect`/`publish_api` helpers. **Reconciled against the tree:** `RSF_OK`, `RSF_ERROR_*` and `RSF_GAME_*` are in `sdk/game/src/lib.rs:18-23`, and RDR2, Skyrim, Wingman, Fallout 4 and unity-mono use them and `call_header::validate`. Unfinished: `Probe::detect` and `publish_api` do not exist in `sdk/game/src/session.rs`; the detect, api-fill and lifecycle shells are still per crate in `games/rdr2/src/lib.rs`, `games/skyrim-se/src/plugin.rs`, `games/project-wingman/src/lib.rs`, `games/fallout4/src/lib.rs`, `games/unity-mono/src/lib.rs`, `games/ac7/plugin/src/lib.rs` and `games/anomaly/src/plugin_entry.rs`, and AC7 and anomaly still hand-roll the probe checks (`games/anomaly/src/native_observer.rs:575-591`). **Done (round 3):** `rsf_game_sys::session::Probe::detect(raw, recognizes)` (size and null checks, AMD64, then the adapter's build predicate) and `session::publish_api(requested, out, info, detect, hooks)` (table size, ABI version, fill) exist in `sdk/game/src/session.rs`; RDR2, Skyrim, Wingman, Fallout 4, unity-mono, AC7 (`games/ac7/plugin/src/lib.rs`) and Anomaly (`games/anomaly/src/plugin_entry.rs`) pass their identity strings, build and five hooks and lost their own `detect` bodies, API fills, `AMD64`/`RECOGNIZED`/`UNKNOWN` constants and AC7's `recognized`/`text`. Kept: the per-game `prepare`/`start`/`quiesce`/`stop`/`status` shells, because each validates its own record and calls game-specific code (RDR2 `renderer::*`, AC7 `Lifecycle`, Anomaly `rsf_anomaly_observer_*` with its platform table, Skyrim `session::*`); a generic shell would be a closure table, not less code. Left: `games/anomaly/src/native_observer.rs:575-591` keeps a local `validate` because its last caller (`:650`) checks `RSF_ANOMALY_OBSERVATION_ABI`, not the GameSDK version; it needs an ABI-parameterised `call_header` function and belongs to the Anomaly worker. **Round 3 (r3-anomaly):** the Anomaly observer's local `validate` is gone: `call_header::validate_abi(value, abi)` takes the version, `validate` calls it with `RSF_GAME_ABI_VERSION`, and `rsf_anomaly_observation` uses `validate_abi(out, RSF_ANOMALY_OBSERVATION_ABI)`. +- [x] **GO-B1 + OV-E2 Foreign-exception guard written about 78 times.** The `0xE06D7363` C++-exception filter is defined at least 9 to 25 times (repo-wide `rg 0xE06D7363` gives 25 files) with the same macros (`RSF_FALLOUT4_TRY`, `RSF_FOREIGN_TRY`, `RSF_SCOPE_TRY`) and the same "call a pointer under a filter, report failure" thunk; the semantics already differ (X13). About half of the 78 `__try` blocks are genuine detour shells (return-address capture, `__try/__finally`) and stay. `__try` counts: fallout4 44 (`render_hooks.c` 16, `cpu_events.c` 11, `host_boundary.c` 6, `native_guard.h` 5, `render_inputs.c`, `resolution.c`, `screen.c`), skyrim 18 (`render_detours.c` 9, `native_creation.c` 3, `cpu_events.c` 3, `compatibility.c` 2, `guarded_read.c`), wingman 4, steam 2, unity `vulkan_bridge.c` 10, rdr2 2. The same callee is wrapped twice: fallout4 `host_boundary.c:22-30` and skyrim `render_detours.c:136,147` (`rsf_d3d11_host_create`/`set_active`); fallout4 `host_boundary.c:32-56` and skyrim `native_creation.c:65-90` (`creation_begin`/`creation_end`). Keep: `runtime/vulkan/streamline/sdk_guard.c:21-28` `rsf_slvk_guarded(call, user, thrown)` renamed `rsf_cxx_guarded`, compiled once in `runtime/common`, with `sdk/game/include/rescaleframe/foreign_guard.h` (macros and filter) and a Rust wrapper `rsf_game_sys::foreign_call(|| ...) -> Option`; each conversion keeps its per-call failure code as `thrown`. Needs a reentrancy check where the callee re-enters Rust and a runtime exception test (the `plugin_contract` ctests exercise load only). Where: filters at `games/fallout4/src/native_guard.h:21-26`, `games/project-wingman/src/native_platform.c:34-36`, `integrations/steam/src/exception_guards.c:17,28`, `integrations/unity/native/vulkan_bridge.c:4,18`, `games/ac7/src/render_scope_entry.c:17`, `games/ac7/src/native_renderer_platform.c:44`, `runtime/orchestrator/src/d3d11_host_foreign.c:20`, `runtime/vulkan/streamline/sdk_guard.c:25`, `tests/d3d11_host_device_launch.h:22`, `tests/ac7_render_scope.c:12`, `runtime/orchestrator/src/native_latency_streamline_exceptions.c:10-27`, `native_fg_vulkan.c:21-31,39-55`, `native_sr_fsr4_vulkan.c:16-24`, `native_sr_vulkan.c:43-45`; anomaly's three guarded-log leaves (GM-G8.2); thunks `fallout4/src/host_boundary.c:11-56`, wingman `guarded_log`, steam `rsf_steam_dispatch_guard`/`log_guard`, unity thunks. Also OV-C1 removes the second compile of `sdk_guard.c`. About 600 to 900 lines. Confidence: h (shared header, filter, dedupe), m (generic closure thunk). Partial (reduce-rb-games): one header, `sdk/game/include/rescaleframe/foreign_guard.h` (RSF_FOREIGN_TRY/CATCH/FINALLY, RSF_FAULT_CATCH, `rsf_foreign_call`, the compiled `rsf_game_log_guarded`), now serves Fallout 4, Skyrim, RDR2, Wingman, Steam, the Unity bridge, the loader census, the Runtime's plugin callbacks, render-host interface call, FFX/FSR4/Vulkan SR leaves, graphics observer and frame-tap guards, the presentation bridge, and the RDR2, plugin-session and presentation test leaves. Left: games/anomaly and games/ac7 with their tests (their worker), and the files other workers were editing (d3d11_host*, sr12, sr_bridge, gl_*, frame_capture12, streamline_*, dlss_*). Kept: the six Fallout 4 host/creation thunks and `Threw`, because a generic guard over a Rust closure would unwind through Rust frames (D33 needs a throwing fixture first). **Reconciled against the tree:** `0xE06D7363` is defined in 17 files (was 25), and only four still spell the filter as code. The shared `sdk/game/include/rescaleframe/foreign_guard.h` serves 29 C and header files and the compiled `sdk/game/src/foreign_guard.c`. Unfinished: `runtime/vulkan/streamline/sdk_guard.c:20` and `runtime/orchestrator/src/d3d11_host_foreign.c:20` (own `RSF_CXX_EXCEPTION_CODE`) should use the shared header; test copies `tests/ac7_render_scope.c:12` and `tests/d3d11_host_device_launch.h:22`. Kept: the single compiled `rsf_cxx_guarded` plus a Rust `foreign_call(|| ...)` wrapper and the six Fallout 4 host/creation thunks with `Threw` (`games/fallout4/src/host_boundary.c`), because a generic guard over a Rust closure would unwind through Rust frames (D33 needs a throwing fixture first). **Round 3 (r3-tests):** `tests/d3d11_host_device_launch.h:22` and `tests/ac7_render_scope.c:12` use `rescaleframe/foreign_guard.h` (`RSF_CXX_EXCEPTION_CODE`, `RSF_FOREIGN_TRY`, `RSF_FOREIGN_CATCH { ... }`); the 16 handler sites in `d3d11_host_rendered_fg_device.c` and `d3d11_host_shared_sr_device.c` take the braces form. **Round 3 (r3-orchestrator):** `runtime/vulkan/streamline/sdk_guard.c` and `runtime/orchestrator/src/d3d11_host_foreign.c` include `rescaleframe/foreign_guard.h` (the rsf-streamline-vk build adds `sdk/game/include`); their private filters and the MinGW copy of `rsf_slvk_guarded` are gone. +- [x] **S3.4 + GO-D2 + BT-07 (winapi part) Three Win32 binding crates: Skyrim uses `winapi`.** `games/skyrim-se/Cargo.toml:20,24` (`winapi = "=0.3.9"`, also pulling two `winapi-*-gnu` stubs into `Cargo.lock`) with about 25 `use winapi::` lines in 11 files next to `windows-sys`; every other crate uses `windows` or `windows-sys` (`QueryPerformanceCounter` already exists there). Keep: `windows`/`windows-sys`; this also makes `render_native.rs:72` `ComRef` unnecessary if the `windows` interfaces are used. Where: `games/skyrim-se/src/platform.rs:82-86`, `auxiliary.rs:19`, `presentation.rs:18`, `render_native.rs:7-12`, `render_inputs.rs:20-22`, `cpu_hooks.rs:14`. Confidence: h. Done (reduce-rb-games): Skyrim COM uses the `windows` interfaces (ComRef deleted), Win32 calls `windows-sys`; `winapi` is gone from Cargo.lock. +- [x] **S8 Traits and wrappers with one production impl.** 16 traits exist, 7 with exactly one production impl; the dominant indirection is fn-pointer tables, not traits. Delete outright (no test impl either): `games/anomaly/src/sr_stage.rs:97` `Refused`, `runtime/orchestrator/src/frame_capture_vk.rs:169` `WideLength`. Keep the next five only if a test cannot use a cfg swap: `games/ac7/src/lifecycle.rs:37` `Leaves` (implemented by `games/ac7/src/lib.rs:147` `Ops`, a forwarder where every method snapshots and calls `renderer::rsf_ac7_renderer_*`, `lib.rs:147-183`; see GM-G5), `games/ac7/src/renderer.rs:46` `Native`, `games/ac7/src/truesky.rs:125` `Plugin`, `runtime/orchestrator/src/d3d11_host_reduced.rs:23` `Products`, `runtime/vulkan/streamline/lifecycle/src/lifecycle.rs:82` `System`. Keep: direct calls. Confidence: h (first two), m (rest). Orchestrator part: `WideLength` is a plain function now. `Products` stays: `FakeProducts` in `d3d11_host_tests.rs` is a second implementation the host tests supply through their `native::auxiliary_products` fake. **Done (tree check):** `WideLength` is a plain function. Kept, each because a test implements the trait with a fake: `games/anomaly/src/sr_stage.rs:98` `Refused` (stage tests, GM-G1.1), `games/ac7/plugin/src/lifecycle.rs:34` `Leaves` (`lifecycle/tests.rs`), `renderer.rs:47` `Native` (`renderer/tests.rs`), `truesky.rs:124` `Plugin` (`truesky/tests.rs`), `runtime/orchestrator/src/d3d11_host_reduced.rs:18` `Products` (`FakeProducts` in `d3d11_host_tests.rs`) and `runtime/vulkan/streamline/lifecycle/src/lifecycle.rs:83` `System`. +- [x] **S-dead3 Public items with no caller or only test callers.** The scan (`dead3.py`, gitignored) found 122 items. DEAD (no reference at all): `games/anomaly/src/motion/foliage.rs:236` `rsf_anomaly_foliage_begin`; `games/fallout4/src/render_inputs.rs:1445` `rsf_fallout4_inputs_verify`; 20 `games/anomaly/src/sr_profile.rs` consts (`SITE_RM_FAR` :19, `SITE_SET_V` :21, `SITE_SURFACE_SET` :22, `SITE_SET_MAX_ANISOTROPY` :24, `SITE_BACKEND_INVALIDATE` :25, `SITE_U_SETRT_WH` :26, `RM_FAR_SLOT` :32, `RM_NORMAL_SLOT` :33, `MRTMIXDEPTH_BIT` :35, `FP16_BLEND_BIT` :36, `ADVANCEDPP_BIT` :37, `TARGET_LUM_SRC_TEXTURE_OFFSET` :42, `TARGET_LUM_DEST_TEXTURE_OFFSET` :43, `SSAO_BLUR_ON_BIT` :50, `SSAO_OPT_DATA_BIT` :51, `SSAO_HALF_DATA_BIT` :52, `SSAO_HDAO_BIT` :53, `SSAO_ULTRA_BIT` :54, `CRT_REFERENCE_OFFSET` :56, `TEXTURE_REFERENCE_OFFSET` :66; GM-G6 counts 21); `sr_profile.rs:7` `#![allow(dead_code)]` hides them (the constants are generated from `tools/generate-anomaly-sr-profile.py`, so remove them at the generator). TESTONLY (production-file items whose only callers are tests): `games/ac7/src/fake_code.rs:19,27` (`seed_admission`, `seed_temporal_patches`); `games/ac7/src/native_renderer/graph.rs:301` `set_postprocess`; `native_renderer/sky.rs:499` `composite_draw_handler`; `velocity_geometry.rs:558` `history_compile_count`; `velocity_renderer/replay.rs:136` `shader_creation_count`; anomaly: `fixture_profile.rs:9`, `input.rs:22` `has_fixture_profile`, 40 items in `motion/device_fixture/{draw,foliage,harness,model,scene,schedule}.rs`, `motion/foliage.rs:295,305,325` (`conflicts`, `recorded`, `scale`), `motion_target/fixture.rs:125`, `shader_loader/deployed.rs:14-16,55,59` (`REPLACED`, `REPLACED_FROM_CACHE`, `ORIGINAL_MISMATCH`, `parse_manifest`, `keeps_buffer_sizes`), `shader_loader/fixture.rs:401`, `sr_d3d11.rs:247-284` (5 `fixture_*`), `sr_temporal.rs:1365`, `sr_temporal/runtime_fixture/lifecycle.rs:548`, `temporal_fixture.rs:95`, `temporal_fixture/{history,math,oracle,oracle/math}.rs` (17 items); `games/rdr2/src/capture_state/install.rs:160,168` (`arm_fixture`, `stop_fixture`); `integrations/godot/native/platform/fake.rs` (9 helpers), `integrations/godot/native/vulkan/creation.rs:130,144,152`; `runtime/orchestrator/src/shader_patch/d3d11.rs:258` `inventory_contains`, `temporary_ini.rs:23` `directory_wide`, `vulkan_dx12_fg/platform.rs:71` `dispatch_available`. Keep: delete DEAD items; move TESTONLY items into `#[cfg(test)]` or the fixture feature. Confidence: h (DEAD), m (TESTONLY: check they are not C-test entry points). **Done (tree check):** `rsf_anomaly_foliage_begin` and `rsf_fallout4_inputs_verify` are gone; the TESTONLY items are behind `cfg(test)` or a fixture feature (`games/ac7/plugin/src/fake_code.rs` is `cfg(test)`, `warp-fixture` items in `games/ac7/src/velocity_*`, `games/rdr2/src/capture_state/install.rs:161,169` `capture-fixture`, `runtime/orchestrator/src/temporary_ini.rs` behind `cfg(all(windows, test))`, `shader_patch/d3d11.rs:259`, `vulkan_dx12_fg/platform.rs:70`, anomaly `device_fixture` behind `motion-device-fixture`). Kept: `games/anomaly/src/sr_profile.rs:99` `allow(dead_code)` and its unused constants, because `tools/anomaly_profiles.py:35-38` reads every integer constant and `tools/anomaly_sr_evidence.py` checks them against the exe. + +### Orchestrator core + +Paths are under `runtime/orchestrator/` unless stated. + +- [ ] **S1.1 Rust-only C ABI inside the crate, est. 3,000 to 6,000 lines.** 123 of the 304 Rust-only exports are here; biggest files `src/fg12.rs` (11, e.g. `rsf_core_fg12_install` :479, `rsf_core_fg12_status` :1323), `streamline_generation_records.rs` (10, `rsf_slhost_format_version` :22, :48, :66), `frame_capture12.rs` (10), `streamline_host/generation.rs` (10), `d3d12_host/fg.rs` (7), `d3d12_host/sr.rs` (7), `vulkan_antilag.rs` (7), `vulkan_latency_frames/streamline.rs` (7). Headers existing only to give bindgen a Rust-to-Rust interface (no C or C++ includer): `src/native_fg_fsr4_vulkan_platform.h` (feeds `tests/vulkan-fg/src/fsr4_state_abi.rs`, 1,143 lines), `overlay_wrapped12_platform.h` (`overlay_native12_abi.rs`), `native_fg_cpu_platform.h` (`native_fg_cpu_abi.rs`, `tests/game-sdk/src/fg_cpu_calls.rs`), `auxiliary_sr_platform.h`, `sharpening_vulkan.h`, `overlay_panel.h`, `d3d11_output_platform.h`, `latency_antilag.h`, `native_fg_platform.h`. `d3d11_host_abi.rs:2-3` says "The host platform table is Rust-only and can be replaced by fixture calls". Keep: plain `pub(crate) fn` with Rust types; records defined in Rust, header and binding deleted. Where: above. Confidence: h. **Status (round 4):** the bindgen-only headers named above are all gone (rounds 1 to 3, and `native_fg_cpu_platform.h`, `latency_antilag.h`, `d3d11_output_platform.h` in round 3). Round 4 deleted the remaining Vulkan ones with the fixture moves: `native_fg_dlss_vulkan_platform.h`, `native_fg_fsr4_vulkan_platform.h`, `native_fg_dx12_vulkan_platform.h` and `native_fg_dlss_vulkan_capture_ledger.h` (S5), plus `sharpening_vulkan_core.h` (the sharpening `Uniform`, `Layouts`, `Facts`, `Pass` and `Platform` records are Rust in `vulkan_sharpening.rs`; the six `rsf_core_sharpenvk_*` exports are plain functions) and `runtime/backends/common/generation12_platform.h` (the XeLL fixture is `d3d12_generation/xell_fixture.rs` over the Rust `Ops`/`Checks`; `rsf_core_xeg12_*` and `rsf_core_fsr12_*` are plain functions, the two provider getters with no caller deleted). `native_fg_xess_vulkan_platform.h` stays: `native_fg_xess_vulkan.c` and `native_fg_xess_vulkan_present.c` include it. Orchestrator exports left without a C caller are the Godot-declared `rsf_core_capture12_*` (6), `rsf_core_capture_vk_*` (9) and `rsf_core_srvk_session_*` (5), kept for the cross-archive callers listed under S1 mechanism 2. The headers found in round 4 that only bindgen read through another header are gone too: `vulkan_fg_copy_abi.h` with the includer-less `vulkan_fg_copy.h` (`Barrier`/`ImageCopy` are Rust in `vulkan_fg_copy.rs`), `native_latency_vulkan_presentation.h` with the includer-less `tests/vulkan_presentation_fixture.h` (the game-sdk latency fixtures reach the presentation registry through `rsf_orchestrator::vulkan_latency_api`), and `native_fg_ffx_vulkan.h` with `tests/vulkan-fg/ffx_abi.h` and `results.h` (the FFX fixture is `vulkan_ffx_fg/fixture.rs` over the Rust `Host`); deleting `ffx_abi.h` left `vulkan_fg_resources.h` and `vulkan_fg_frames.h` without an includer, so their `Image`, `Fences`, `Platform`, `FrameSlot`, `Timeline` and `SubmitPlan` records are Rust as well. 47 more exports that only those headers named lost `#[no_mangle]`. **Tip check (port-md-entry-review):** all 22 header names above and in the status are gone from `git ls-files`. `native_fg_xess_vulkan_platform.h` stays because the C leaves `runtime/orchestrator/src/native_fg_xess_vulkan.c:4` and `native_fg_xess_vulkan_present.c:5` include it; it declares `rsf_xessgvk_ops`, the table of XeSS bridge exports those leaves fill, which exist only in builds with the XeSS-FG SDK. The Rust-only exports that remain are the S1 Kept set. Follow-up at 13b64b46: Vulkan host readback now calls the typed Runtime capture owner directly, and the DLSS preset unit test reads its settings file without an exported wrapper. Linked verification and the broader private ABI audit remain open. +- [x] **OC-A1 Ten private `#[no_mangle]` exports with no caller anywhere.** The survey regex only matched `pub` functions. `rg -w` over the repository (all file types, docs excluded) returns only the definition for each; the live overlay paths are `overlay_native12::native::rsf_overlay_native12_*` (`render_host.rs:281-293`) and `overlay_wrapped12::native::rsf_overlay_d3d12_frame`/`_stop` (`callback_host.rs:188-193`, `overlay_service.rs:21`). `Platform::admit` in both overlay files is called only from the dead entries. `AuxiliarySr::refine`/`original_colour` stay live through `d3d11_host_reduced.rs:35,38`. `rsf_input_dump*` and `rsf_core_dump12_*` look dead to the same scan but are reached by token pasting in `input_dump.c:46-52,100-102`; excluded. Keep: nothing; delete the ten exports and both `admit` fns, then drop `rsf_overlay12_platform`/`rsf_overlay11on12_platform` (the `RawPlatform` aliases at `overlay_native12.rs:14`, `overlay_wrapped12.rs:5`) from `overlay_wrapped12_platform.h`/`overlay_native12_platform.h` and regenerate `overlay_native12_abi.rs`; check whether `Owner::flush_after_queue` in `frame_capture12.rs` has another caller. Where: `src/overlay_native12.rs:866-893` (`rsf_core_overlay12_visible`, `_toggle`, `_present`) and `:91` `admit`; `src/overlay_wrapped12.rs:312-347` (`rsf_core_overlay11on12_frame`, `_stop`), `:54` `admit`, comment `:14-15`; `src/auxiliary_sr.rs:1075,1097` (`rsf_auxiliary_sr_refine`, `rsf_auxiliary_sr_original_colour`); `src/d3d12_host.rs:155` (`rsf_core_d3d12_create_command_list`); `src/frame_capture12.rs:686` (`rsf_core_capture12_flush_after_queue`); `src/sdk_module.rs:88` (`rsf_core_load_absolute_library`). Confidence: h. +- [x] **S1.4 Backend result codes redeclared in about 95 files, est. 200 lines.** `runtime/contract/include/rescaleframe/backend.h:100-113` defines `RSF_BACKEND_OK` and `RSF_BACKEND_ERROR_*` as cast macros which bindgen drops, so 164 `const OK|INVALID|ABI_MISMATCH|LOAD_FAILED|MISSING_ENTRY: i32 = ..` lines are hand-written (e.g. `dlss_native12.rs:29-37`, `dlss_streamline.rs:27-34`, `streamline_host.rs`, `d3d12_generation.rs`, `sr12.rs`, `render_host.rs`, `plugin_session.rs`). Keep: one `backend_result` module, hand-written next to the generated contract, or change the header to an enum or plain `#define`s so bindgen emits it. Matters more for consistency than line count. Confidence: h. Done in the orchestrator: `rsf_game_sys::backend_result` holds the values once and 62 files import it (aliases `INVALID`, `MISSING_ENTRY`, `STALE`, `UNSUPPORTED` renamed to the header names). Kept: files with their own code space that shares the range (`overlay_window`, `frame_tap`, `render_host`/`plugin_session`, `texture_dump` and similar), vendor values (`VK_*`, `XESS_*`), and the files the Vulkan worker owns (`streamline_host`, `streamline_sr`, `vulkan_fg`, `vulkan_dx12_fg`, `fsr4_fg_bridge`, `vulkan_xess_fg`, `streamline_sdk`, `vulkan_dlss_fg`). +- [x] **S1.6 COM ownership wrapper next to `windows` typed interfaces, est. 230 lines plus call sites.** `src/com_ref.rs` (229 lines, used in 84 files) is an untyped `NonNull` owner; the `windows` interfaces the crate already uses are refcounted with `Clone`/`Drop`. Copies: `games/skyrim-se/src/render_native.rs:72` (`ComRef`), `games/rdr2/src/capture_state/gpu_leases.rs:29` (`Com`), `games/ac7/src/com_resource.rs`. Keep: the `windows` types; a raw wrapper only where a C struct holds the pointer (S1.1 removes most of those structs). Confidence: m (large call-site churn). Done (orchestrator round 3): `ComRef` is gone; rsf-graphics and the orchestrator hold `windows::core::IUnknown`, and `com_ref` keeps only the raw-pointer entry points the C leaves need (`owned`, `retain`, `identity`, `from_result`, `adopt_all`), the C `rsf_resource_retain`/`_release` exports and the test fakes. Owners stay untyped `IUnknown` where they pass raw handles to leaves; typing them per interface would restructure every leaf signature. The game copies (Skyrim, RDR2, AC7) belong to the games worker. +- [x] **S1.9 + OV-I3 Smaller orchestrator items.** `src/streamline_sdk.rs:9` `#![allow(dead_code)]` hides which records are unused (remove while doing S1.2); test-only callers: `vulkan_dx12_fg/platform.rs:71` `dispatch_available`, `temporary_ini.rs:23` `directory_wide`, `shader_patch/d3d11.rs:258` `inventory_contains` (see S-dead3); `#[cfg_attr(test, allow(dead_code))]` on `streamline_sr.rs:12-13` exists only because `streamline_sr/native` is `#[cfg(not(test))]` (`:7-8`) and goes away with X2 and the single Streamline entry table. Keep: delete or move to `#[cfg(test)]`. Confidence: h. Progress (D22): the `streamline_sdk.rs` blanket `dead_code` allow and the `streamline_sr.rs` `cfg_attr(test, allow(dead_code))` are gone with their modules. **Done (tree check):** `streamline_sdk.rs` has no `allow(dead_code)`, `streamline_sr.rs` no `cfg_attr(test, allow(dead_code))`; `temporary_ini` is `cfg(all(windows, test))` (`lib.rs:287-288`), `shader_patch/d3d11.rs:259` `inventory_contains` and `vulkan_dx12_fg/platform.rs:70` `dispatch_available` are `cfg(test)`. +- [x] **OC-C1 Platform tables with one production binding and no test substitution.** `src/native_fg.rs:67` `struct Platform` (49 fn pointers; sole binding `native_fg/platform.rs:75` `static NATIVE_PLATFORM`, used as `let p = &NATIVE_PLATFORM;` at `:901,951,978,991,1081,1168,1473`; `mod tests` `:2177` never builds a `Platform`). `src/fg12.rs:32` `struct Platform` (43), `:93` `OnceLock<&'static Platform>`, `:99-101` `bind_native_platform()`, `:103-107` `native!` macro; sole binding `fg12/native.rs:94` `static CALLS`; `bind_native_platform()` called at 14 sites in `fg12/native.rs:197-280` plus `callback_host.rs:1200`, `gl_pipeline/linked.rs:37`, `overlay_service.rs:1147`, `render_host.rs:1999`, `sr12/native.rs:368`; `mod native` is `cfg(not(test))` (`:95-96`), so unit tests cannot bind any table. `src/dlss_native12/sdk.rs:334-363` `static PLATFORM` (21) and `fn platform() -> Option<&'static Platform> { Some(&PLATFORM) }`, `dlss_native12/exports.rs:9-17` returns `None` under `cfg(test)`, callers branch to `NOT_COMPILED` (`exports.rs:6,51,89,107,123,151,174,195,238`). `src/dlss_streamline/exports.rs:7-17` and `dlss_streamline/sdk.rs:496-513` same shape. `src/frame_tap/platform.rs:13-58`: `OnceLock>` from 24 Rust fns and 9 C trampolines, each unwrapped with `?` although `frame_tap_callbacks.c` sets all nine fields; the `.expect` at `:14` documents `None` cannot happen. Keep: direct calls to the functions now stored in the statics (most are already Rust in this crate, e.g. `rsf_d3d11_present_has_owner`, `rsf_core_d3d11p_host`); delete `bind_native_platform`, the `native!` macro, the `Option` wrappers and `NOT_COMPILED`; for `frame_tap` keep the C trampolines (they contain foreign C++ exceptions) and call `rsf_frame_tap_foreign_callbacks()` fields directly. Unit tests do not reach these owners today. Where: above. Confidence: h (native_fg, fg12, dlss_native12, dlss_streamline), m (frame_tap). Progress: `native_fg` calls its leaves directly (struct, static and the `p` parameter threaded through 25 functions deleted); `fg12` reads its static table without the `OnceLock` publish. D22: `dlss_native12`/`dlss_streamline` call the SDK directly; their `Platform` tables, `platform()` options and `NOT_COMPILED` branches are deleted. Left: `frame_tap` (rsf-graphics). Round 2: the fg12 table is deleted; `native!` calls `fg12::native` functions directly. **Done (tree check):** `bind_native_platform`, `native!`'s table, `NATIVE_PLATFORM`, `dlss_native12`/`dlss_streamline` tables and `NOT_COMPILED` branches are gone, and `runtime/graphics/rust/src/frame_tap/platform.rs` holds no `OnceLock>` or `Platform` struct; the three foreign-exception callbacks stay C in `runtime/graphics/src/frame_tap_callbacks.c`. Kept: `runtime/orchestrator/src/native_fg_cpu.rs:34` `Platform`, built by the `test-fixtures` fg-cpu fixture (`tests/game-sdk/src/fg_cpu.rs:313`). +- [x] **OC-C2 Platform tables that are test seams: use the in-crate cfg swap.** `src/d3d11_host_abi.rs:84-182` `rsf_d3d11h_platform` (70 fields; production `d3d11_host_platform.rs:59-130`, test `d3d11_host_tests.rs:232`; 18 fields carry `#[cfg_attr(test, allow(dead_code))]` at `d3d11_host_abi.rs:96-143`, as do 11 host functions in `d3d11_host.rs` e.g. `:2194,2207,2222,2238,2283,2330`, so the fake reaches only part of the table); `src/sr12.rs:108` (50 fields; `sr12/native.rs:102` vs `sr12/tests.rs`), `src/sr_bridge.rs:69` (45), `src/gl_pipeline.rs:85` (53), `src/gl_shared_surface.rs:82` (34), `src/streamline_host.rs:145` (23), `src/frame_capture12.rs:60` (11, plus publisher `rsf_core_capture12_native_platform` at `:543`). `render_host.rs:122-130` and `callback_host.rs:81-89` already use `#[cfg(not(test))] struct Platform;` plus `render_host_methods::impl_host_methods!` (direct Rust calls in production, table calls only under `cfg(test)`). Keep: `impl_host_methods!` or a generic `P: Platform`; production fields become safe typed Rust calls; drop the `cfg_attr(test, allow(dead_code))` markers; unit tests keep their fakes (`d3d11_host_tests.rs`, `sr12/tests.rs`, `sr_bridge/tests.rs`, `gl_pipeline/tests.rs`, `gl_shared_surface/tests.rs`, `streamline_host/tests.rs`). Confidence: h that it is duplicated mechanism, m on effort per owner. Done (orchestrator round 3): `d3d11_host`, `sr12`, `sr_bridge`, `gl_pipeline`, `gl_shared_surface` and `frame_capture12` call their leaves as `native::*` (`ops::*` in frame_capture12): the production module in production, a test module of fakes with the same names under test. Each owner had exactly one production and one test table, so a cfg module swap replaces the table, the `&'static Platform` fields and parameters, the platform-taking create twins and the dead-code markers without the `impl_host_methods!` macro. `rsf_d3d11_host_create` now compiles under test, the `rsf_core_capture12_native_platform` publisher and `frame_capture12.h` are deleted, and the FSR D3D12 generation `Ops` lost the capture table it only passed back. `streamline_host` belongs to D22 (Vulkan worker). +- [x] **OC-D1 + OV-B3 Orphan headers with no includer and no generator.** `src/overlay_bound.h` (decls of `rsf_overlay_configure_bound`, `_present_bound`, `_notify_bound`, which are `pub(super) unsafe extern "C"` at `overlay_service.rs:601,1153,1322`, called only from `gl_pipeline/linked.rs:7,191-193`); `src/sr_legacy_adapter.h` (`rsf_sr_legacy_create/select/destroy/warm_up/fg_inputs`; Rust at `sr_legacy.rs:73,392,416,431,454,461` called only from `dlss_pipeline.rs:38-39` and `dlss_pipeline/platform.rs:18,276`; the header also documents a stale `rsf_sr_legacy_evaluate` contract the Rust already implements as a plain fn); `runtime/backends/dlss/src/streamline_load.h:1-20` (`rsf_streamline_load_interposer`; `:13-14` cites the deleted `dlss_streamline.cpp`) and `streamline_frame.h:1-15` (`rsf_streamline_common_set`), both Rust-defined, Rust-called, included by nothing. Keep: delete all four headers; turn the eleven `extern "C"` functions into plain Rust fns with typed arguments (`&mut Adapter`, `Option<&Setup>`). Confidence: h. Done: the four headers are deleted; `rsf_sr_legacy_*` are plain Rust fns and the three `rsf_overlay_*_bound` lost `no_mangle` (they stay `extern "C"` because the OpenGL pipeline table stores them). `rsf_streamline_load_interposer` and `rsf_streamline_common_set` sit in `streamline_sr`/`streamline_host`, which the Vulkan worker owns (D22), so their C ABI stays for now. D22 made both plain Rust (`streamline_sdk::load_interposer`, `streamline_host::common_set`). +- [x] **OC-D2 Versioned C records built to call the crate's own Rust.** `src/d3d11_host_platform.rs:279-347`: `rsf_d3d11h_start_pipeline` fills `rsf_dlss_pipeline_setup` (`struct_size`, `RSF_DLSS_PIPELINE_ABI_VERSION`) then calls `rsf_dlss_pipeline_start_backend`; `rsf_d3d11h_read_pipeline_status` zero-fills a sized `rsf_dlss_pipeline_status` to copy five integers; thin forwarders `:311-321,344-347`. `:257-265` builds a `struct_size`/`version: 1` `rsf_native_latency_window` to call `rsf_native_latency_window_bind` in `native_fg_cpu/platform.rs` (no non-Rust caller except fixture bindings `tests/game-sdk/src/fg_cpu*.rs`). `src/sr_legacy.rs` extern "C" API (OC-D1). Keep: call the Rust owners (`dlss_pipeline` start/resize/select/status, `native_fg_cpu` window bind) with Rust types; keep the `no_mangle` wrappers only for `loader/proxy/src/dlss_bridge.c` (verified, e.g. `:1900,2713,3073`) and plugins. Tests: `d3d11_host_tests.rs`, `tests/sr_backend_switch_device.rs`. Confidence: m-h. Done (orchestrator round 3): the D3D11 host builds the public `rsf_dlss_pipeline_setup` and `rsf_dlss_pipeline_status` itself and calls the `rsf_dlss_pipeline_*` exports `dlss_bridge.c` uses; the Rust-only `rsf_d3d11h_strings`, `rsf_d3d11h_pipeline_start`, `rsf_d3d11h_pipeline_status` and the resize/select/quality/colour forwarders are gone. The latency window binds through a typed `native_fg_cpu::platform::bind_latency_window`; `rsf_native_latency_window_bind` and its record stay because `native_cpu.h` publishes them. +- [x] **OC-D3 `input_dump.c` forwarder ring around the Rust capture owner (decision D6).** `src/input_dump.c:7-105`, `input_dump_platform.h`, `CMakeLists.txt:5-14`: `RSF_DUMP_EXPORT` macros (`:45-52,100-102`) define every public `rsf_input_dump_*`/`rsf_input_dump12_*` export as a C function calling `bind_platform()` then the Rust `rsf_core_dump_*`/`rsf_core_dump12_*`; `bind_services` (`:8-19`) builds a five-pointer table, two Rust (`rsf_common_sha256_file` `runtime/common/src/lib.rs:101`, `rsf_game_depth_domains_requested` `sdk/game/src/renderer_policy.rs:20`), and hands it back to Rust. Only `rsf_dump_texture_bytes/png` and `rsf_dump_pixels_png` live in C (`runtime/graphics/src/texture_dump.c`, itself a forwarder to Rust `texture_dump.rs:480,516`). Keep: Rust `no_mangle` exports under the public names with direct service calls; delete the forwarders, `input_dump_platform.h` and the `rsf_core_dump_bind_services` handshake. Export set must stay identical (`rust_exports.c`, `dlss_bridge.c`); tests `tests/input_dump_c_header.c`, capture fixtures. Confidence: m. Done (D6): the Rust owners carry the public `rsf_input_dump*`/`rsf_input_dump12_*`/`rsf_capture_sr_parameters` names, call the hasher, texture encoders and depth-domain predicate directly, and `rust_exports.c` exports the 36 names `RSF_RUNTIME_API` used to; `input_dump.c`, `input_dump_platform.h` and the bind handshake are deleted and `rsf_frame_dump` is an INTERFACE target over the Runtime archive; `texture_dump.c` and `texture_dump_platform.h` are gone too, the Rust `texture_dump` owner exporting the three encoders. +- [x] **OC-E1 DLSS preset validity implemented twice, plus a C file to reach the C copy.** `runtime/backends/dlss/include/rescaleframe/dlss_preset.h:9-12` (C inline), `src/streamline_sr.rs:117-119` (Rust; used by `render_host.rs:169`, `dlss_pipeline/platform.rs:294`, `dlss_native12/exports.rs:4`), `src/gl_pipeline_contract.c:12` (`rsf_gl_contract_dlss_preset_valid`, a one-line wrapper over the inline, bound at `gl_pipeline/linked.rs:21,188`); both read `RSF_DLSS_PRESET_MASK` but the `<= 13` range is hand-copied. A third use is in `native_dlss_vulkan.c` (OV-A5). Keep: `streamline_sr::preset_valid` in `gl_pipeline/linked.rs`; delete `rsf_gl_contract_dlss_preset_valid`, then (after OC-E2) the whole of `gl_pipeline_contract.c` and its `CMakeLists.txt:24` entry. Tests: `gl_pipeline/tests.rs`. Confidence: h. +- [x] **OC-E2 SR backend IDs redeclared in eleven files.** `src/lib.rs:478-481`, `callback_host.rs:70-74`, `d3d11_host.rs:44`, `d3d11_present.rs:79-83`, `dlss_pipeline.rs:67-69`, `d3d11_sr_admission.rs:10-13`, `gl_pipeline.rs:46-53`, `render_host.rs:81-84`, `sr_bridge.rs:30`, `sr12.rs:38-40`, `streamline_host/startup.rs:9` (`DLSS = 0`, a different enum under the same name). bindgen already emits `RSF_SR_NONE..RSF_SR_AUTO` (`overlay_abi.rs:38`, from `sr_session.h`); `gl_pipeline_contract.c:7-9` and the comment at `lib.rs:477` exist only to check the copies. Keep: one `pub(crate) mod sr_backend` re-exporting the generated `RSF_SR_*` (sibling of S1.4); rename the `streamline_host/startup.rs` constant. Confidence: h. Done: the files use the generated `RSF_SR_*` directly; `d3d11_present.rs` `DLSS/FSR3/FSR4/XESS` are FG backend IDs and stay; `streamline_host/startup.rs` belongs to the Vulkan worker (D22); D22 replaced its feature IDs with the shared `sdk_api` constants. +- [x] **OC-E3 INI settings read and written outside the settings owner.** `settings_store.rs` is declared owner of keys and file format (`:1-5`, the `render_host.rs` module doc, `render_settings_store.h:4-5`) and exposes `rsf_settings_store_read_integer`/`write_integer` (`render_settings_store.h:20-23`), but `src/render_host.rs:1312-1320,1353-1360,1727-1746,1815-1816` (`OverlayProbe`, `SRCaptureDirectory`, `GraphicsDiagnostics`), `src/fg_choice.rs:143,168` and `src/d3d11_host_platform.rs:408-427` (`ini_read`/`ini_write` platform leaves) use raw `GetPrivateProfile*W`/`WritePrivateProfileStringW`. Keep: `settings_store` integer/string accessors; delete the d3d11_host `ini_read/ini_write` table fields. Tests: `render_host/tests.rs:601-652`, `callback_host/tests.rs:400-411`. Confidence: m-h. Partial: `GraphicsDiagnostics` (render host) and `FrameGeneration` (`fg_choice`) now go through `rsf_settings_store_read_integer`/`write_integer` and its profile lock. The `d3d11_host` toggles now use `rsf_settings_store_read_integer`/`write_integer` (its tests fake them). Left: `SRCaptureDirectory` (read raw with `profile_text::decode`; the store's text reader handles quoting differently, so switching changes accepted values). **Done (tree check):** `GraphicsDiagnostics`, `FrameGeneration` and the `d3d11_host` toggles use `rsf_settings_store_read_integer`/`write_integer`. Kept: `runtime/orchestrator/src/render_host.rs:1619` reads `SRCaptureDirectory` raw (`GetPrivateProfileStringW`, then `profile_text::decode`) because the store's text reader treats quoting differently and switching would change accepted values. +- [x] **OC-E4 + S1.9 Orchestrator wide-string copiers and poison-tolerant lock helpers.** Six NUL-terminated `*const u16` copiers: `callback_host.rs:307`, `render_host.rs:448`, `d3d11_host.rs:84`, `gl_pipeline/settings.rs:39`, `overlay_service.rs:266`, `overlay_saved.rs:79` (bounded); `&str` to wide at `d3d11_host.rs:78,80`, `settings_store.rs:124`, `streamline_sr/signature.rs:406`. Lock helpers `fn lock(&Mutex)` at `native_fg.rs:229`, `native_fg_cpu.rs:137`, `sr12.rs:191`, `d3d11_present.rs:145`, `try_lock` poison handling at `render_host.rs:565-570`, `gl_pipeline.rs:375-382`; `unwrap_or_else(PoisonError::into_inner)` inline 73 times in 39 files. Keep: one `wide` module (`copy_nul(*const u16) -> Vec`, `from_str`) and one `sync` module (`lock`, `try_lock_or_poisoned`) at crate root next to `owned_handle.rs`. Removes six unsafe loops. Confidence: h. Done in part: `wide::{copy_nul, from_str}` replaces the copiers in `callback_host`, `d3d11_host`, `gl_pipeline/settings`, `overlay_service`, `render_host` and `settings_store`; `sync::lock` replaces the five `fn lock` copies. Kept: the 73 inline `unwrap_or_else(PoisonError::into_inner)` calls (a mechanical rewrite with no behaviour gain), the bounded `overlay_saved` reader and the two `try_lock` sites, whose poison handling differs. Follow-up (orchestrator round 3): the inline `unwrap_or_else(PoisonError::into_inner)` calls (50 sites in 32 files) go through `sync::lock`, and the ten identical non-blocking lease helpers through a new `sync::try_lock`. Left: the Vulkan/Streamline files (Vulkan worker), the `RwLock` and early-return `try_lock` sites in `d3d11_present`, and rsf-graphics, which has no `sync` module. +- [x] **OC-F1 One-shot RDR2 overlay probe in the generic render host (decision D5).** `src/render_host.rs:1298,1303-1339` (control and save), `:1341-1400` (`overlay_probe`), `:1443` (per-frame call), `:1727-1729,1760-1763,1810-1819` (read and clear at startup); tests `render_host/tests.rs:601,636-652,1067-1095`. After 60 presents it opens the shared panel, runs a cursor-hide loop up to 512 times, keeps the panel 120 presents and logs; documented only by `games/rdr2/RESEARCH-HANDOFF.md:117`; it clears itself on first use and PORT.md:238 records it was given an overlay control to satisfy Rule 2. Keep: delete it, or a synthetic overlay test (`tests/overlay`) if the cursor regression is still worth guarding; `SRCaptureDirectory` and `GraphicsDiagnostics` are real features and move to `settings_store` (OC-E3). Confidence: m (needs a ruling that the RDR2 cursor research is closed). Done (D5): the probe, its host option, `OverlayProbe` key, `hide_cursor` leaf and test are deleted; `GraphicsDiagnostics` is now host option 0. `rsf_render_overlay_visible`/`_toggle` (RDR2 resolves them by name) call the overlay directly instead of through the render-host table. The two INI keys still use raw `GetPrivateProfile*` (OC-E3). + +### Orchestrator Vulkan and backends + +Paths are under `runtime/orchestrator/src/` unless stated. The common claim in the C file headers ("CMake header detection decides which providers exist") is one boolean per vendor: `build.rs` already runs build-time probes, so the same `EXISTS` checks as `runtime/orchestrator/CMakeLists.txt:49-129` can emit `cargo:rustc-cfg=rsf_have_ffx_vk` and the like, or `rsf_add_rust_static` (`cmake/rust_static.cmake:9-15`, forwards `ARGN`; used with `--features` at `games/ac7/CMakeLists.txt:3`) can pass `--features`. The 12 C forwarder files total 1,558 lines and name 138 distinct `rsf_core_*` symbols; their private headers `src/native_*vulkan*.h` add 893 lines; the survey's `exports.txt` misses them because it drops every export a C file names. Fix order: OV-C1 first, then OV-A with X11, then OV-E/G, then D and H. + +- [x] **S1.2 Streamline: five record mirrors and about nine entry-point tables, est. 1,300 lines.** `sl::` records are defined repeatedly: `ViewportHandle` (`runtime/vulkan/streamline/sdk_records.h:18` `rsf_slvk_sdk_viewport`, `runtime/backends/dlss/src/streamline_sr_records.h:14`, `streamline_sdk.rs:150`, `tests/game-sdk/src/unity_sr_d3d12/streamline.rs:82`), `AdapterInfo` (`sdk_records.h:24`, `streamline_sr_records.h:19`, `streamline_sdk.rs:200`), `Version` (`streamline_sr_records.h:10`, `streamline_generation_records.h:18`, `streamline_sdk.rs:167`), `Constants` (`sdk_records.h:80`, `streamline_sr.rs:47`, `tests/game-sdk/src/unity_sr_d3d12/streamline.rs:49`), `ResourceTag` (`sdk_records.h:120`, `streamline_generation_records.h:6`, `streamline_sr.rs:144`, `TagBatch` :167), `ReflexState`/`PCLState` (`sdk_records.h:33/:41`, `streamline_sdk.rs:286/:337`), `Preferences` (`sdk_records.h:48`, `dlss_native12.rs:108`, `dlss_streamline.rs:145` `InitPreferences`). Each module also resolves exports with its own name list and fn-pointer table: `dlss_native12.rs:42` (`CORE_NAMES`, 10), `:54-105` (`CoreEntries`, `FeatureEntries`); `dlss_streamline.rs:39` (`ENTRY_NAMES`, 12), `:54-55`, `Startup` `:159`; `dlss_streamline/sdk.rs:38`; `streamline_host/startup.rs:36`; `streamline_host/native.rs:76` (`Core`); `vulkan_dlss_fg/leaves.rs:56`; `vulkan_dlss_sr/leaves.rs:57`; `runtime/vulkan/streamline/lifecycle/src/sdk_api.rs:33-73`; `lifecycle/src/win32/bridge.rs:42`; `streamline_sdk.rs:456-488` (`mod api`, 25 fn typedefs). Keep: one mirror, owned by `runtime/vulkan/streamline/sdk_records.h` with generated `sdk_records_abi.rs` (already `#[path]`-included at `streamline_sdk.rs:19`), or one bindgen pass over `sl.h` with `-x c++`; delete `streamline_sr_records.h` with `streamline_sr/records_abi.rs` (258), `streamline_generation_records.h` with its abi (108) and the hand records in `streamline_sdk.rs:148-353`; one typed entry table (a struct of `Option` resolved once from the interposer) plus one per-API device setter (vendor-SDK ownership, Rule 1). Confidence: h. **Done (D22):** one record set: `sdk_records.h` gained `Version`, `FeatureVersion`, `FeatureRequirements`, `ReflexReport`, `ReflexReport2` and the full `ReflexState` (checked in `sdk_records_checks.h`), the D3D SR options use `sdk_sr_options.h`; `streamline_sr_records.h`, `streamline_generation_records.h` and the hand records and `mod api` in `streamline_sdk.rs` are deleted. One entry table, `rsf_streamline_vk::sdk_api::Entries`, replaces `CORE_NAMES`/`CoreEntries`/`FeatureEntries`, `ENTRY_NAMES`/`Startup`, both `sdk.rs` `Native` tables, the host's `ENTRY_NAMES`/`Core` and the Vulkan DLSS SR leaf's per-name exports. Kept: `vulkan_dlss_fg/leaves.rs` `Sdk` (repr(C), written by the OV-A5 native fixture) and the Vulkan lifecycle's `bridge.rs` atomic entries (cleared on slShutdown by its state machine). +- [x] **S1.3 FidelityFX bound five times, est. 2,400 lines.** `ffxCreateContextDescUpscale` is at `d3d12_sr/fsr_abi.rs:484`, `runtime/vulkan/fsr3/sdk_abi.rs:450`, `fsr4/sdk_abi.rs:392`; `ffxConfigureDescFrameGeneration` at `d3d12_generation/fsr_abi.rs:283`, `fsr3/sdk_abi.rs:803`, `fsr4-fg/sdk_abi.rs:564`; 132 of 384 names are defined two to four times across fsr3 (1,820 lines), fsr4 (593), fsr4-fg (748), d3d12_sr (664), d3d12_generation (475). `fsr3/sdk_abi.rs` is also compiled twice in the orchestrator (`vulkan_ffx_fg/sdk.rs:46`, `vulkan_sr/ffx_descriptors.rs:8`). Keep: one generated `ffx_api` module covering `ffx_api.h`, `ffx_upscale.h`, `ffx_framegeneration.h`, `ffx_api_dx12.h`, `ffx_api_vk.h`; once it exists the vendor-record `_Static_assert`s (OV-G2) are redundant. Confidence: h. **Done for the Vulkan half (stage B):** the FidelityFX 2.4.0 DX12 records have one owner, `rsf_fsr4_compat::ffx_abi` (with `ffx_resource`), which `d3d12_sr` re-exports and both FSR4 Vulkan bridges use; `fsr4/sdk_abi.rs`, `fsr4-fg/sdk_abi.rs` and their generators are deleted; `fsr3/sdk_abi.rs` (SDK 1.1.4, a different pinned SDK) is compiled once per crate (`ffx_vk_abi` in the Runtime). `d3d12_generation/fsr_abi.rs` stays as the frame-generation header family of the same owner set. +- [x] **S1.5 + S2.5 + OV-C1 Same file compiled twice in one crate; `rsf-streamline-vk` and `rsf-fsr4-compat` are staticlib-only.** `sdk_records_abi.rs` comes in at `streamline_sdk.rs:19` and `vulkan_streamline_camera.rs:13` (`allow(dead_code)` :14); `sdk_api.rs` at `streamline_sdk.rs:11` and a third time in the lifecycle crate; `d3d12_generation/xess_abi.rs` at `xess_native.rs:4` and through `runtime/vulkan/xess-fg/session.rs:16` (included by `lib.rs:416`/`:421` as `xess_fg_bridge`); `ffx_version.rs:24,33` `allow(dead_code)` "also compiled into the standalone FSR4 archive", included by `runtime/backends/fsr/compat/src/lib.rs:10`; `vulkan_dlss_fg.rs:3`. Causes: `runtime/orchestrator/CMakeLists.txt:31` (`rsf_orchestrator_rust`), `:127-128` (`rsf_streamline_vk_rust` into `rsf_native_vulkan`), `:59,:87` and `runtime/backends/fsr/CMakeLists.txt:6` (`rsf_fsr4_compat_rust`); `lifecycle/Cargo.toml:11-12` and `compat/Cargo.toml:9-10` (`crate-type = ["staticlib"]`); `orchestrator/Cargo.toml:12-14` has no dependency on either. Symptoms: C tables across them (`native_latency_vulkan.c:22-31`, `fsr_backend.c:13-14`); `rsf_streamline_core` cfg set only at `orchestrator/build.rs:122-123`, declared at `lifecycle/build.rs:5` and read at `sdk_api.rs:183`; the same C guard compiled twice, `orchestrator/build.rs:103-119` `streamline_guard()` as `rsf_core_slvk_guarded` (`sdk_guard.c:5-8` has a macro rename for this) and `lifecycle/build.rs:5-18` as `rsf_slvk_guarded`; two copies of std and `ash` in one DLL. Keep: `crate-type = ["rlib","staticlib"]` for both crates (standalone bridges in `runtime/vulkan/streamline/build.ps1:73` and `runtime/vulkan/fsr4/build.ps1:55` keep building the staticlib with `-p`), path dependencies from `rsf-orchestrator`, and delete the `#[path]` lines, `streamline_guard()`, `RSF_SLVK_GUARDED`/`RSF_SLVK_GUARD_ONLY` in `sdk_guard.c`, the `rsf_streamline_core` cfg and the two CMake `rsf_add_rust_static` calls. Whole-archive linking (`orchestrator/CMakeLists.txt:145`) must still export the public `rsf_vk_sl_*`/`rsf_fsr4_compat_*` symbols (`.def` files in `integrations/vulkanstory/native/`); check with `tests/native_vulkan_exports.rs`, the Streamline Vulkan dispatch fixture (`tests/CMakeLists.txt:917-922`) and `cargo build -p rsf-streamline-vk --target x86_64-pc-windows-gnu`. Confidence: h (mechanism), m (exact symbol set). **Done (stage B):** the Runtime imports `rsf_streamline_vk::{sdk_api, sdk_fg_options, sdk_camera_defaults}`, `rsf_vk_xess_fg` and `rsf_fsr4_compat::dx12_bridge` instead of `#[path]` copies; `streamline_guard()`, `RSF_SLVK_GUARDED`/`RSF_SLVK_GUARD_ONLY` and `cfg(rsf_streamline_core)` are gone; `rsf_native_vulkan` links only the Runtime archive. `runtime/backends/fsr/CMakeLists.txt` still builds `rsf_fsr4_compat_rust` for `fsr_backend.c` until OV-A7. +- [x] **S2.1 FSR4 Vulkan SR: Rust-only C ABI through three layers, est. 600 lines.** `runtime/vulkan/fsr4/native.rs:193` `create_device` (extern "C" in a platform table) calls `fsr4/sdk_commands.rs:58` `rsf_core_fsr4sr_create_device` (a `#[no_mangle] extern "C"`), which calls `dx12_bridge_commands.rs:30` `create_device`; interfaces are stored as raw handles in a bindgen'd C struct (`fsr4-fg/bridge_objects_abi.rs`, whose `bridge_objects.h` describes a Rust-owned record). `fsr4-fg/sdk_commands.rs` has 24 such exports and `fsr4/sdk_commands.rs` 11, many duplicating each other and `dx12_bridge_commands.rs` (find adapter, create device, shared fence, shared image, execute, release image). Keep: `dx12_bridge_commands.rs` as plain Rust functions over `windows` types; delete the two `sdk_commands` export layers. Confidence: h. **Done (stage B):** the 21 `rsf_core_fsr4sr_*` and 31 `rsf_core_fsr4fg_*` Rust-only exports are plain Rust; the FSR4 SR owner calls its capsule directly; `bridge_objects.h` and its binding are a Rust struct. +- [x] **OV-A1 Vulkan FG provider dispatch: four hops between Rust and Rust.** `rsf_fgvk_images` goes `vulkan_fg.rs` -> `provider.images` (C table) -> `rsf_ffx_images` (C adapter) -> `rsf_ffxgvk_images` (C forwarder) -> `rsf_core_ffxgvk_images` (Rust); `dlss_status` (in `native_fg_vulkan_dispatch.c`) fills `struct_size`/`abi_version` of a record Rust defined so Rust can validate it. All four providers are Rust (`vulkan_dlss_fg.rs:736`, `vulkan_ffx_fg.rs`, `vulkan_fsr4_fg.rs`, `vulkan_xess_fg.rs:531-670`); the FSR4 public entries are already Rust exports. Keep: in `vulkan_fg.rs`, `enum Provider { Dlss(&'static dlss::Owner) ... }` or a trait object per backend selected with `#[cfg(rsf_have_...)]`, each arm calling the owner's Rust method; delete `native_fg_vulkan_dispatch.c`, the forwarders in `native_fg_vulkan.c:69-126`, `native_fg_dlss_vulkan.c:57-95`, `native_fg_xess_vulkan_present.c:20-93`, the `rsf_fgvk_provider/platform` records, `vulkan_fg_abi.rs` (510 generated lines from `native_fg_vulkan_platform.h`, generator `tools/generate-rust-bindings.py:668-676`), and (D23) the `rsf_dlssgvk_*` and `rsf_fgvk_create{,_for_backend}` exports. Where: `vulkan_fg.rs:99-158,160-248,250-548`; `native_fg_vulkan_dispatch.c:42-82,87-164,166-266,268,270-285`; `include/rescaleframe/native_fg_dlss_vulkan.h:22-41`; `native_fg_vulkan.h:61,70`; `vulkan_fsr4_fg.rs:417-524`. Tests: `native_fg_vulkan_dispatch_{,xess_,fsr4_}contract` (`tests/CMakeLists.txt:873-893`, link-time provider substitution against `rsf_vulkan_dispatch_fixtures_rust` `:871`) move to a `#[cfg(test)]` provider; Godot live FG is the behavioural check. Confidence: h. **Open (stage B):** the C dispatch and the `rsf_*gvk_*` forwarders are also the link-time substitution seam of the three `native_fg_vulkan_dispatch_*_contract` fixtures (`tests/vulkan-fg/src/dispatch*.rs`, about 1,200 lines that define the provider symbols); moving the tables to Rust means rewriting those fixtures to build their own provider table, as done for the latency fixtures in OV-A4. The XeSS-FG provider also reaches `bridge.c` and `native_fg_xess_vulkan*.c`, real C leaves that only exist with `RSF_HAVE_XESS_FG_VK`, which is a genuine link seam. **Reconciled against the tree:** Unfinished: `runtime/orchestrator/src/native_fg_vulkan_dispatch.c` (285 lines), the forwarders in `native_fg_vulkan.c:69-126`, `native_fg_dlss_vulkan.c` (95), `native_fg_xess_vulkan_present.c` (93) and `native_fg_vulkan_platform.h` are still there; `vulkan_fg_abi.rs` is gone (generated at build). What holds it: the three ctests `native_fg_vulkan_dispatch{,_xess,_fsr4}_contract` (`tests/CMakeLists.txt:704-725`) compile `native_fg_vulkan_dispatch.c` into the test exe and substitute providers at link time from `tests/vulkan-fg/src/dispatch*.rs` (about 1,200 lines); rewrite those fixtures to build their own provider table, then move dispatch into `vulkan_fg.rs`. The XeSS leaves `bridge.c` and `native_fg_xess_vulkan*.c` are real C under `RSF_HAVE_XESS_FG_VK` and stay. **Done (round 3, Vulkan C):** `native_fg_vulkan_dispatch.c`, `native_fg_vulkan.c`, `native_fg_dlss_vulkan.c` and `native_fg_vulkan_platform.h` are deleted. `vulkan_fg.rs` holds the provider record and the four provider tables in Rust (the former C adapters: DLSS-G status and limit, FidelityFX 3 count-one enable, FSR4/XeSS options from the host record and result mapping) and exports `rsf_fgvk_create*`; the providers' entries are Rust exports under their old names (`rsf_ffxgvk_*`, `rsf_dlssgvk_*`, `rsf_xessgvk_*` renamed from the `rsf_core_*` cores, `rsf_fsr4gvk_*` already Rust), and the FidelityFX host table with its two SEH guards is Rust (`vulkan_ffx_fg/sdk.rs` `NATIVE_HOST`, `rsf_streamline_vk::sdk_api::guarded_or`, host callbacks as C-unwind). New Cargo features `fsr4-fg-vk`/`xess-fg-vk` replace `RSF_HAVE_FSR4_FG_VK`/`RSF_HAVE_XESS_FG_VK` (and `ffx-vk` from OV-A2 the FidelityFX host). The three `native_fg_vulkan_dispatch*_contract` ctests, `dispatch_fixture.c`, `dispatch_abi.h` and `tests/vulkan-fg/src/dispatch{,_drivers}.rs` became `vulkan_fg/dispatch_tests.rs`: under `cfg(test)` the four provider module paths in `vulkan_fg.rs` point at Rust fakes with the same entry names (the former link-substitution fakes), and one test runs the base, FSR4 and XeSS platforms in sequence. D23: `rsf_fgvk_create`, `rsf_fgvk_create_for_backend` and `rsf_dlssgvk_*` are no longer DLL exports (`native_vulkan_exports.c`); their C test callers link the archive. Kept, real C with an SDK-gated link reason: `native_fg_xess_vulkan_present.c` reduced to the `rsf_xessgvk_ops` table of the C bridge exports (`bridge.c`) and `rsf_xessgvk_create`, and `native_fg_xess_vulkan.c` (the interop importer over the same bridge); both compile only with `RSF_HAVE_XESS_FG_VK`, which is why `vulkan_fg.rs` names `rsf_xessgvk_create` only under `xess-fg-vk`. Kept exported for fixture callers: `rsf_core_ffxgvk_create_sdk`/`wsi_*` and `rsf_ffxgvk_guard_*` (`tests/vulkan-fg/src/ffx_sdk.rs`), `rsf_core_dlgvk_create` and the table symbol `rsf_dlgvk_leaves` (`tests/vulkan-fg/src/dlss/sdk.rs`). Behaviour note for verification: `rsf_native_fg_dlss_vulkan_test` used to compile the C table with `RSF_HAVE_STREAMLINE_VK=1` itself; it now gets the Runtime archive's selection, which needs `RSF_STREAMLINE_VK_DIGEST` (the `streamline-vk` feature). **Correction (item 3):** `tests/vulkan-fg/src/ffx_sdk.rs` and `tests/vulkan-fg/src/dlss/sdk.rs` no longer exist. The FidelityFX and DLSS-G fixtures are in this crate (`vulkan_ffx_fg/fixture/fake_sdk.rs`, `vulkan_dlss_fg/fixture/sdk.rs`) and call `rsf_core_ffxgvk_create_sdk`, `rsf_ffxgvk_guard_*`, `rsf_core_dlgvk_create` and the `pub(super)` table `LEAVES` by Rust path, so none of them is exported. The 13 `rsf_dlssgvk_*` and `rsf_fgvk_create_for_backend` also lost `no_mangle` (Item-3 fixes); `rsf_fgvk_create` stays unexported, its one C caller `tests/native_sr_vulkan_main.c` links the archive. +- [x] **OV-A2 Vulkan SR platform: a 28-entry ops table, 21 entries Rust.** `native_sr_vulkan.c:55-96` (`rsf_srvk_ffx_ops`, `rsf_srvk_platform`, "mirrored by FfxOps in `vulkan_sr.rs`"), `:226-246`, `:342-358`, `:365-398` (seven public exports forwarding to `rsf_core_srvk_*`); `vulkan_sr.rs:373-414` (`Platform`, `FfxOps` hand mirrors), `:869`, `:900`. The table holds `rsf_core_srvk_native_allocate/close/bind`, 13 `rsf_core_srvk_graphics_*`, `rsf_core_vkfg_platform`, `rsf_vkffx_symbol` and the input-dump trio, all Rust. Seven entries are real C for SEH frames (`call_device_proc`, `versions`, `create_effect`, `effective_version`, `destroy_effect`, `plan`, `dispatch`, `:206-340`). Public `rsf_srvk_plan`, `evaluate`, `retire_commands`, `destroy`, `dlss_preset` (`:370-393`) take no platform and only forward. Keep: Rust calls its own functions; SDK calls become Rust through `extern "C-unwind"` pointers inside one shared guard (OV-E2 in the foreign-exception guard entry); public exports become `#[no_mangle]` on the Rust cores; `native_sr_vulkan.c` keeps only FFX layout asserts or drops them (OV-G2). Tests: `native_vulkan_contract`, `native_vulkan_device`, `native_vulkan_dlss_device` (`tests/CMakeLists.txt:842-850`), `vulkan_sr/owner_tests.rs`. Confidence: h. **Open (stage B):** seven entries are real C SEH frames around SDK calls; the table can become Rust once those calls use `rsf_streamline_vk::sdk_api::guarded_or` or the shared guard of OV-E2, and the `native_vulkan_*` fixtures that link the C table are reworked. **Reconciled against the tree:** Unfinished: `runtime/orchestrator/src/native_sr_vulkan.c` (384 lines) still holds the 28-entry `rsf_srvk_ffx_ops`/`rsf_srvk_platform` (`:53-102`) and the SEH frames (`RSF_FOREIGN_TRY` at `:194,236,259,276`); `vulkan_sr.rs` mirrors it. Blocked on the same C-unwind pattern as X10 for the SDK calls and on reworking the `native_vulkan_contract`, `native_vulkan_device` and `native_vulkan_dlss_device` fixtures that link the C table. **Done (round 3, Vulkan C):** the 28-entry table and the platform record are a Rust static (`NATIVE` in `vulkan_sr.rs`), selected by the new `ffx-vk` Cargo feature that CMake sets beside `RSF_VULKAN_SR_ENABLED` (without it every backend still reports NOT_COMPILED, as the C selection did). The seven SEH frames are Rust: `call_device_proc` calls the host procedure as C-unwind, and `versions`/`create_effect`/`effective_version`/`destroy_effect`/`plan`/`dispatch` (`vulkan_sr/graphics.rs`) call the SDK through `extern "C-unwind"` pointers (`runtime/vulkan/fsr3/sdk_abi.rs`, generator `--override-abi`), all inside `rsf_streamline_vk::sdk_api::guarded_or` with the C codes they returned. The seven public `rsf_srvk_*` are Rust exports (listed in `native_vulkan_exports.c`); `plan`/`evaluate`/`retire_commands`/`destroy`/`dlss_preset` are the former `rsf_core_srvk_*` renamed; the `rsf_core_srvk_native_*`/`graphics_*`/`ffx_*_desc` exports, the unused `rsf_fsr4_parse_version` export, `vulkan_fidelityfx_native.h`, `vulkan_sdk_native.h` and `native_xess_vulkan.h` are gone. Kept against the audit: `native_sr_vulkan.c` now holds only the FidelityFX layout and value checks of the configured SDK headers against the pinned Rust records (OV-G2's "keep the asserts" option: the one place an SDK bump that changes the ABI fails the build), and `native_xess_vulkan.c` stays as the same kind of XeSS check; both compile only with the vendor headers. The Rust `Platform`/`FfxOps` records stay as the seam `vulkan_sr/owner_tests.rs` fakes. +- [x] **OV-A3 FSR4 Vulkan SR: two C hops and an `InitOnce` to store a Rust pointer.** `native_sr_split_vulkan.c:1-59` (whole file; `rsf_srvk_fsr4_*` -> `rsf_core_srvk_fsr4_*` with a 7-entry C `rsf_split_provider`); `vulkan_sr_split.rs:23,90` (`struct Provider` mirror); `native_sr_fsr4_vulkan.c:132-161` (27-entry `platform_table`, 15 entries Rust, `:163-176` `InitOnceExecuteOnce` to write `rsf_dx12vk_platform_ops()`, a Rust address, into the C table); `vulkan_fsr4_sr.rs:500` (`rsf_core_fsr4vk_create`), `vulkan_fsr4_sr_abi.rs` (198 generated lines). Godot calls `rsf_srvk_fsr4_create` (C) -> `rsf_core_srvk_fsr4_create` (Rust) -> `rsf_fsr4vk_create_admitted` (C) -> `rsf_core_fsr4vk_create_admitted` (Rust). Only C job: the `RSF_VULKAN_FSR4_ENABLED` flag (`native_sr_split_vulkan.c:14-30`). Keep: `#[cfg(rsf_vulkan_fsr4)]` around a direct call from `vulkan_sr_split.rs` into `vulkan_fsr4_sr`; public `rsf_srvk_fsr4_*` exported from Rust; delete `native_sr_split_vulkan.c`, `native_sr_fsr4_vulkan_platform.h`, `vulkan_fsr4_sr_abi.rs` and the table half of `native_sr_fsr4_vulkan.c` (guards per X10). Tests: `tests/native_vulkan_exports.rs:32-38`, `native_sr_fsr4_state` (`tests/native_sr_fsr4_state.c`), `native_sr_fsr4_vulkan_main.c`. Confidence: h. **Open (stage B):** the C `rsf_split_provider` is also what lets targets link the Runtime archive without the Vulkan FSR4 leaves (`native_sr_split_vulkan.c` says so); a Rust table naming the C `rsf_fsr4vk_*` leaves under a feature can leave those symbols unresolved in such targets, so this waits for the SEH wrappers in `native_sr_fsr4_vulkan.c` to become Rust (X10) or a build that checks the links. **Reconciled against the tree:** Unfinished: `runtime/orchestrator/src/native_sr_split_vulkan.c` (71 lines, `rsf_split_provider` `:4-27`), `native_sr_fsr4_vulkan_platform.h` and the `platform_table` plus `InitOnceExecuteOnce` in `native_sr_fsr4_vulkan.c:118-161` remain; `vulkan_fsr4_sr_abi.rs` is gone (generated at build). Constraint: `native_sr_split_vulkan.c:14-30` (`RSF_VULKAN_FSR4_ENABLED`) lets targets link the Runtime archive without the Vulkan FSR4 leaves, so a Rust table needs the X10 guards or a build that checks every such link. **Done (round 3, Vulkan C):** `native_sr_split_vulkan.c`, `native_sr_fsr4_vulkan.h` and (with X10) `native_sr_fsr4_vulkan.c`/`native_sr_fsr4_vulkan_platform.h` are deleted. The seven public `rsf_srvk_fsr4_*` are Rust exports in `vulkan_sr_split.rs` (listed in `native_vulkan_exports.c`); they pass `vulkan_fsr4_sr::PROVIDER` when the new `fsr4-vk` Cargo feature is on (CMake sets it beside `RSF_VULKAN_FSR4_ENABLED`, which Godot still reads) and null otherwise, which keeps NOT_COMPILED. The `rsf_fsr4vk_*` owner functions and `rsf_core_srvk_fsr4_*` are plain Rust; `rsf_fsr4vk_info` stays exported for `tests/native_sr_fsr4_vulkan_main.c`, whose header now declares it. The link constraint is gone: every entry the provider names is Rust in the Runtime archive. Kept: the Rust `Provider` record as the seam of the `vulkan_sr_split.rs` unit tests (disabled and stub providers). +- [x] **OV-A4 Vulkan latency: 14 forwarders that each pass one static Rust-filled table.** `native_latency_vulkan.c:6-42` (`rsf_vk_streamline_calls` at `:24`: 16 `rsf_vk_sl_*` from `runtime/vulkan/streamline/lifecycle/src/win32{,/bridge}.rs:64,90,230,256,296,493`, plus 5 `rsf_fgvk_*` from `vulkan_fg.rs`), `:44-85` (14 public exports `rsf_latencyvk_*`/`rsf_slvk_*` -> `rsf_core_*(&platform, ...)`), `:87-118` (4 wrappers choosing a Rust resolver or `NULL`); `vulkan_latency_platform_abi.rs` (151 generated lines from `native_latency_vulkan_platform.h`). Once `rsf-streamline-vk` is an rlib (OV-C1) every entry is a direct call and `RSF_HAVE_STREAMLINE_VK` becomes a cfg. Keep: direct calls in `vulkan_latency.rs`, `#[no_mangle]` public exports on the Rust side, `rsf_latencyvk_cpu_service` as a Rust static; delete `native_latency_vulkan.c`, `native_latency_vulkan_platform.h` and its binding. Tests: `rsf_vk_latency_fixtures_rust` (`tests/CMakeLists.txt:678`), `tests/game-sdk/src/vk_latency_calls.rs` (bindgen of `native_latency_vulkan_presentation.h`, generator `:685-696`); Godot Reflex/PCL live. Confidence: h. **Done (stage B):** the table types, the production table and all public `rsf_latencyvk_*`/`rsf_slvk_*` entries are Rust (`vulkan_latency.rs`); `streamline-vk` and `antilag-vk` Cargo features replace `RSF_HAVE_STREAMLINE_VK`/`RSF_HAVE_ANTILAG_VK`; `native_latency_vulkan.c`, `latency_amd_vulkan.c`, `native_latency_streamline_exceptions.c` and `native_latency_vulkan_platform.h` are deleted; the latency/Anti-Lag fixtures build their own table through `rsf_orchestrator::vulkan_latency_api`; `native_vulkan_exports.c` carries the DLL export directives. The Streamline calls are declared against the bridge's exported ABI (`sl.def`), which has a real external consumer. +- [x] **OV-A5 Vulkan DLSS SR and DLSS-G leaf tables: 36 entries, 34 Rust.** `native_dlss_vulkan.c:13-27,40-59` (18 entries, 16 `rsf_core_vkdlss_sdk_*`, plus `rsf_slvk_invoke` and two C one-liners), `:30-38` (`capture_parameters` -> C `rsf_capture_sr_parameters` in `input_dump.c:36`; `preset_valid` -> `rsf_dlss_preset_valid` in `dlss_preset.h:9-12`); `native_fg_dlss_vulkan.c:9-45` (18 entries, all Rust); `vulkan_dlss_sr_abi.rs` (341), `vulkan_dlss_sr/leaves.rs`, `vulkan_dlss_fg/leaves.rs`. Preset validity is implemented three times (C `dlss_preset.h:9-12`, Rust `streamline_sr.rs:117-119`, `dlss_pipeline/platform.rs:294`; see OC-E1); `vulkan_sr/xess/native.rs:292` and `vulkan_sr/graphics.rs:339` already call `rsf_capture_sr_parameters` from Rust. Keep: direct calls and `streamline_sr::preset_valid`; delete both C files and the `rsf_vkdlss_platform`/`rsf_dlgvk_platform` records and `tests/vulkan-fg/src/dlss_abi.rs` (generated from `tests/vulkan-fg/dlss_abi.h`, 1,919 lines, which exists to reach `rsf_dlgvk_platform`). Tests: `rsf_dlss_vulkan_fixture_rust` (`tests/CMakeLists.txt:947`). Confidence: h. **Open (stage B):** the DLSS SR table is reached through `native_sr_vulkan.c`'s SR platform (OV-A2) and the DLSS-G table through the FG dispatch (OV-A1) and `tests/vulkan-fg/src/dlss/sdk.rs`; every entry is Rust now (`rsf_slvk_invoke` included), so it moves with those two. **Reconciled against the tree:** Unfinished: `runtime/orchestrator/src/native_dlss_vulkan.c` (63 lines) and `native_fg_dlss_vulkan.c` (95) remain, and `tests/vulkan-fg/dlss_abi.h` still feeds `tests/vulkan-fg/build.rs:9`; `vulkan_dlss_sr_abi.rs` is gone (generated at build). Every entry is Rust, but the tables are reached through `native_sr_vulkan.c` (OV-A2), the FG dispatch (OV-A1) and the fixture `rsf_native_fg_dlss_vulkan_test` (`tests/CMakeLists.txt:771-778`, compiles `native_fg_dlss_vulkan.c`), so this moves with those two. **Progress (round 3, Vulkan C):** the DLSS SR half is done: `native_dlss_vulkan.c` is deleted, `vulkan_dlss_sr/leaves.rs` holds the table as a Rust static (`NATIVE`, chosen by `vulkan_dlss_sr::native_leaves()` under the `streamline-vk` feature, the former `RSF_HAVE_STREAMLINE_VK`), `capture_parameters` calls `rsf_capture_sr_parameters` from Rust and `preset_valid` is `streamline_sr::preset_valid`, and the 15 `rsf_core_vkdlss_sdk_*` lost `no_mangle`. The DLSS-G half is done with OV-A1: `native_fg_dlss_vulkan.c` is deleted, its table is the Rust static `rsf_dlgvk_leaves` in `vulkan_dlss_fg/leaves.rs` (exported under that name because `tests/vulkan-fg/src/dlss/sdk.rs` wraps its entries), the 15 `rsf_core_dlgvk_sdk_*` lost `no_mangle`, and `rsf_dlssgvk_*` are Rust. Kept: `tests/vulkan-fg/dlss_abi.h` (that fixture's binding of the table it wraps) and `native_fg_dlss_vulkan_platform.h`, which feeds it. **Correction (item 3):** `tests/vulkan-fg/src/dlss/sdk.rs`, `tests/vulkan-fg/dlss_abi.h` and `native_fg_dlss_vulkan_platform.h` no longer exist; the table is the `pub(super)` Rust static `LEAVES` in `vulkan_dlss_fg/leaves.rs`, which the in-crate fixture `vulkan_dlss_fg/fixture/sdk.rs` copies and overrides. +- [x] **OV-A6 XeSS Vulkan SR exports forward and supply a compile-flag table pointer.** `native_xess_vulkan.c:41-58` (four `rsf_xessvk_*` -> `rsf_core_xessvk_*(RSF_XESSVK_NATIVE_PLATFORM, ...)`), `vulkan_sr/xess.rs:193`. Keep: `#[no_mangle]` on the Rust functions with a cfg; keep the XeSS SDK-record `_Static_assert` block `:15-25` only while the Rust records are hand-written (OV-G2). Confidence: h. **Done (stage B):** the four `rsf_xessvk_*` entry points are Rust exports choosing the table with the `xess-vk` feature; `native_xess_vulkan.c` keeps the SDK layout asserts and the DLL export directives. +- [x] **OV-A7 D3D12 FSR/XeSS backend C stubs: Rust -> C -> Rust to pass one flag.** `runtime/backends/fsr/src/fsr_backend.c:1-29`, `fsr_generation.c:1-21`, `runtime/backends/xess/src/xess_backend.c:1-21`, `xess_generation.c:1-15` turn `RSF_HAVE_FFX`/`RSF_HAVE_XESS`/`..._FG` into a `compiled` argument (for FSR also pass `rsf_fsr4_compat_acquire_native_device`/`release` from the compat staticlib); callers `sr_session.rs:147-162` (C `rsf_fsr_managed_sr_provider`, `rsf_xess_sr_provider`), `d3d11_present_native.rs:29,364` (C `rsf_generation_fsr4_supported`); targets `d3d12_sr/legacy.rs:208,224,231`, `d3d12_generation/fsr_native.rs:456,498`, `xess_native.rs:375`. `fsr_backend.h`/`xess_backend.h` repeat `runtime/contract/include/rescaleframe/backend.h:379-382` (`fsr_backend.h:17-18` says so); other callers `runtime/presentation/src/d3d11_present_bridge.c:138-139` and `tests/fsr_backend.c:11-12`. Keep: Rust `#[no_mangle]` `rsf_fsr_sr_provider` etc. with `cfg!(rsf_have_ffx)`, compat lease functions as a Rust dependency call (OV-C1); delete the four `.c` files, both headers and the `rsf_fsr`/`rsf_xess` static libraries (`backends/fsr/CMakeLists.txt:4`, `backends/xess/CMakeLists.txt:4`), keeping the include-path detection that feeds the cfg. The NOT_COMPILED outcome must survive (`runtime/backends/README.md:9`, `backends/fsr/CMakeLists.txt:11-15`); test `tests/fsr_backend.c`. Not flagged: `d3d12_generation/disabled.rs`, `d3d12_sr/legacy.rs` `COMPILED`/`NOT_COMPILED` providers, which are a real build configuration. Confidence: h. **Done (stage B):** CMake passes `RSF_HAVE_FFX`, `_FFX_FG`, `_XESS`, `_XESS_FG` to the Runtime archive as the `ffx`, `ffx-fg`, `xess`, `xess-fg` Cargo features; the getters are Rust exports keeping the NOT_COMPILED providers; the four `.c` files, both headers and `fsr4_compat_platform.h` are deleted; `rsf_fsr`/`rsf_xess` are INTERFACE targets; the D3D12 FSR session calls `rsf-fsr4-compat` for its lease directly. +- [x] **S2.3 + OV-C2 Internal table versioning and the FSR4 INT8 compat platform table.** `runtime/backends/fsr/compat/src/native.rs:65-76` (the only `static PLATFORM`), `lib.rs:262-294` (`rsf_fsr4_compat_acquire` checks `struct_size` and `abi_version`), `:300-328` (`_logged`), `abi.rs:1-104` (bindgen of `runtime/backends/fsr/src/fsr4_compat_platform.h`, `RSF_FSR4_COMPAT_PLATFORM_ABI_VERSION = 1`); `rsf_fsr4_compat_acquire` and `_acquire_logged` are `#[no_mangle] pub` but called only inside the crate (`native.rs:86`, `dx12.rs:73`, `lib.rs:314`); the header is included only by `fsr_backend.c:3`, which uses neither. Version constants at `fsr3/owner.rs:36,41`, `fsr4/owner.rs:38`, `xess-fg/session_records_abi.rs:5`, `compat/src/abi.rs:5` version tables that Rust both builds and reads. Keep: private `struct Platform` of Rust fns (or `cfg(test)` swap), no `struct_size`/`abi_version`, no header, no bindgen; keep `rsf_fsr4_compat_acquire_native_{adapter,device}` and `rsf_fsr4_compat_release` as the only exports (the `runtime/vulkan/fsr4` standalone DLL uses `_adapter`, `fsr4/native.rs:55,230`); versioning only on tables an external host fills. Device acceptance of FSR4 INT8 on NVIDIA: `docs/research/sr-interop-performance-20261002.md`. Confidence: h. **Done (stage B):** the compat platform table, `rsf_fsr4_compat_acquire{,_logged,_native_adapter}`, the FSR4 SR `Platform`, the FSR3 SR/FG `struct_size`/`abi_version` and `RSF_XESS_BRIDGE_PLATFORM_ABI_VERSION` are removed; `fsr4_compat_platform.h` keeps the two entries `fsr_backend.c` calls. The FSR3 and FSR4-FG tables stay unversioned as the test fakes' seam. +- [x] **S2.4 VulkanStory owners: one owner per Vulkan vendor, the orchestrator's (DECIDED, D7).** `runtime/vulkan/fsr3/owner.rs` (2,062 lines plus `platform.rs`) is the standalone VulkanStory FSR3 SR/FG/swapchain owner, next to `vulkan_ffx_fg.rs` (1,741) with `vulkan_ffx_fg/sdk.rs` (1,134); `xess-fg/session.rs` (1,314) sits next to `vulkan_xess_fg.rs` (974). PORT.md:1549 already calls the VulkanStory `rsf_vulkanstory_*` export naming a Rule 1 violation. Keep: the orchestrator's owners with a thin VulkanStory shim; remove the standalone duplicates and their raw-`rustc` builds once the shim passes. Largest single duplication left; changes a shipped DLL. Where: above plus `integrations/vulkanstory/native/{fsr3,ngx}.rs`, `*.def`. Confidence: h (decided). **Done as revised (stage B, D7 ruling):** XeSS-FG, FSR4 and FSR4-FG already had one owner; `fsr3/owner.rs` stays VulkanStoryFsr3's owner as the `rsf-vk-fsr3` package with `.def` aliases. +- [x] **OV-D1 `runtime/vulkan` sources without packages, compiled by `#[path]` and raw `rustc`.** `fsr4/owner.rs` into the compat crate (`backends/fsr/compat/src/lib.rs:14`); `fsr3/owner.rs` by raw `rustc` (`fsr3/build.ps1:38-40`) and into the compat crate's tests (`lib.rs:19`); `fsr4-fg/{sdk,sdk_commands,bridge_abi}.rs` and `runtime/vulkan/dx12_bridge_commands.rs` into the orchestrator (`fsr4_fg_bridge.rs:17-35`, `allow(clippy::duplicate_mod)` `:29`); `xess-fg/session.rs` into the orchestrator (`lib.rs:421`) and by raw `rustc` (`xess-fg/build.ps1:43-45`). Back-edges: `xess-fg/session.rs:18` (`orchestrator/src/d3d12_generation/xess_abi.rs`), `xess-fg/capture.rs:47` (`sdk/game/src/frame_abi.rs`), `fsr4/native.rs:24,26` (`orchestrator/src/d3d12_sr/*`), `fsr3/owner.rs:20,31` (`sdk/game/src/ffi_util.rs`, `integrations/vulkanstory/native/fsr3.rs`), `ngx/src/lib.rs:6`. The raw `rustc` builds bypass `Cargo.lock` and workspace `[lints]` and repeat `-D unsafe_op_in_unsafe_fn` by hand (`fsr3/build.ps1:39`, `xess-fg/build.ps1:44`), while `fsr4`, `streamline`, `ngx` scripts use `cargo build -p`. Keep: Cargo packages `rsf-vk-fsr3`, `rsf-vk-fsr4`, `rsf-vk-fsr4-fg`, `rsf-vk-xess-fg` (`["rlib","staticlib"]`, or `cdylib` for fsr3) and one `rsf-vk-dx12-bridge` package for `timeline_pair.rs`, `dx12_bridge_commands.rs`, `dx12_provider_module.rs`; `cargo test --workspace` then covers them under workspace lints. Subject to D7 (the standalone owners may be retired instead). Confidence: h. **Done (stage B):** `rsf-vk-fsr3` and `rsf-vk-xess-fg` are workspace packages (no raw `rustc`); the FSR4 SR sources moved into `rsf-fsr4-compat` and the FSR4 FG sources into `runtime/orchestrator/src/fsr4_fg_bridge/`; `dx12_bridge_commands.rs`, `dx12_provider_module.rs`, `timeline_pair.rs` and `completion.rs` are one `rsf_fsr4_compat::dx12_bridge` module; the XeSS SDK records moved into `rsf-vk-xess-fg`. +- [x] **OV-D2 + BT-05 (receipt part) Corrected-Streamline receipt checked in three places.** `runtime/orchestrator/CMakeLists.txt:95-125` (receipt JSON, source and binary hashes), `runtime/vulkan/streamline/build.ps1:44-60` (same fields, also builds `VULKANSTORY_CORRECTED_STREAMLINE_SHA256` byte list as CMake does at `:121-124`), `eng/build-godot.ps1:60-72`. Keep: one verifier (`runtime/vulkan/streamline/sdk-fixes/verify-receipt.py` or a PowerShell function) called by all three, or keep the CMake check and have the scripts call `cmake -P`. Pins: see BT-05. Confidence: m (the CMake check also injects the digest). **Done (stage B):** `runtime/vulkan/streamline/verify-receipt.cmake` is the one verifier; the Runtime build includes it and `streamline/build.ps1` and `eng/build-godot.ps1` run it with `cmake -P`. +- [x] **OV-D3 `bridge.c` exists only to inject a digest.** `runtime/vulkan/streamline/bridge.c:1-25`, CMake define `orchestrator/CMakeLists.txt:124`, `build.ps1:57-58`. Keep: `option_env!("RSF_CORRECTED_STREAMLINE_SHA256")` parsed in `lifecycle/build.rs`, or a `cargo:rustc-env`; removes the C file and the C call into `rsf_slvk_open_verified`. Confidence: m. **Done (stage B):** the digest reaches `rsf-streamline-vk` as the Cargo build variable `RSF_CORRECTED_STREAMLINE_SHA256` (`rsf_add_rust_static` takes an optional `ENV`), parsed at compile time in `win32/verified.rs`; `bridge.c` and the `rsf_slvk_open_verified` export are gone. +- [x] **OV-G1 Vulkan format, layout and usage values typed out in 14 files next to `ash`.** `vulkan_sr.rs:35-38`, `dx12_vulkan_interop.rs:18-19`, `vulkan_dlss_fg.rs:49-50`, `vulkan_dx12_fg.rs:39-41`, `vulkan_ffx_fg.rs:51-52`, `vulkan_external_copy.rs:8-9`, `vulkan_fg_copy.rs:78-80`, `vulkan_fsr4_sr.rs:48`, `runtime/vulkan/fsr3/owner.rs:52-56`; DXGI value sets in `fsr4/owner.rs:69-71` and `fsr4_fg_bridge.rs:56-57` repeat `dxgi_format.rs:4` and `sr12.rs:45-53`. `ash` 0.38 is a dependency of every crate involved (`orchestrator/Cargo.toml:23`, `lifecycle/Cargo.toml:18`, `compat/Cargo.toml:19`) and two modules already use it (`vulkan_ffx_fg/sdk.rs:82-83`, `vulkan_dlss_sr/commands.rs:19,23`; `vulkan_fsr4_sr/state_fixture.rs:16-18`). Keep: `vk::Format::R16G16_SFLOAT.as_raw()` and the like, or the `windows` `DXGI_FORMAT_*`. Confidence: h. **Done (stage B):** the Vulkan owners and both FSR4 bridges take format, layout, usage, access, result and queue-family values from `ash` and `windows`; `rsf-vk-fsr3` keeps its five format numbers because it depends on neither crate. +- [x] **OV-G2 C `_Static_assert` blocks that check the hand-declared Vulkan values.** `native_xess_vulkan.c:28-36`, `native_sr_vulkan.c:174-199`, `native_sr_fsr4_vulkan.c:42-49` (each "used by vulkan_*.rs"); after OV-G1 they compare enum values `ash` takes from the same registry. The vendor-record asserts (FFX descriptor offsets `native_sr_vulkan.c:107-173`, XeSS `native_xess_vulkan.c:15-25`) have a job while the Rust records are hand-written and become redundant after S1.3. Keep: the vendor-record asserts until S1.3 lands. Confidence: h (Vulkan-value asserts), m (vendor-record ones). **Vulkan half done (stage B):** the Vulkan-value asserts in `native_sr_vulkan.c`, `native_sr_fsr4_vulkan.c`, `native_xess_vulkan.c` and `vulkan_ffx_fg/sdk.rs` are gone; the vendor-record asserts stay until S1.3's records replace the hand-written ones. **Vendor half (D22):** kept. The FFX and XeSS Rust records are now bindgen output (`fsr3/sdk_abi.rs`, `vulkan_sr/xess_sdk_abi.rs`), but their generators take the gitignored SDK checkouts and run by hand (`eng/verify.ps1:34`), so the C asserts are the only build-time check that the configured SDK matches the committed bindings. +- [x] **OV-G3 Private result codes translated back to backend codes.** `runtime/vulkan/fsr4-fg/bridge_api.h:8-10` (`-13001..-13003`), `xess-fg/bridge_api.h:10-11` (`-10001..-10002`), `vulkan_dx12_fg.rs:27-28` (redefines `-13001/-13002` as INVALID/ABI_MISMATCH), `vulkan_fg.rs:33-42` (`rsf_core_fgvk_provider_result`), `native_fg_vulkan_dispatch.c:157,195` (calls the mapper from C). Inside the Runtime the bridges are Rust modules and could return `RSF_BACKEND_*`. Keep: backend codes internally; map at the standalone `.def` exports only (D24). Confidence: l-m (needs a check of what VulkanStory reads). **Open (stage B):** `rsf_core_fgvk_provider_result` is called from `native_fg_vulkan_dispatch.c`, so the internal codes go with OV-A1; the XeSS `-10001/-10002` codes are VulkanStoryXessFg's public ABI and stay at its exports. D22 check: the mapper also folds every other FSR4/XeSS failure into `FEATURE_FAILED`, so returning backend codes from the FSR4-FG bridge changes what the factory reports unless all of its about 78 result sites in `fsr4_fg_bridge*`, `vulkan_fsr4_fg.rs` and `vulkan_dx12_fg*` are audited with OV-A1. **Done (audit, D24 kept against):** the FSR4 and XeSS Vulkan FG providers return one integer channel that carries VkResult values (`vulkan_dx12_fg.rs` returns `-1` out of host memory, `-3`, `-7` extension not present, `-11` format unsupported and others from create, prepare, hudless, status, drain and destroy, and `images`/`acquire`/`present` hand them to the WSI layer unchanged) next to the bridge codes; backend codes `-1`, `-2` and `-7` collide with VkResult errors, so the `-13001..-13003` codes are what keeps argument, ABI and support failures distinguishable, and `rsf_core_fgvk_provider_result` is the one place they become backend codes. Returning backend codes internally would need typed errors through the shared DX12-Vulkan FG layer, a new abstraction rather than a deletion. FSR4-FG has no VulkanStory export; the XeSS `-10001/-10002` codes stay at the `rsf_vk_xess_fg_*` exports VulkanStoryXessFg.dll serves (`XessFgRuntime.cs` reports them). Removed: the literal redefinition in `vulkan_dx12_fg.rs` and the mapper's literals (both name the bridge constants), and `vulkan_fg.rs`'s local backend-code copies. +- [x] **OV-H1 Four independent `slInit`/`slShutdown` owners.** `dlss_streamline.rs:39-55` (D3D11 SR, `c"slInit"` :47), `dlss_native12.rs:42-55` (D3D12 SR, :43), `streamline_host/startup.rs:21-36` (D3D12 FG/Reflex host, :22), `runtime/vulkan/streamline/lifecycle/src/win32/bridge.rs:102-103` (Vulkan); each resolves the interposer, owns init/shutdown, detects an already-loaded interposer (`dlss_streamline.rs:381`, `dlss_native12.rs:265`, `streamline_host/startup.rs:81-82`) and keeps preferences. The D3D SR owners already defer to the host when one exists. Keep: one D3D owner (`streamline_host`) that SR borrows plus the Vulkan lifecycle; going further, one owner parameterised by graphics API (D22; Rule 1). Behaviour differs in when each path initialises. Confidence: m. **Done (D22):** the D3D owners share one loader (`streamline_sdk::load_interposer`, `interposer_loaded`), one entry table and one record set; SR borrows the host's module, table and native device through `streamline_host::shared` instead of resolving the host's module again; the two SR `Platform` tables and their leaf files are gone. Kept against the audit: the SR-only routes still call slInit/slShutdown when no host exists, because the host creates or adopts a D3D12 device and queue and upgrades them, so it cannot register a D3D11 device and would hand a D3D12 game a proxy device; init order and results are unchanged (`docs/research/rust-d3d11-sr-pipeline-cutover.md`, D22 section). +- [x] **OV-H2 Two interposer admission policies for the same file.** `streamline_sr/signature.rs:1-9,337` (435 lines: OS strong-sign policy, exactly one nested signature, pinned NVIDIA RSA key; used by `streamline_sr/native.rs:25`, `streamline_host/native.rs:72`) versus `lifecycle/src/win32/verified.rs:20-145` (WinVerifyTrust plus a pinned SHA-256 of the exact build read through the load handle; digest from `bridge.c:9-25`). Vulkan needs the digest because the corrected interposer is unsigned (`bridge.c:21-22`); the D3D path could use the same verified-handle load for the retail digest. Keep: one admission module (in the lifecycle crate after OV-C1) with two inputs: required digest or required NVIDIA key (D22). Confidence: m. **Done:** `rsf_streamline_vk::admission` holds `nvidia_signed` (D3D owners, MFG prime) and `open_by_digest` (Vulkan lifecycle) over one System32-loaded `WinVerifyTrust` call; `streamline_sr/signature.rs`, `win32/verified.rs` and the `rsf_dlss_sdk_verify_signature` export are deleted. The D3D path keeps the signature check (no D3D digest admission, which would change what retail installs load). +- [x] **OV-I1 `runtime/vulkan/ngx/build.sh` and `build.ps1` are the same freshness check plus `cargo build`.** `build.sh` (70 lines, with Linux and Darwin branches and `libVulkanStoryNgx.so` output) and `build.ps1` (56); `rsf-vulkanstory-ngx` always builds with `vulkanstory-compat` from both scripts. Keep: one if VulkanStory builds on one host OS. Confidence: l (external consumer). **Kept (stage B):** VulkanStory ships `libVulkanStoryNgx.so`, so the Linux script has a consumer. **Reconciled:** kept as the entry says; `runtime/vulkan/ngx/build.sh` is the Linux build that produces `libVulkanStoryNgx.so` for VulkanStory (external consumer). + +### Round 2: Orchestrator Vulkan and backends + +Logic review of `vulkan_*`, `dx12_vulkan*`, `fsr4_fg_bridge*`, `runtime/vulkan/**` and `runtime/backends/**`, largest modules first. + +- `vulkan_capture_commands.rs`: deleted the twelve `rsf_vk_capture_*` exports; no Rust, C, header, `.def` or `GetProcAddress` caller (the capture owners use `Commands` directly). +- `xess-fg/capture.rs`: the `wcstoull` port (sign wrap, 32-unit buffer, 32k directory check) for three diagnostic settings is a trimmed `str::parse`; malformed values keep the default. `frame_capture_vk.rs::parse_count` is a second copy (orchestrator core area). +- `vulkan_ffx_fg.rs`: `rsf_core_ffxgvk_create_sdk` no longer repeats `create`'s size/ABI/create-info checks; `Swapchain::read` returns `Option`, `structure_valid` is gone; tests pass a real `VkSwapchainCreateInfoKHR`. +- `compat/src/vulkan_bridge`: `commands.rs` deleted; the `Capsule` methods hold the D3D12 calls and call `dx12_bridge` directly (four were one-line forwards). +- `fsr4_fg_bridge`: the `graphics!` macro and three hand wrappers in `native.rs` deleted; the `commands.rs` functions take the capsule handle and are the platform-table entries. +- `vulkan_fg_frames.rs`: one `slot_index` for the DLSS-G, FFX and DX12-backed FG owners (three copies before). +- `vulkan_dlss_fg.rs`, `vulkan_sr_session.rs`, `vulkan_ffx_fg/sdk.rs`: import `rsf_game_sys::backend_result` instead of redeclaring the codes (S1.4 leftovers). +- Comments: port-history narration ("formerly *.cpp", "as before", "the previous C++ owner") removed in ten files. +- Kept: the FG providers' own setup checks (the C dispatch and the `tests/vulkan-fg` fixtures call providers directly; goes with OV-A1); the `extern "C"` blocks in `vulkan_fsr4_fg.rs`/`vulkan_xess_fg.rs` that name in-crate `RsfFsr4Fg*`/`rsf_dx12vk_interop_*` (typed `Handle` in `InteropOps`, retyping goes with OV-A1); Vulkan latency and PCL counters and `generated_callbacks` (read by the Godot demo scripts); Vulkan and XeSS-FG timing and capture diagnostics (documented in `docs/research`); the Streamline lifecycle diagnostics (`sl.def` exports); `vulkan_sr_session/linked.rs` (Godot `#[path]` link seam); the DX12 FG `frame_valid` (merging into `valid_source_record` would add near/far/FOV refusals); `can_signal_done` in `rsf-vk-xess-fg` (a crate without the compat dependency); `fsr3/owner.rs` per D7. +### Runtime shared and loader + +Scope: `runtime/graphics`, `runtime/presentation`, `runtime/shader_patch`, `runtime/common`, `ui/overlay`, `sdk/game`, `loader/**`, `integrations/windows`. + +- [x] **RS-A1 Rust -> C table -> Rust: the D3D11 present platform.** `runtime/presentation/src/d3d11_present_bridge.c:73-130` declares about 45 `rsf_d3d11p_native_*` externs and `:173-210` fills `rsf_d3d11p_platform platform` (72 slots, asserted at `:50-67`); `d3d11_present_platform.h` (287 lines) declares the table and 77 leaves. The "native" functions are Rust (`runtime/orchestrator/src/d3d11_present_gpu.rs:23,175`, `d3d11_present_factory.rs:93`, `d3d11_present_native.rs` (41 references), `d3d11_present_dxgi.rs`, `d3d11_present_facade.rs`); `create_hook` calls `rsf_d3d11p_factory_intercept(&platform, ...)` back into Rust. Only C-only parts: SEH wrappers around foreign C++ exceptions (`leaf_create_original` :165, `bootstrap_factory` :232, the `create_hook`/`hwnd_hook` detours), the MinHook calls `initialize_hooks`..`remove_factory_hook` (`:240-257`), and `leaf_host_*` (`:144-164`, void* casts). `docs/research/rust-d3d11-present-cutover.md:14`: each leaf "is one existing native step on the facade", "Leaves never call back into the owner". Keep: the Rust owner calls its own functions directly (`pub(crate) fn`); one small C file with the SEH wrappers and detour entry points; removes the offset asserts and the 72-field mirror in the orchestrator bindgen. Do with S1.1. Tests: `d3d11_present_bridge`, `d3d11_present_api_contract`, `d3d11_present_api_c11_contract` (`tests/CMakeLists.txt:658`, `tests/d3d11_present_api.cmake:17-18`). Confidence: h (shape), m (how much of the 355 + 287 lines goes). **Done:** the owner calls a `leaf` module (the native functions, or the fakes under `cfg(test)`), so the 72-slot table, `d3d11_present_platform.h`, the hand mirror and both offset-assert sets, the Owner's platform pointer and the `PLATFORM` test table are gone; the public `rsf_d3d11_present_*` entry points and MinHook installation are Rust, and `d3d11_present_bridge.c` keeps only the SEH-guarded foreign calls and the two factory detours. The fake leaves stay: every test drives the owner's full creation path, so a narrower fake first needs the policy split from its leaf calls, and that needs a test run this pass does not make. Round 5 left them for the same reason. +- [x] **RS-A2 + BT-03 One AC7 research carrier built into two DLLs, one of them the shared shim (decision D21).** `loader/proxy/CMakeLists.txt:2-5` (`rsf_proxy_dinput8` = `dinput8_proxy.c` (75,640 B) + `dlss_bridge.c` (199,487 B) + `preferences.c`) and `:75-79` (`rsf_proxy_ac7` = the same three files, `:76-77` copies the link list, `:78` aliases `DllMain`); `:5-18` links `OrchestratorCore`, `AC7SceneColor`, `AC7UIRules`, `AC7View`, `AC7MotionCapture`, `AC7VelocityPass` into `rsf_proxy_dinput8`; `:37` adds `shim_entry.c`, which passes `rsf_ac7_proxy_process_event` and `rsf_ac7_carrier_executable` into `rsf_shim_attach` (`loader/src/windows/shim.rs:127,130-146`, `Ac7Executable`/`Ac7Attach`). 5,512 lines of C (jitter stub patching, render-scale and translucency RVAs, crash reporter, overlay actions: `dinput8_proxy.c:597-760,1038-1330,1496-1675`) are compiled and linked twice and put AC7 game policy (RVAs, `RSF_DLSS_*` settings) into a generic loader (Rule 1; AGENTS.md calls `rsf_proxy_dinput8` the "shared Windows shim; Unity drop-in carrier", `carriers/version.dll`, `loader/proxy/CMakeLists.txt:41-46`). Keep: `rsf_proxy_dinput8` becomes only the version-forwarding shim (`shim.rs`, `forwarding.rs`, `version_forwarders.asm`, `shim_exports.def`); `rsf_proxy_ac7` keeps the sources (or build them once as an OBJECT library with a tiny entry file like `shim_entry.c`); drop `add_dependencies(... rsf_game_ac7)` (`:22`), the AC7 link libraries and the `rsf_shim_attach` AC7 parameters. Carrier exports are ordinal-sensitive. Tests: `shared_shim_exports` (`tests/CMakeLists.txt:196`), `ac7_proxy_startup`, `game_plugin_contract`, `eng/build-unity-sr.ps1:32`; confirm `tools/package-ac7.py:109-126` stages the overlay for the dedicated carrier and no flow loads AC7 through the shim. Confidence: h (double build), m (no flow depends on it). **Note (integrations/loader reduction):** done. `rsf_proxy_dinput8` is now only `shim_entry.c`, the version forwarders and `shim_exports.def` (MSVC); `rsf_proxy_ac7` links the AC7 libraries and defines `DllMain` directly; `rsf_shim_attach(instance, event)` lost its AC7 parameters and `rsf_ac7_carrier_executable` is gone. Verified only by reading `package-ac7.py`, `deploy-ac7-proxy.ps1` and the Unity scripts: none loads AC7 through the shim. +- [x] **RS-A3 Legacy D3D11 binding-matcher renderer in `dlss_bridge.c` (decision D1).** `loader/proxy/src/dlss_bridge.c:2-5` ("compatibility fallback for refused native hooks"); reachable only at `:3854-3858` when `rsf_plugin_session_start` is refused; under native ownership `on_pass/on_target_draw/on_input_draw/on_candidate_draw` are `NULL` (`:3861-3867`) and about forty `native_owner` guards skip the rest (`:889,1021,1092,1546,1594,2316-2369,2764,2822,3313,3363,3371,3575`). Feeding headers: `runtime/graphics/include/rescaleframe/scene_promote.h` (214), `depth_replay.h`, `present_blit.h` (README: "Superseded by `fullscreen_pass` ... until the debug view moves across"), `ui_identify.h`, `ui_layer.h`, `constant_twin.h`, `resource_roles.h`, and `runtime/graphics/README.md` sections "Interface extraction" and "Scene promotion" ("historical compatibility mechanisms"). If removed: orchestrator `frame_tap.rs` (3,447), `scene_promote.rs` (680), `depth_replay.rs` (375), `ui_layer.rs`, `constant_twins.rs`, `tests/frame_tap.c` (1,745), `tests/g02/*` shrink with it. `rsf_frame_tap_install` (`:3868-3870`) stays (`on_geometry`, AC7 motion capture). Keep: either a hard native-controller-or-no-SR failure with the legacy plans deleted, or keep. Tests: `frame_tap`, `ac7_session`. Confidence: m. **Note (integrations/loader reduction):** done for the carrier (D1): `dlss_bridge.c` 4,184 to about 985 lines, SR runs only through the native controller and a refused activation leaves the game without SR; the tap keeps `on_geometry` only. Open for the runtime owners: `scene_promote`, `depth_replay`, `present_blit`, `ui_identify`, `ui_layer`, `constant_twin` and `resource_roles` headers, their orchestrator modules, `frame_tap` role/plan code and `tests/frame_tap.c`, `tests/g02/*` no longer have a caller in the carrier. The carrier-side jitter stub, render-scale keeper and translucency-scale patches in `dinput8_proxy.c` also run only before native start; they are candidates for the AC7 owner. Runtime side done: the plans (scene_promote, depth_replay, present_blit, ui_identify, ui_layer, constant_twin) and their modules, resource_roles, the frame tap's matcher, plans, divert, override, watches and provenance, AC7's UI rules and scene-colour selection, `tests/frame_tap.c` and `tests/g02` are gone; the observer's layout hook, which only the matcher installed, is restored for the velocity pass. The carrier's jitter stub and render-scale keeper are deleted with it, and the translucency-scale patch moved into the AC7 carrier. +- [x] **RS-A4 + S6 Census: platform tables as the interface between four C leaves and Rust.** `loader/census/src/census_platform.c:74-137` builds five tables (`vk_platform`, `ngx_platform`, `misc_platform`, `fsr_platform`, `vendor_platform`) and `d3d_guarded_platform.c:100-122` two more, each starting with the same `rsf_census_safe_read`, `rsf_census_read_arg_string`, often `read_wide`/`format_decimal` (`:61-66`, `:94-100`, `:109-114`, `:121-124`); `loader/census/src/hook_platform.c:10-35` has eight static forwarders (`hook_initialize` -> `MH_Initialize`, `hook_create`, `hook_create_api`, `hook_remove`, `hook_enable`, `hook_apply`, `hook_disable`, `hook_current_teb` -> `NtCurrentTeb`) packed into `rsf_census_hook_platform_table`. Mirrors: 12 `*_platform.h` (305 lines; `json`, `decode`, `wrapper`, `hook`, `record`, `stats`, `session`, `vendor`, `ngx`, `d3d`, `misc`, `fsr`) with 12 `loader/src/census/*_abi.rs` (918 generated lines) plus `census_internal.h:196-200`, serving 4 C files in `loader/census/src`. Real C needs: SEH reads and calls through foreign vtables (`guarded_platform.c`, `d3d_guarded_platform.c`, `read_ngx_parameter`, `read_streamline_frame`). Keep: Rust `extern "C"` declarations for the SEH leaves (`rsf_census_safe_read`, `..._read_arg_string`, `..._vtable_slot`, `read_ngx_parameter`), direct `MH_*` calls via one `minhook` module, `NtCurrentTeb` from `windows-sys`; delete `hook_platform.c/.h`, `hook_abi.rs` and the per-vendor `*_platform.h`/`*_abi.rs`. Check each header against what the C leaves actually need. Diagnostic probe only (consumers: RDR2 ASI `games/rdr2/CMakeLists.txt:21`, tests `vendor_census`, `vendor_census_layouts_`, `vendor_census_dllmain`). Confidence: h. **Note (integrations/loader reduction):** not done, on purpose: the platform tables keep `rsf_loader_rust` free of unresolved `MH_*` and census symbols, so the thin, shim and plugin carriers that link the same staticlib still link. Dropping them needs a link of every carrier to prove no census object is pulled in; do it with a build, not by reading. **Done (seam kept):** one `rsf_census_platform` (`census_platform.h`) replaces the hook, core, vendor, vk, ngx, misc, fsr and d3d tables and names each leaf once; Rust binds the D3D wrappers and describes resources itself, `hook_platform.c/.h`, `vendor_platform.h`, `decode_platform.h`, `ngx_platform.h` and the record-writer and stats-names records are gone. The table itself stays because `rsf_loader_rust` is linked into the thin, shim and plugin carriers without MinHook or these leaves. The json/record/session/stats headers, which only fed Rust bindgen, are Rust records in `census.rs`. +- [x] **RS-B2 PE header parsing: five Rust parsers and one C.** `runtime/common/src/pe32_plus.rs:1-121` (bounds-checked `Pe32Plus::parse`), `loader/src/diagnostics/measure.rs:40-52`, `loader/src/diagnostics/dump.rs:87-246`, `loader/src/census/static_scan.rs:170-181` (each parses `e_lfanew`, `NumberOfSections`, `SizeOfImage`), `loader/diagnostics/src/module_dump.c:11-27` (`rsf_dump_nt_headers`); outside the area `games/rdr2/src/asi.rs`, `games/anomaly/src/native_hooks.rs`, `games/skyrim-se/src/compatibility.c`. Keep: `pe32_plus.rs` extended with the in-memory view (in-memory modules and file images differ in alignment, so the type must cover both); the C `module_dump.c` parser stays only if the C writer stays. Tests: `module_dump_self`, `module_dump_v2`, `module_dump_entropy`. Confidence: m. **Note (integrations/loader reduction):** not done: medium confidence, file image versus in-memory view needs tests (`module_dump_self`, `module_dump_v2`). **Done:** `pe32_plus::Mapped` reads mapped NT headers through the caller's guarded copy; `measure.rs`, `dump.rs`, `rtti.rs`, `census/static_scan.rs` and rdr2 use it, and `rsf_patch_code` moved to Rust so `module_dump.c` keeps only the module-list stream. Anomaly's DOS/PE fact reads stay (an FFI contract with its own failure fixtures). +- [x] **RS-B3 + S7.3 Cross-crate `#[path]` of Rust files that have no crate (adds to mechanism 4); `sharpening_defaults.rs` undeclared.** `runtime/common/src/vulkan_negotiation.rs` (619 lines) included at `integrations/godot/native/platform.rs:417`; `vulkan_extensions.rs` (33) by `vulkan_negotiation.rs:9` and `games/unity-mono/src/vulkan_resolver.rs:42`; `pe32_plus.rs` at `games/skyrim-se/src/compatibility.rs:9` and `runtime/orchestrator/src/d3d11_observer_module.rs:10`; `runtime/common/Cargo.toml` is `crate-type = ["staticlib"]` and `src/lib.rs` declares none of these. `runtime/graphics/src/d3d11_observer_layout_abi.rs`, `dxbc_chunks.rs`, `shader_hash.rs` included by `runtime/orchestrator/src/lib.rs:48,115,305` and `games/ac7/src/lib.rs:35-58` (the first also by `tests/ac7-capture/src/lib.rs:3`); the AC7 DLL and orchestrator link into one process so the layout record and hash code exist twice. `ui/overlay/src/fg_reasons.rs` included by `orchestrator/src/lib.rs:176`. `sdk/game/src/sharpening_defaults.rs` is generated but not declared in `sdk/game/src/lib.rs`; it is included at `ui/overlay/src/abi.rs:5`, `orchestrator/src/sharpening_policy.rs:3`, `integrations/godot/native/platform/fake.rs:13`. Keep: `rsf-runtime-common` as `crate-type = ["rlib","staticlib"]` declaring those modules, `dxbc_chunks`/`shader_hash`/observer layout record there or in `sdk/game`, `sharpening_defaults` as a `pub mod` in `sdk/game`; consumers depend on the crate (the `rsf-windows` pattern). Confidence: h. Done: `pe32_plus`, `vulkan_extensions`, `dxbc_chunks`, `shader_hash` and `fg_reasons` are `rsf-game-sys` modules; `vulkan_negotiation` moved into the Godot crate. `runtime/common` stays a staticlib (its two C exports would be duplicated by an rlib dependency). +- [x] **RS-B4 + S6 Loader carriers: three startup routines and a hand-built session request.** `loader/src/windows/plugin.rs:35-52` (`LOG`, `note`) repeats `rsf_game_sys::session::carrier_log::CarrierLog` (`sdk/game/src/session/carrier_log.rs:11-41`, used by rdr2 and wingman); `thin.rs:56` and `shim.rs:48-52` are two more append-a-line loggers; `plugin.rs:184-215` builds `rsf_game_probe`, `rsf_game_host_services`, `rsf_plugin_session_options` field by field while `rsf_game_sys::session::{Probe, host_services, with_session_options}` (`sdk/game/src/session.rs:52-84`; used by `games/anomaly/src/bootstrap.rs:403`, `games/rdr2/src/runtime_worker.rs:295`, `games/project-wingman/src/carrier.rs`) exist for this and `loader/Cargo.toml` already depends on `rsf-game-sys`; `shim.rs:162-170` `wide_literal` is `ascii_wide` (`ffi_util.rs:18`). `[Loader]` is read by three parsers: `GetPrivateProfileIntW/StringW` in `shim.rs:23-70` (lenient), `config::parse` (`config.rs:44-130`, strict) in `thin.rs:134`, and `load_config`/`setting` in `loader/proxy/src/dinput8_proxy.c:180-250`. Keep: `plugin.rs` uses `with_session_options` and `CarrierLog` (and the shared hasher); `shim.rs` uses `ascii_wide`; merging the INI readers is D27. Tests: `plugin_carrier_contract`, `wingman_carrier_contract`, `thin_loader`, `shared_shim_exports`. Confidence: h (`plugin.rs`, `wide_literal`), l (INI merge). **Note (integrations/loader reduction):** partial: `plugin.rs` uses `CarrierLog`, `rsf_windows::sha256_file_hex`, `Probe`/`host_services`/`with_session_options`; `shim.rs` uses `ascii_wide`. Still open: the `shim.rs`/`thin.rs` loggers (D27 keeps the lenient INI reader and drops the log closure). Done: `plugin.rs` uses `CarrierLog`, `with_session_options` and `rsf_windows::sha256_file_hex` (upstream); the shim logs through `CarrierLog` and keeps its lenient reader (D27). Item-3 fixes: `thin.rs` `note` writes through `CarrierLog` too. +- [x] **RS-B5 `preferences.c` duplicates the Runtime settings store.** `loader/proxy/src/preferences.c` (27 lines) and `preferences.h`; callers `dinput8_proxy.c:1364` (write) and `:1453` (read); `tests/ac7_session.rs:26-27,168-193` declare it with their own `extern`. The same `[Rendering]` section is already read and written through `rsf_settings_store_*` in the same file (`:1364-1400`); `preferences.c` reads `Enabled`/`Quality` with `GetPrivateProfileIntW` and sentinels 2 and 5 (`:11-12`). Keep: `rsf_settings_store_read_integer`/`write_integer` for the two keys; delete `preferences.c/.h`; update `ac7_session`; file format must stay (`Enabled` 0/1, `Quality` 0-4). Confidence: m-h. **Note (integrations/loader reduction):** done: `preferences.c/.h` deleted, `dinput8_proxy.c` reads and writes `Enabled` and `Quality` through `rsf_settings_store_read_integer`/`write_integer`; the `ac7_session` preference check went with them. +- [x] **RS-C1 yyjson as a pinned C dependency for one parse (decision D2).** `runtime/shader_patch/yyjson.cmake` (24 lines: download, per-file SHA-256 pin, CRLF normalisation), `yyjson.lock.json`, `THIRD_PARTY.md`, `src/json.c` (57), `src/json.h` (17), the bindgen output for `json.h` in `runtime/orchestrator/src/shader_patch_abi.rs` (`tools/generate-rust-bindings.py:953`), plain-extern re-declarations in `shader_patch/platform.rs:20,334` and `shader_patch/tests.rs:13,183`, and `tools/package-anomaly.py:159,214-220` (copies the licence, re-checks the pin). `rsf_patch_parse_json(text, user, visit)` only feeds pack metadata to a Rust visitor (depth 128 refusal in `json.c:19-21`); no other code parses JSON through it. Keep: `serde_json = "=1.0.154"` (already in `Cargo.lock` via `tests/loader`) or a small hand reader; deletes the download/pin step, C shim, bindgen output, packager licence copy and an MIT notice. Tests: `shader_patch_synthetic_device`, Anomaly pack parity run (`runtime/shader_patch/README.md:42-49`). Related: BT-12. Confidence: m. Done (D2): `serde_json` with a bounded-depth `DeserializeSeed` in `shader_patch/pack.rs`. +- [x] **RS-C2 `rsf_compile_system_shader` and the `cpp-entry` feature.** `runtime/shader_patch/compiler/Cargo.toml:11-14` (`default = ["cpp-entry"]`), `compiler/src/lib.rs:5,16,119-186`; the only caller is Rust `games/ac7/src/cloud_depth/d3d11.rs:24,62` (an `extern "C"` block re-declaring another crate's `#[no_mangle]`); every other consumer uses the Rust API with `default-features = false` (`games/anomaly/Cargo.toml:36`, `runtime/orchestrator/Cargo.toml:24`); the feature name refers to C++ that no longer exists. `runtime/graphics/CMakeLists.txt:1` builds the crate as a static library; `games/ac7/CMakeLists.txt:9,68` and `runtime/graphics/CMakeLists.txt:10` link it. Keep: `games/ac7` depends on `rsf-shader-compiler` and calls `Compiler::system`/`compile`; delete the feature, the export, the CMake `rsf_shader_compiler` target and its link lines. Tests: `ac7_*` fixtures. Confidence: h. Done: AC7 calls `rsf_shader_compiler::compile_system`; the feature, the export and the CMake archive are gone. +- [x] **RS-C3 Sharpening payload C unit (decision D3).** `runtime/graphics/src/sharpening/pass_payload.c` (80 lines, `switch` functions returning the HLSL string and SPIR-V array) and `options.h` (128 lines, constant mapping), compiled by `runtime/orchestrator/build.rs:49-73` through `cc`; `d3d11.h` (21) and `options.h` declare `rsf_core_sharpen11_*`, which Rust implements; HLSL is stored as C string literals in `rcas.h`, `da_rcas.h`, `da_das.h`, SPIR-V as `*_spirv.h` arrays from `eng/sharpening/spirv.py`; other shaders use `include_bytes!` (`runtime/graphics/shaders/*.hlsl`, `colour_d3d11.rs:32`, `motion_decode.rs:50`). `THIRD_PARTY.md` says these are GPL-3.0-only ports compiled "under the same terms", so the C unit may exist to keep GPL code in one file. Keep: `.hlsl`/`.spv` with `include_str!`/`include_bytes!` and `options.h` ported to Rust, as one GPL-licensed Rust module with the licence header, if isolation is confirmed not to depend on C. Confidence: l. **Reconciled (D3 ruling):** kept. `runtime/graphics/src/sharpening/pass_payload.c` is still compiled by `runtime/orchestrator/build.rs:17,35` as the isolation boundary for the GPL-3.0-only sharpening ports (D3 ruling above). +- [x] **RS-C4 + BT-11 Two version-only scaffolds linked to the full loader archive (decision D9).** `loader/src/bootstrap.c` + `rsf_get_bootstrap_version_impl` (`loader/src/lib.rs:14-17`), `loader/CMakeLists.txt:6-8` (a DLL exporting a version, nothing loads `ReScaleFrame.Bootstrap.dll`); `apps/launcher/src/main.c`, `apps/launcher/CMakeLists.txt:1-3`, `loader/src/launcher.rs:16` (`--help`/`--version`; no script or package names `ReScaleFrame.exe`), test `launcher_version` (`tests/CMakeLists.txt:547-548`). AGENTS.md calls both scaffolds. Keep: remove both targets, the two Rust exports and the test and drop them from the AGENTS.md table when a launcher is built; or a Rust `[[bin]]`/`cdylib` removing the C stub. Confidence: m (reverses an announced plan). **Note (integrations/loader reduction):** done (D9): bootstrap DLL, launcher, both Rust exports and the `launcher_version` test removed. AGENTS.md still lists `rsf_bootstrap` and `rsf_launcher` in the target table; left for the user (D32). +- [x] **RS-C5 + BT-10 Duplicate xinput carrier and a Wingman packager for a withdrawn preview (decision D20).** `loader/proxy/CMakeLists.txt:24-34` (`rsf_proxy_plugin`: `plugin_carrier.c` (8 lines) + `loader/src/windows/plugin.rs`) and `:53-66` (`rsf_proxy_wingman`: `wingman_loader.c` (9 lines) + `games/project-wingman/src/carrier.rs:67`) both produce `xinput1_3.dll` from `wingman_exports.def` and the same `xinput_forwarders.asm`; `rsf_proxy_plugin` has two consumers (`tests/CMakeLists.txt:191-192`, `games/fallout4/CMakeLists.txt:25`; output path in `games/fallout4/engine.json:885`); `tests/CMakeLists.txt:187-193`; `tools/package-wingman.py` (named by no file); `docs/releases/wingman-observer-install.md`; `games/project-wingman/README.md:3` ("There is no published Project Wingman package. The observer preview was withdrawn"). Keep: one `xinput1_3` carrier (`rsf_proxy_plugin`, using `rsf_plugin_carrier_attach` with a per-game plugin path as fallout4 does); delete `rsf_proxy_wingman`, `wingman_loader.c`, `package-wingman.py`, the install note; the Wingman plugin scaffold itself stays. Test `plugin_carrier` still runs. Confidence: m. **Note (integrations/loader reduction):** done (D20): `rsf_proxy_wingman`, `wingman_loader.c`, `package-wingman.py`, the install note, `games/project-wingman/src/carrier.rs` and `overlay.rs` removed; `wingman_exports.def` is now `xinput_exports.def`. +- [x] **RS-D1 `runtime/graphics/submission`: 12 C exports, two headers, no C caller.** `runtime/graphics/submission/src/lib.rs:138-244` (`rsf_submission_acquire`, `shared_pair`, `advance`, `submit`, `completion`, `next_completion`, `pending_value`, `status`, `shared_tail`, `record_copy`, `copy_submitted`, `fence_complete`), `runtime/common/include/rescaleframe/submission_ring.h`, `games/unity-mono/src/bridge_interop.h` (included by no file; named in a comment at `vulkan_state.h:14`) and `bridge_interop.rs:12-15` (`rsf_unity_vulkan_submission_ring`). `rg "rsf_submission_|submission_ring"` over C, C++, headers, `.def`, CMake, Python, C#, Java, GDScript hits only the two headers; Rust callers use `SubmissionHandle`/`SubmissionRing`/`FenceStatus`/`fence_status` as ordinary Rust (`bridge_d3d11.rs:18`, `d3d11_state.rs:34`, `vulkan_platform.rs:7`). Keep: delete the exports and both headers and `rsf_unity_vulkan_submission_ring`; the crate has one consumer (`games/unity-mono/Cargo.toml:18`) so it can become a module of `games/unity-mono`; tests `lib.rs:246-312` keep covering the ring. Confidence: h. Done: the exports, both headers and `rsf_unity_vulkan_submission_ring` are gone; the crate stays because the Runtime uses it too. +- [x] **RS-D2 Headers with no includer.** `runtime/graphics/src/device_owner.h` (8 lines, C++ `namespace rsf`, `same_device`; `rsf_d3d11_same_device` is declared nowhere else and defined nowhere); `runtime/graphics/include/rescaleframe/overlay_renderer.h` (89 lines; its `rsf_overlay_renderer_*` symbols are Rust declarations only, `runtime/orchestrator/src/overlay_host_native.rs`, `overlay_renderer11.rs`); `runtime/common/include/rescaleframe/capture_names.h` (12 lines; declares one function defined in `runtime/orchestrator/src/input_dump.c:36`, re-declared by hand at `vulkan_sr/graphics.rs:339`, `vulkan_sr/xess/native.rs:292`); `runtime/graphics/include/rescaleframe/srv_format.h` (read only by `runtime/orchestrator/build.rs`). Keep: delete the first two; `capture_names.h` and `srv_format.h` once their Rust callers declare directly. Confidence: h (first two), m (others). Done for `device_owner.h` and `overlay_renderer.h`. `capture_names.h` stays (C caller `native_dlss_vulkan.c`); `srv_format.h` belongs with the orchestrator's `d3d11_output_platform` Rust-to-Rust surface. +- [x] **RS-D3 Single-consumer bindgen constants.** `ui/overlay/src/host_option_limit.rs` (3 lines: one constant `40`, `generate-rust-bindings.py:340`) and `ui/overlay/src/fg_reason_codes.rs` (11 lines, `:882`) are bindgen runs for single constants; the crate has no dependency on the Runtime so the numbers are copied. Keep: the 9 reason codes and the limit in `sdk/game` (the overlay could depend on it) or once in `fg_reasons.rs`. Low value. Confidence: h. Done by stage A (both single-constant bindings are gone). +- [x] **RS-E1 `ui/overlay/src/abi.rs` hand-mirrors records that bindgen output already carries.** `abi.rs:67-251` hand-writes `RsfOverlayInput`, `RsfOverlayVertex`, `RsfOverlayDrawCall`, `RsfOverlayDrawData`, `RsfOverlayTextureUpdate` with a 100-line hand offset test (`:253-317`); stats/intent/option records come from bindgen (`wire.rs`, `abi.rs:43-60`); `rsf_overlay_texture_update` is generated again in `runtime/orchestrator/src/overlay_abi.rs:479`; `ui/overlay/src/model.rs:148-205` `Stats<'a>` mirrors `rsf_overlay_stats` (and `Intent` `model.rs:417` mirrors `rsf_overlay_intent`) with `ffi.rs` (892 lines) converting. Keep: add the five records to the `wire.rs` bindgen allowlist and drop the hand copies and offset test; flattening `model::Stats`/`Intent` (a GPU-free test seam) is a design choice, low confidence. Confidence: h (records), l (model). Done for the five records (generated, with `Debug`/`PartialEq` for the two the panel compares); `model::Stats`/`Intent` left as the GPU-free test seam. +- [x] **RS-E2 Orchestrator loads the panel through a C ABI that only Rust consumes (decision D4).** `rescaleframe_overlay.dll` (`ui/overlay/Cargo.toml:15` `cdylib`) is loaded by `runtime/orchestrator/src/overlay_panel.rs:22`; `ui/overlay/include/rescaleframe/overlay.h` (359 lines, ABI 20) is consumed only by `loader/proxy/src/overlay_host.h:8` and the Rust loader. Keep: the DLL boundary if egui isolation is wanted; otherwise a direct `rescaleframe-overlay` rlib dependency removing the loader, five `extern` entry points, `tests/overlay_panel_fixture.rs` and staging scripts (`CMakeLists.txt:70-78`, `cmake/stage_overlay_panel.cmake`, `package-*.py`). Confidence: l. Kept as ruled (D4). +- [x] **S7.3 + RS-F sdk/game consolidation targets and a misplaced helper.** Keep: `camera_math.rs` as the owner for matrix math (S1.7), `call_header.rs` `validate` as the owner for header checks (3 users, see plugin-entry entry), `ffi_util.rs` and `win32.rs` absorbing the wide helper and guarded read. `sdk/game/src/d3d11_host_abi/upstream.rs` `same_upstream_identity` has one caller (`games/fallout4/src/session.rs:240`): move it to `games/fallout4` (the survey's "`upstream.rs:23` no-op log stub" is a `#[cfg(test)]` helper, not production code). `sdk/game/src/vendor_paths.rs` and `recording_slots.rs` (two users each) are fine. `windows::minhook` and the loader's `loader/src/windows.rs:21` wide helper: see cross-cutting entries. Confidence: h. No change needed: `same_upstream_identity` now has two callers (Fallout 4, Skyrim) and `sharpening_defaults` went with stage A; the owner entries are tracked in Cross-cutting. + +### Games: Anomaly and AC7 + +Paths are under `games/anomaly/` or `games/ac7/` as named. Counts differ between the survey (exports named by no non-Rust file) and the GM audit (also counting exports named only by a header no C file calls through): anomaly 396 exports, 103 named by no non-Rust file and 132 only by a header (235 Rust-only); AC7 158 exports, 58 + 31 = 89 Rust-only. + +- [x] **GM-G1.1 + S3.1 (anomaly) SR stage: an 80-entry table and the swap table exist only as C text for bindgen.** `src/sr_stage_platform.h:212-305` (`rsf_anomaly_sr_stage_platform`, 80 fn pointers), `src/sr_swap_platform.h:166-179` (`rsf_anomaly_swap_platform`), bindgen outputs `sr_stage_abi.rs` (1,060 lines) and `sr_swap_abi.rs` (767); Rust builder `sr_stage/native.rs:999-1079` (`leaves()`), `sr_temporal/stage_bridge.rs:1-115` overwrites the 13 `driver_*` entries `leaves()` leaves `None` (`native.rs:1050-1062`), consumer `sr_stage.rs:88` (`type Platform = rsf_anomaly_sr_stage_platform`, 89 call sites through `leaf!`/`platform()`), swap table built in Rust at `sr_stage/native.rs:364-377` and consumed by `sr_swap.rs`. No `.c`/`.cpp` file names either typedef (only their own typedefs and `sr_swap_platform.h:199,201`, which are Rust exports); `stage_bridge.rs` forwards to `#[no_mangle] extern "C" fn rsf_anomaly_sr_*(driver: &Driver, ..)` (`sr_temporal.rs:850,882,946,957,970`), C-ABI functions taking a Rust reference to a Rust type. Keep: `sr_stage.rs` calls `native`, `sr_swap`, `sr_temporal` directly; one Rust trait with the production impl and the existing fakes (`sr_stage/tests.rs`, `sr_swap/tests.rs` build fake tables) where a seam is needed; delete both typedefs, their bindgen, the `Option` table and the `stage_bridge.rs` forwarders. Tests: `sr_stage/tests.rs`, `sr_swap/tests.rs` + `tests/scenarios.rs`, ctest `anomaly_sr_*`. Confidence: h (no C user), m (size of the surviving trait). **Partial (stage B):** the 48 extern redeclarations of crate functions in `sr_stage/native.rs` are gone (GM-G2), and the swap and D3D11-host calls now pass the definitions' types. **Round 2:** the swap table, its typedef and the swap owner's C exports are gone; the owner takes a Rust `Platform` and the tests run the seam through `run_seam`. **Kept:** the 80-entry stage table. It is the test seam: `sr_stage/tests.rs` fakes about 45 entries per case and swaps single entries per test, so a trait would rebuild the same table as a fake (no reduction), and the change needs the stage tests to run. **Reconciled against the tree:** the 80-entry stage table (`sr_stage_platform.h:212-305`) is kept: `games/anomaly/src/sr_stage/tests.rs` fakes about 45 entries per case and swaps single entries per test, so a trait would rebuild the same table as a fake, and the C SEH leaves fill `rsf_anomaly_sr_native` (`sr_stage_platform.c`). The swap table is already Rust (round 2). +- [x] **GM-G1.2 SR D3D11 table goes Rust -> C -> Rust -> C -> Rust.** `sr_d3d11/native.rs:36` `rsf_anomaly_sr_d3d11_register(foreign) -> &'static Platform` <- `sr_d3d11_platform.c:82-85` `rsf_anomaly_sr_d3d11_platform()` <- `sr_stage_platform.c:177` `d3d11()` (entry of the `rsf_anomaly_sr_native` table) <- `sr_stage/native.rs:409` `(native().d3d11)()`; table type `sr_d3d11_platform.h:43-68` (`rsf_sr_d3d11`, 184 bytes). The C file adds four `foreign` entries (`default_view`, `guarded_log`, `save_state`, `restore_state`, `sr_d3d11_platform.c:31-80`), three only forwarding to Rust runtime functions (`rsf_d3d11_state_save/restore`, `rsf_d3d11_create_shader_view`, `runtime/orchestrator/src/d3d11_state/native.rs:611,621,655`); only `guarded_log` needs C (SEH filter). `rsf_sr_texture` (`sr_d3d11_platform.h:28-32`) mirrors `D3D11_TEXTURE2D_DESC` field by field and `sr_d3d11.rs:47-50` defines a third copy (`Texture`) checked by eleven `_Static_assert`s (`sr_d3d11_platform.c:12-31`), while `temporal_device.rs:74` and `roundtrip_device.rs:264` already use `windows` `D3D11_TEXTURE2D_DESC`. Keep: Rust keeps its table internally (or calls `sr_d3d11::native` directly) and takes only the guarded log from C; `windows::Win32::Graphics::Direct3D11::D3D11_TEXTURE2D_DESC`; drop `rsf_sr_texture`/`Texture` and the asserts. Tests: `tests/anomaly_sr_roundtrip.c`, `anomaly_sr_temporal_device.c` (fetch the table through the C getter; would call a Rust test helper), `sr_d3d11/tests.rs`, `target_tests.rs`. Confidence: h. **Partial (stage B):** the guarded log entry is the shared `rsf_game_log_guarded`, and the `TwinBatchInfo` mirror is gone. **Left:** `default_view`/`save_state`/`restore_state` still come from `sr_d3d11_platform.c`. Declaring the Runtime's `rsf_d3d11_state_*` in Rust would add link references the cargo unit-test executables cannot resolve (they do not link the orchestrator). `rsf_sr_texture`/`Texture` versus `D3D11_TEXTURE2D_DESC` is not done. **Reconciled against the tree:** kept: `default_view`/`save_state`/`restore_state` stay in `games/anomaly/src/sr_d3d11_platform.c` because declaring the Runtime's `rsf_d3d11_state_*` in Rust would add link references the cargo unit-test executables cannot resolve (they do not link the orchestrator); `rsf_sr_texture` stays because the C device tests `tests/anomaly_sr_roundtrip.c` and `tests/anomaly_sr_temporal_device.c` fetch the table through the C getter (`sr_d3d11_platform.c:82-85`). The guarded log is the shared `rsf_game_log_guarded`. **Item 3 (fix3-games):** that getter was gone by round 5, so the reason no longer held; `rsf_sr_texture` and the header's other C records are deleted. `Texture` stays as a Rust record with the SDK layout (the portable owners compile without the `windows` crate, and the twin fields copy its bytes into the engine's `CTexture::desc`); `sr_d3d11/native.rs` checks it field by field against `D3D11_TEXTURE2D_DESC`. +- [x] **GM-G1.3 + S3.1 (anomaly) C tables whose entries are Rust exports (observer, bootstrap, motion, SR native).** `src/native_observer_platform.c:60-84`: 11 of 23 entries are Rust (`quiesce_sr` `sr_stage.rs:2928`, `quiesce_motion` `motion/stage.rs:700`, `input_idle` `input.rs:162`, `render_begin` `fg_stage.rs:928`, `sr_frame_end` `sr_stage.rs:2972`, `end_before` `fg_stage.rs:1036`, `camera` `fg_stage.rs:859`, `device_reset` `fg_stage.rs:1096`, rest of `rsf_anomaly_fg_stage_*`); `enable_input`/`disable_input` (`:229-230`) wrap Rust `rsf_anomaly_slot_set` (`engine_slots.rs:173`); `identify`/`read_frame` (`:182-235`) wrap Rust `rsf_anomaly_observer_identify/read_frame`; Rust fetches the table at `plugin_entry.rs:6-13` and calls each entry with `.unwrap()` (`native_observer.rs:257-710`). `src/bootstrap_platform.c:80-90`: all 9 entries end in Rust (`rsf_anomaly_fg_installed` `fg_stage.rs:813`, `rsf_anomaly_bootstrap_publish_input_observer`/`_set_overlay_sink`/`_start_overlay`/`_install_input` `bootstrap/native.rs:30-104`, `rsf_anomaly_overlay_install_default_input` `overlay_hooks.rs:695`, `rsf_anomaly_sr_depth_rva` `sr_stage/native.rs:1116`), two via C entries that call back into Rust (`rsf_anomaly_sr_configure_native` `sr_stage_platform.c:203` -> `sr_stage/native.rs:1092`; `rsf_anomaly_motion_configure_native` `motion_stage_platform.c:406` -> `motion/stage.rs:652`); read back at `bootstrap.rs:425`. `src/motion_stage_platform.c:340-391`: of 32 entries 10 are Rust (`rsf_anomaly_motion_device_platform_get` `motion_device/d3d11.rs:175`, `..._replay_platform_get` `:278`, `rsf_anomaly_geometry_active`, `..._set_foliage` `native_geometry.rs:210`, `rsf_anomaly_motion_target_facts`/`bound_shaders`/`set_shaders` `motion/stage/d3d11.rs:8,29,63`, `clear_target`/`bind_targets`/`clear_targets` `motion_device/d3d11.rs:231-251`); `reset_generation` (`:264-271`) is C calling Rust `rsf_anomaly_observation` with a versioned header; the table carries `struct_size`, `abi_version = 13` (`motion_stage_platform.h:100-102`) checked again in Rust (`motion/stage.rs:643`, `motion/stage/abi.rs:11`, hand-written mirror). `src/sr_stage_platform.c:179-196` (`rsf_anomaly_sr_native`): `struct_size` checked in Rust (`sr_stage/native.rs:1083`) against a C static of the same DLL; `rsf_texture_pixel_bytes` and `rsf_d3d11_create_shader_view` (`:193-194`) are Rust runtime functions routed through it; only `compare_slot` (`engine_slots.c:5-15`) and the SEH engine calls need C. Versioning between two objects of one DLL protects against nothing (**round 2:** the motion table's `struct_size`/`abi_version` and `rsf_anomaly_sr_native.struct_size` are gone). Keep: each C leaf exports only its SEH bodies (trampolines, guarded calls, guarded copy and log) as plain functions Rust declares once; Rust owns composition; removes `bootstrap_platform.h`, the `native_observer_platform.h` table, the motion table and its Rust mirror, `rsf_anomaly_sr_native` and the versioning. Tests: `native_observer/tests.rs`, `bootstrap/tests.rs`, `fg_stage/tests.rs` (fake tables at 6, 3, 3 sites; need the one Rust seam from G1.1), ctest `anomaly_*_hooks`, `anomaly_input_hooks.c`. Confidence: h (round trips), m (whether every SEH leaf stays in C). **Not done in stage B.** The C trampolines compose these tables. The observer, bootstrap and motion tests fake them, and `bootstrap_platform.c` and `native_observer_platform.c` call into them. Reworking them needs the hook contracts to run. The extern redeclarations they relied on are gone (GM-G2). **Reconciled against the tree:** Unfinished: `games/anomaly/src/native_observer_platform.c`/`.h`, `bootstrap_platform.c`/`.h`, `motion_stage_platform.c`/`.h` and `fg_stage_platform.c`/`.h` still compose C tables whose Rust-export entries could be direct calls; only the tables' `struct_size`/`abi_version` checks are gone. Kept: the `rsf_anomaly_sr_native` table (`sr_stage_platform.c:179-196`), whose C SEH leaves and Runtime functions the cargo tests cannot link. Reworking the rest needs the hook contracts (`native_observer/tests.rs`, `bootstrap/tests.rs`, `fg_stage/tests.rs`, ctest `anomaly_*_hooks`) rerun. **Round 3 (r3-anomaly):** bootstrap done: `bootstrap.rs` defines `Leaves` as a Rust struct (the retry test still substitutes counting fakes), `bootstrap/native.rs` binds it to the C stage entries and the Rust stages, and `bootstrap_platform.c` keeps only the CInput detour with its unwind boundary and one `rsf_anomaly_bootstrap_input_hook` export; `bootstrap_platform.h`, its bindgen entry and asserts are gone. Motion: the ten Rust-function entries (device and replay tables, `geometry_active`, `foliage_identity`, `target_facts`, `clear_target`, `bound_shaders`, `set_shaders`, `draw_state`, `reset_generation`) are direct Rust calls and left the C struct, the size asserts and the `abi.rs` mirror (248 to 168 bytes). **Kept, with constraint:** the observer table (`native_observer_platform.c:59-82`) and the motion table's remaining C leaves. Rust receives them from C because `rsf_anomaly_fixtures_rust` (no native-entry) links into about 15 C test executables (`tests/anomaly_support.cmake`), each with only some of the C leaves; Rust naming a C leaf symbol outside native-entry would leave those executables with unresolved externals (the reason `cargo test -p rsf-ac7` does not link). The observer's Rust entries (`quiesce_sr`, `quiesce_motion`, `input_idle`, `sr_frame_end`, `end_before`, `render_begin`, `camera`) also stay in the table because `native_observer/tests.rs:160-169,246-249` fakes them to check the stop-drain order. The FG table (`fg_stage_platform.c:16-19`) holds only C leaves (`engine_depth_view` under SEH, the Runtime's `rsf_d3d11_state_save/restore`) and `rsf_anomaly_sr_native` stays as before. +- [x] **GM-G2 + S3.2 (anomaly, ac7) Rust-only C ABI inside one crate: exports re-imported through `extern "C"` blocks.** 57 anomaly and 37 AC7 functions defined `#[unsafe(no_mangle)] extern "C"` in one module are redeclared in an `unsafe extern "C" { .. }` block of another module of the same crate. Largest blocks: `games/anomaly/src/sr_stage/native.rs:131-237` (51 functions, "The Rust leaves of the former C++ table, linked by their C names"), `bootstrap/native.rs:16-28` (4), `native_observer/report.rs:8-12` (5), `games/ac7/src/native_renderer.rs:763-806` (render scopes, scope facts, hook RVA/role), `native_renderer/sky.rs:32-48` (cloud depth, TrueSky), `motion_capture_graphics_abi.rs:146-203` (bindgen of `ac7_motion_capture.h` used by Rust callers to reach Rust), `tests/anomaly_sr_jitter_fixture.rs:15-44` (module of the anomaly crate via `lib.rs:79`, redeclares 9 crate functions). `ini.rs:50-86` widens narrow C keys byte by byte only because `sr_stage/native.rs:1071-1072` routes INI reads through a C-shaped table; every other module calls `ini::read_int(.., w!("Key"), ..)` (`fg_stage/options.rs:46`, `overlay.rs:1256`). Survey per-file export counts: anomaly 26 (`motion/foliage.rs` 11, `native_observer.rs` 5), ac7 37 (`motion_capture_records.rs` 10, `velocity_history.rs` 6, `velocity_commit.rs` 5; full list in the Rust-only C ABI entry). Keep: `pub(crate) fn` with Rust types and `use`; remove the header prototypes; `sr_stage_platform.h:85-120` (jitter and burst math, all `math.rs:261-340` forwarders) and `sr_stage.h:50-55` go entirely. `sr_stage/tests.rs:1464` imports the `ini` exports by name. Caveat: a run-time-built `GetProcAddress` name would be missed; none of the flagged names appears in a Rust string literal. Confidence: h. **Done (stage B):** every same-crate `extern "C"` redeclaration is gone: 67 in anomaly (`sr_stage/native.rs` 48, `native_observer/report.rs` 5, `bootstrap/native.rs` 4, `motion/fixture/mover.rs` 1, `tests/anomaly_sr_jitter_fixture.rs` 9) and 27 in AC7. Callers import the definitions with their real types. `#[no_mangle]` is dropped from the 64 anomaly functions no C file, header, script or other crate names. 14 of those serve only fixtures or tests and are now compiled only there. **Left:** the AC7 header prototypes of Rust functions bindgen still emits into `crate::sys` (round 2 removed the guard, scope-fact, cloud-depth, contact-shadow and velocity-reason ones; the velocity patch prototypes remain for the native graph fixture). `sr_stage_platform.h:85-120` and `sr_stage.h` keep the prototypes the C trampolines call. `ini.rs` keeps the narrow-key widening while the stage table routes INI reads. **Reconciled against the tree:** the same-crate `extern "C"` redeclarations are gone (67 anomaly, 27 AC7). Kept: the AC7 velocity patch prototypes that bindgen still emits into `crate::sys`, because `tests/ac7_view_fixture.rs` (native graph fixture) calls them; `sr_stage_platform.h:85-120` and `sr_stage.h`, because the C trampolines call them; the narrow-key widening in `games/anomaly/src/ini.rs:50-86`, because `sr_stage/native.rs:1071-1072` routes INI reads through the C-shaped stage table (GM-G1.1). **Item 3 (fix3-games):** the `math.rs` forwarders and their `sr_stage_platform.h` prototypes are gone (the fixture calls the functions), and `sr_stage.h` keeps only its notes. +- [x] **GM-G3 + S3.2 (anomaly foliage) Dead exports kept alive by `#[no_mangle]` (56 with no caller: 54 anomaly, 2 AC7).** `#[no_mangle]` suppresses the dead-code lint so they pass `clippy -D warnings`. `games/anomaly/src/motion.rs:492-580,824-844,985,1130,1138` (17 functions, a C facade over `MotionHistoryState`: `_history_create/_destroy/_begin/_active/_observe/_camera/_record/_retire/_reset/_conflicts`, `remove_jitter`, `from_engine`, `compose`, `decide_core/tree/detail`); `motion/foliage.rs:226,231,238` (`_new`, `_drop`, `_begin`; the survey listed only `_begin` at :236); `shader_loader/d3d.rs:86,95,102,341,371`, `manifest.rs:298`, `reflection.rs:40,47,362` (9 shader-loader entries declared in `shader_loader_platform.h` for the deleted C++ facade, GM-G9); `sr_d3d11/passes.rs:355,367,374`, `targets.rs:458,480,504,534,689,709` (9); `sr_stage.rs:2932,2968,2985` (`_active`, `_rm_near`, `_jitter`), `sr_stage/math.rs:262,282` (`make_plan`, `halton`), `sr_swap.rs:1580`, `sr_temporal.rs:844,1173,1178`, `sr_d3d11.rs:204`, `motion_device.rs:219`, `motion/stage.rs:705`, `motion/stage/shaders.rs:352`, `shader_family.rs:63,69`, `shader_loader.rs:179`, `engine_guards.rs:192`; `games/ac7/src/patches.rs:239,250` (`rsf_ac7_engine_patches_apply/restore`, declared at `ac7_sites.h:83-86`). Keep: delete them; helpers whose only use is a deleted body then become dead and the compiler reports them. Run `dumpbin /exports` to confirm none is a `.def` export (only `rsf_anomaly_observation`, `rsf_anomaly_start`, `rsf_get_game_plugin_api` per `plugin.def`). Confidence: h (textual; spot-checked `motion.rs:491-582`, `patches.rs:236-256`). **Done:** all 56 deleted with their header prototypes. The helpers they alone used are gone too. The deployed-tree shader preparation they kept alive serves only the motion fixtures, so it moves to `shader_loader/tree.rs` and `deployed.rs` behind those features. +- [x] **GM-G5 + S3.1 (ac7) + S8 (ac7) AC7 native renderer: seven layers between the transaction and MinHook.** (1) `games/ac7/src/plugin.c:22-30` puts Rust `rsf_ac7_get_renderer_leaves` (`native_renderer/leaves.rs:611`) into a C `rsf_ac7_platform` (`ac7_platform.h:17-19`, bindgen `platform_abi.rs`, 77 lines) and passes it to Rust `rsf_ac7_publish_api` (`lib.rs:289-330`); (2) `lib.rs:132-146` stores the fn pointer as `Ops`, `snapshot()` maps `false` to `Threw` though the Rust callee returns `false` only for a null `out` (`leaves.rs:611-616`) that is never passed, so nothing throws (`struct Threw` at `lib.rs:129`); (3) `lib.rs:148-183` implements the one-impl `Leaves` trait (`lifecycle.rs:37`) by snapshotting and calling `renderer::rsf_ac7_renderer_*` (`renderer.rs:521-590`); (4) the snapshot is `rsf_ac7_renderer_leaves`, a 30-entry C struct (`ac7_sites.h:92-140`, bindgen `sites_abi.rs`) built and read by Rust, likewise `rsf_ac7_truesky_leaves`/`_patches`/`_call_relay`/`rsf_ac7_code_leaves` (`ac7_sites.h:32-56,149-187`); (5) `renderer.rs:287,397-470` wraps it in `NativeLeaves` forwarding every field into the `Native` trait (`renderer.rs:46`), `truesky.rs:436,486-530` the same into `Plugin` (`truesky.rs:125`); (6) `native_renderer/leaves.rs:38-72` defines Rust functions named `MH_Initialize`... that call through (7) `rsf_ac7_native_calls` (`ac7_sites.h:207-225`, C table at `native_renderer_platform.c:16-23,51-63`, five one-line MinHook forwarders "forwarded as they are", `:3-5`), kept only so `rsf_ac7_rust` "holds no link-time reference" to MinHook (`ac7_sites.h:203-206`), a link-order workaround because carriers link `rsf_ac7_rust` for the view reader. `Native` and `Plugin` have a test impl each (`renderer/tests.rs:153`, `truesky/tests.rs:148`), so one seam is justified; the C structs, `NativeLeaves`/`NativePlugin`, `Ops`/`Threw` and `rsf_ac7_platform` are not. Keep: `impl Native for` a zero-sized production type calling the `leaves.rs` functions directly; export `rsf_get_game_plugin_api` from Rust as anomaly does (`games/anomaly/src/plugin_entry.rs:35-48`) so `plugin.c` reduces to nothing or to binding `rsf_ac7_native_calls`; MinHook via `rsf-windows`; split view/carrier code into its own crate or feature so carriers do not pull MinHook; removes `ac7_sites.h` records 4-5 and most of `sites_abi.rs` (409 lines). Tests: `renderer/tests.rs`, `truesky/tests.rs`, `lifecycle/tests.rs`, `tests.rs:84-101`, ctest `ac7_native_graph` (binds `rsf_ac7_native_calls_table`, `tests/ac7_native_graph.c:49`). Confidence: h (layers 1, 2, 4-6), m (crate split touches loader/proxy linking). **Done:** layers 1-5 in stage B. Layers 6-7 are now done too. The renderer half (plugin entry, lifecycle, renderer, native_renderer, truesky, patches, guards, render scopes, scope facts, cloud depth, com_resource, site admission) moved to `games/ac7/plugin` (`rsf-ac7-plugin`). Only the adapter DLL and the renderer fixtures link it; `rsf_ac7_fixture_rust` is its warp-fixture build. Its detours call MinHook through `rsf-minhook-sys`, and the five C MinHook forwarders in `rsf_ac7_native_calls` are gone. The carriers link `rsf-ac7` (bindings, site data, carrier policy, view reader, motion capture, velocity pass), which has no renderer, render-scope or MinHook references. The input facts, render-scope create and shader factory stay in the call table, so the plugin's unit tests link without those C libraries. +- [x] **GM-G6 + S3.5 (anomaly) Generated C++ profile headers that nothing compiles.** `games/anomaly/src/native_profile.h` (97 lines, `std::array`), `geometry_profile.h` (168), `sr_profile.h` (335, `namespace rsf::anomaly::sr`) are C++ projections of the Rust owners `native_profile.rs`, `geometry_profile.rs`, `sr_profile.rs`; no `.c`/`.cpp` includes them (`native_profile.h` only the other two); generators `tools/generate-anomaly-native-profile.py` (121) and `tools/generate-anomaly-sr-profile.py` (122); drift test `tests/anomaly_support.cmake:54-60` (`anomaly_sr_profile_projection`). Only readers are regexes: `tools/package-anomaly.py:261-264` (`inline constexpr char (?:dx11|avx)_hash`), `tests/anomaly_fg_evidence.py:29-30`, `anomaly_geometry_evidence.py:331,442`, `anomaly_sr_evidence.py:17-19`, `anomaly_profile_evidence.py:15-18,39`; `anomaly_motion_evidence.py:34` already parses `motion_profile.rs`, and `anomaly_fg_evidence.py:31`, `anomaly_profile_evidence.py:90` parse `input/profile.rs`; the generators already parse the `.rs` (`generate-anomaly-sr-profile.py:27-40`). `sr_profile.rs:7` `#![allow(dead_code)]` hides 21 constants nothing reads (`sr_profile.rs:19-66`; S-dead3 lists 20). Keep: point the five Python readers at the `.rs` profiles with one shared parser (the generators' own); delete the three headers, the two generators and the projection ctest; delete the dead constants, then the allow. Tests: `tests/package_anomaly_test.py`, `anomaly_sr_measure_self_test`, `--verify` evidence runs (need the game install). Confidence: h. **Done:** `tools/anomaly_profiles.py` reads the records from the Rust owners. The geometry, SR and FG evidence scripts, `anomaly_profile_evidence.py` (its mutations now act on `.rs` copies) and `package-anomaly.py` use it. For both builds every value read matched the deleted headers, and every negative mutation changes what the reader returns. The three headers, both generators and the projection ctest are gone; the headers' hand-written notes moved into the `.rs` owners. **Kept:** the `sr_profile.rs` `allow(dead_code)` and its Rust-unused constants. The SR evidence checks them against the binary (CRT, CTexture, RCache offsets), so they are evidence data, not dead code. **Item 3 (fix3-games):** the reason holds for the constants and fields `tools/anomaly_sr_evidence.py` reads (`anomaly_profiles.py` lower-cases every const and scalar), which now carry a narrow allow naming that reader; the file-level allow, the ten constants and the `label` field nothing reads are gone. +- [x] **S3.5 (anomaly) Test-only anomaly items in production files.** `shader_loader/deployed.rs:14-16,55,59` (`REPLACED`, `REPLACED_FROM_CACHE`, `ORIGINAL_MISMATCH`, `parse_manifest`, `keeps_buffer_sizes`) and `motion/foliage.rs:295,305,325` have test-only callers (full TESTONLY list in S-dead3). Keep: `#[cfg(test)]` or the fixture feature. Confidence: h. **Partial (stage B):** the deployed-tree path and 14 fixture-only helpers are gated (GM-G2, GM-G3). The `deployed.rs` constants need nothing more: the whole module compiles only under `motion-device-fixture` (round 2 check). +- [x] **S3.5 (ac7) Test-only AC7 items and blanket `allow(dead_code)`.** `native_renderer/graph.rs:301` `set_postprocess`, `native_renderer/sky.rs:499` `composite_draw_handler`, `velocity_geometry.rs:558`, `velocity_renderer/replay.rs:136` are test-only; `native_renderer.rs:53` puts `#[allow(dead_code)]` on a whole `mod hook`; `lib.rs:25` `#[allow(dead_code)] // ... declared for the C++ side too` (no C++ side is left; the file holds only extern declarations of C functions Rust uses). Keep: `#[cfg(test)]` for the four, remove or narrow both allows. Paths under `games/ac7/src/`. Confidence: h. **Partial (stage B):** the blanket allow on `native_renderer::hook` is gone (nothing in it was dead). **Done (round 2):** all four are compiled only with `warp-fixture`, the fixture feature S-dead3 allows; the `sys` allow covers bindgen output. +- [x] **GM-G7 `rsf-anomaly` built ten times in nine target dirs.** `games/anomaly/CMakeLists.txt:4-6` (default and `native-entry`); one feature each at `tests/anomaly_support.cmake:1-2` (`sr-fixtures`), `:96-97` (`motion-binder-fixture`), `:105-106` (`motion-device-fixture`), `:115-116` (`motion-hooks-fixture`), `:263-264` (`input-hook-fixture`), `tests/CMakeLists.txt:63-64` (`native-hook-fixture`), `tests/anomaly_fg.cmake:7-8` (`fg-fixture`), `tests/overlay_dll_api.cmake:40-41` (`overlay-device-fixture`); `cmake/rust_static.cmake:8-11` gives every featured build its own `--target-dir`. The default archive `rsf_anomaly_rust` is linked only by `rsf_anomaly_sr_jitter_test` (`anomaly_support.cmake:170`, a 5-line `main` at `tests/anomaly_sr_jitter.c`) and `rsf_anomaly_geometry_hooks_test` (`:33`); `lib.rs:27` selects `fixture_profile` with `not(feature = "native-entry")` only to serve that archive. Keep: one fixture build with all fixture features (or cargo tests, S7.2); remove `rsf_anomaly_rust` and the `not(native-entry)` cfg once the jitter fixture is a cargo test (pure Rust). Features must not conflict (`fg_stage.rs:6` uses `all(feature = "fg-fixture", not(test))`, `sr_temporal.rs:29`; several fixtures define `main`-like entry names). Related T6/BT-02. Confidence: h (count), m (merging features). **Done:** the build/tooling pass merged the fixture builds into one `rsf_anomaly_fixtures_rust` and removed `rsf_anomaly_rust`. Stage B gates `fixture_profile` on `sr-fixtures` instead of `not(native-entry)`. +- [x] **GM-G8.1 MinHook: three C wrapper sets feeding three Rust hook-batch owners.** `games/anomaly/src/native_hooks_platform.c:24-35` (init/create/remove/queue/apply as `rsf_anomaly_hook_ops`, handed to Rust `native_hooks.rs:284` `rsf_anomaly_hook_set_install` and to the overlay through `bootstrap_platform.c:67,77`); `games/ac7/src/ac7_hooks.c:5-40` (Rust `root_hooks/native.rs:36` -> C `rsf_ac7_capture_install_hooks` -> Rust `hook_batch.rs:22` `rsf_ac7_install_hook_batch` -> C `create/enable/disable/retire` -> MinHook); `games/ac7/src/native_renderer_platform.c:16-23` plus Rust `native_renderer/leaves.rs:38-72,482-540` and the all-or-nothing install with rollback in `renderer.rs:130-134`. Three all-or-nothing batch implementations (`native_hooks.rs`, `hook_batch.rs`, `renderer.rs`) each fed by its own C forwarder; `integrations/windows/src/minhook.rs:11-80` already binds MinHook with the idempotent variants. Keep: one Rust hook batch (create all, enable all, roll back) over `rsf_windows::minhook` in `integrations/windows` or `runtime/common`; `native_hooks.rs` keeps its expected-bytes guard as the anomaly caller's policy; delete the three C forwarder sets and `ac7_hooks.h` batch prototypes. Anomaly uses queued enable/apply and AC7 direct enable. Tests: `native_hooks/tests.rs`, `native_hooks/fixture.rs`, `tests/anomaly_native_hook_leaves.c`, `renderer/tests.rs`, AC7 capture. Confidence: h (duplication), m (one batch fitting all three). **Partial:** the AC7 renderer set (`native_renderer_platform.c` forwarders) is gone (GM-G5). **Kept (accepted test seams):** the anomaly `HookOps` table and the AC7 capture batch (`ac7_hooks.c`, which the carrier links). **Reconciled against the tree:** the AC7 renderer forwarders are gone; Kept: `games/anomaly/src/native_hooks_platform.c:24-35` (the `HookOps` seam `native_hooks/tests.rs` and `tests/anomaly_native_hook_leaves.c` fake, and anomaly's policy is queued enable plus `ApplyQueued`), and `games/ac7/src/ac7_hooks.c:5-40` (direct enable; the carriers link `rsf-ac7`, which has no MinHook references by design, GM-G5). The two remaining all-or-nothing batches (`games/anomaly/src/native_hooks.rs:284`, `games/ac7/src/hook_batch.rs:23`) differ in enable timing and the anomaly expected-bytes guard. +- [x] **GM-G8.2 Guarded copy, guarded log and Rust log wrappers in the games.** `games/anomaly/src/native_memory.h:9-29` is a `static inline` SEH `memcpy` compiled into 9 TUs (bootstrap, fg_stage, motion_stage, native_geometry, native_hooks, native_observer and sr_stage platform `.c`, plus two tests); `games/ac7/src/ac7_memory.c:5-25` is a second copy with a different non-MSVC fallback (VirtualQuery vs ReadProcessMemory). SEH-guarded host log leaves, three identical in one crate: `native_observer_platform.c:237-254`, `sr_d3d11_platform.c:38-58`, `sr_stage_platform.c:156-175`; the `0xE06D7363` filter is written five times (those three, `games/ac7/src/native_renderer_platform.c:43-46`, `render_scope_entry.c:17-23`). Rust log wrappers in anomaly: `host_log.rs:5-24` (`Log`), `overlay.rs:79-97` (`Log` again, truncating), `sr_stage.rs:703` (`emit`), `sr_temporal.rs:800` (`emit`), `sr_stage/native.rs:343-357` (`TwinLog`), `native_observer.rs:144`; AC7 `velocity_commit.rs:169`. Keep: one C leaf file per game, or one shared leaf in `runtime/common` with `guarded_copy` and `guarded_log` (see the guarded-read and foreign-guard entries); one Rust `host_log` per crate (`host_log.rs` survives). Confidence: h. **Partial (stage B):** the three anomaly SEH log leaves are one `guarded_log_line` over `rsf_game_log_guarded`. Every anomaly and AC7 `__try` uses the shared `foreign_guard.h` macros. `sr_stage.rs` and `sr_temporal.rs` `emit` are `rsf_game_sys::log_guarded`. **Round 2:** overlay's truncating `Log` now logs through `log_guarded`, and `TwinLog` no longer truncates. **Kept:** `ac7_memory.c`'s guarded copy (another archive, carriers link it, different MinGW fallback). The remaining Rust log wrappers (`host_log::Log`, overlay's truncating `Log`, `TwinLog`, observer, AC7 `velocity_commit`) are not done. **Reconciled against the tree:** the three anomaly SEH log leaves are one `guarded_log_line` over `rsf_game_log_guarded`, every anomaly and AC7 `__try` uses `foreign_guard.h`, and `sr_stage.rs`/`sr_temporal.rs` `emit` are `rsf_game_sys::log_guarded`. Kept: `games/ac7/src/ac7_memory.c` (another archive that carriers link, different MinGW fallback) and `games/anomaly/src/native_memory.h` (static inline SEH copy, 9 TUs). Unfinished: the Rust log wrappers `games/anomaly/src/host_log.rs:6`, `overlay.rs:76`, `sr_stage/native.rs:216` (`TwinLog`), `native_observer.rs:141` and `games/ac7/src/velocity_commit.rs:137`. **Round 3 (r3-anomaly):** done. `host_log::Log` is the one Anomaly log wrapper and calls `rsf_game_log_guarded` itself (it was the one unguarded path). Overlay's `Log`, `sr_stage/native.rs` `TwinLog` and the observer's `Session::emit`/report sink use it or the leaf directly, so five table entries that only forwarded to `rsf_game_log_guarded` are gone: the observer table's `log`, `rsf_anomaly_sr_native.log`, the SR stage table's `guarded_log`, `rsf_sr_d3d11_foreign.guarded_log`, and `native_memory.h` `guarded_log_line`. AC7 `velocity_commit.rs` `Log::emit` now goes through `rsf_game_log_guarded`. Kept as before: `ac7_memory.c` and `native_memory.h` `guarded_copy`. +- [x] **GM-G8.3 SHA-256 in anomaly and AC7.** `games/anomaly/src/digest.rs:50-88` `sha256_file` is a line-for-line copy of `integrations/windows/src/digest.rs:24-60` plus `hex()` (`digest.rs:15-23`) and a BCryptHash one-shot (`:25-43`); `games/ac7/src/contact_shadow.rs:73-118` computes SHA-256 a third way (LoadLibrary crypt32, `CryptHashCertificate2` by `GetProcAddress`, `cfg(not(windows))` stub). Keep: `rsf_windows::sha256_file` plus one bytes variant; anomaly and ac7 depend on `rsf-windows` (see the SHA-256 entry). Confidence: h. **Done:** `rsf_windows` gains `sha256_hex` for byte slices. Anomaly's `digest.rs` and AC7's `CryptHashCertificate2` path are gone. +- [x] **GM-G8.4 Hand mirrors of records that bindgen or `windows` already provides.** `sr_stage/native.rs:240-249` `MotionFrameTarget` repeats `motion_frame_target_abi.rs:7` `rsf_anomaly_motion_frame_target`; `sr_stage/native.rs:59-67` `HookSite` repeats `native_hooks.rs:27-35` `Site` (`rsf_anomaly_hook_site`; size asserted separately at `native.rs:102-103` and `sr_stage_platform.c:19-20`); `sr_stage/native.rs:38-57` `Native` hand-mirrors `rsf_anomaly_sr_native` (`sr_stage_platform.h:312-333`) and `motion/stage/abi.rs` hand-mirrors `rsf_anomaly_motion_platform` (both disappear with GM-G1.3); `sr_d3d11.rs:47-50` `Texture` / `rsf_sr_texture` duplicate `D3D11_TEXTURE2D_DESC` (GM-G1.2). Keep: one record each. Confidence: h. **Partial (stage B):** the `MotionFrameTarget`, `HookSite`, `TwinBatchInfo` and position-constant layout/platform mirrors are gone. **Left:** `Native`, the motion `abi.rs` mirror and `Texture`/`rsf_sr_texture`, which go with GM-G1.2/G1.3. **Reconciled against the tree:** the `MotionFrameTarget`, `HookSite`, `TwinBatchInfo` and position-constant mirrors are gone. Unfinished (goes with GM-G1.3): `games/anomaly/src/sr_stage/native.rs:38-57` `Native` and `motion/stage/abi.rs` hand mirrors. Kept (with GM-G1.2): `games/anomaly/src/sr_d3d11.rs:47-50` `Texture` versus `rsf_sr_texture`, because the C device tests read the C record. **Round 3 (r3-anomaly):** `sr_stage/native.rs` `Native` is gone; the stage reads the bound `crate::sys::rsf_anomaly_sr_native`. The `abi.rs` motion `Platform` lost its ten Rust entries (GM-G1.3). **Round 3, follow-up:** `build.rs` binds `motion_stage_platform.h`; the motion stage uses `crate::sys::rsf_anomaly_motion_platform` and `rsf_anomaly_motion_engine`, and the hand-written `abi.rs` `Platform`, `native.rs` `Engine`, their asserts and the now-unused `GuardedCopy` and `shader_loader::Read` aliases are gone. The bind table is read through `motion_target::Platform`, its layout-asserted non-Option view. `Texture` versus `rsf_sr_texture` is kept as before. **Item 3 (fix3-games):** `rsf_sr_texture` is gone (GM-G1.2), and the geometry and hook records (`native_geometry_abi.rs`, `native_hooks.rs`) are now the bound `crate::sys` records. +- [x] **GM-G8.5 C file write leaf for `std::fs::write`.** `games/ac7/src/ac7_capture_io.c:5-11` (`fopen`/`fwrite`/`fclose`), `ac7_capture_io.h`, bindgen entry `capture_platform_abi.rs:39-44`, used at `motion_capture_session/native.rs:76,97`. Keep: `std::fs::write(Path::new(OsStr))` (short-write and close checks included); drop the C file from `rsf_ac7_capture_trampolines` (`CMakeLists.txt:49-50`). The comment "Preserve the carrier's narrow CRT path" only matters for ANSI-codepage paths, and paths are built in Rust; check no path has non-ASCII bytes. Confidence: m. **Done:** `ac7_capture_io.c/.h` are gone. The session writes through `CreateFileA`/`WriteFile`, keeping the narrow ANSI path that `std::fs::write` would not, plus the short-write and close checks. +- [x] **GM-G9 Dead anomaly headers.** `games/anomaly/src/temporal_types.h` (33 lines, C++ `std::array`, `operator<=>`; only `games/anomaly/temporal/README.md:12` and `docs/research/rust-anomaly-sr-swap.md:234` mention it), `runtime_module.h` (17; both prototypes are Rust, `runtime_module.rs:48,60`), `shader_loader_platform.h` (84; not a bindgen input, names a consumer `tests/anomaly_motion_shader_facade.h` (`:4`) that no longer exists; its prototypes are the dead exports of GM-G3). Keep: delete the headers and fix the README line. Confidence: h. **Done.** +- [x] **GM-G10 Anomaly shader tools repeat their scaffolding (with BT-14).** `class Refusal(ValueError)` four times (`tools/anomaly_shader_tool.py`, `anomaly_temporal_shader.py`, `anomaly_foliage_shader.py`, `anomaly_motion_deploy.py`), `def digest` three times; tree readers `anomaly_shader_tool.py` `read_tree`, `anomaly_temporal_shader.py` `tree`, `anomaly_motion_deploy.py` `tree` (identical), `anomaly_foliage_shader.py` `_read_corpus` (inlines the tree hash again); tree hashes `tree_digest`, `corpus_hash`, inline at `anomaly_foliage_shader.py:56-58`; the pinned corpus (449 files, `fdc260e0...6a67`) written at `anomaly_foliage_shader.py:16,59`, `anomaly_temporal_shader.py:16,263`, `anomaly_motion_deploy.py:32,114` and asserted in `tests/anomaly_shader_test.py:73-74`; `anomaly_temporal_shader.py` `verify_fxc`, `compile_pair`, `compile_tess` repeat fxc command construction and the resource-binding comparison (`resource_pattern`); `family()` exists twice with different taxonomies (`anomaly_shader_tool.py`, `anomaly_motion_deploy.py`, which `games/anomaly/src/shader_family.rs:17-26` also defines). Keep: one `anomaly_shader_common.py` (Refusal, digest, tree, tree hash, CORPUS pin, fxc runner); `anomaly_motion_deploy.py` already loads sibling tools with `importlib` (`:41-44,112`). Tests: ctest `anomaly_shader_tool_contract`, `tests/anomaly_temporal_shader_test.py`, `anomaly_foliage_shader_test.py`. Confidence: h. **Kept (stage B):** `anomaly_shader_tool.py` was already removed (D28). Each remaining tool's report pins its own file's SHA-256 (`tool_sha256`, and the cache namespace hashed from it). Moving shared code into a common module would let that code change without changing the namespace, unless every report also pins the module, which changes the report schema the tests assert. **Reconciled against the tree:** kept: `tools/anomaly_shader_tool.py` is gone (D28), and each remaining tool (`anomaly_temporal_shader.py`, `anomaly_foliage_shader.py`, `anomaly_motion_deploy.py`) pins its own file's SHA-256 (`tool_sha256`, which also seeds the cache namespace); a shared module would change code without changing the namespace unless every report also pinned the module, which changes the schema `tests/anomaly_temporal_shader_test.py` and `anomaly_foliage_shader_test.py` assert. +- [x] **GM-G11 Per-build engine data repeated across anomaly profiles.** `CRender::rmNear` is at `sr_profile.rs:234,258` and `geometry_profile.rs:104,188` (Standard 0x83a450) and at `sr_profile.rs:243,328` and `geometry_profile.rs:283,367` (AVX 0x831700); `r_dsgraph_render_hud/sorted/emissive` at `sr_profile.rs:282-285,352-355` and `geometry_profile.rs:89-99,178-183,268-278,357-362`. A game update must be applied in two places and the two must agree for the shared rmNear slot (`tests/anomaly_support.cmake:62-63` comment). Keep: one per-build table of shared engine functions in `native_profile.rs` referenced by both profiles (the SR first-person entries carry extra call-site RVAs, so only the function part is shared); `anomaly_sr_evidence.py --verify` ("rmNear is shared with geometry_profile", `:335`) becomes a structural guarantee. Confidence: m. **Done:** `native_profile.rs` `ENGINE` holds, once per build, rmNear (its site and extended guard) and the three `r_dsgraph` renders. `geometry_profile.rs` and `sr_profile.rs` reference them (the SR first-person sites take the function RVA), and `tools/anomaly_profiles.py` expands the references with unchanged values. +- [x] **GM-G13 Smaller anomaly and AC7 items.** `runtime_module.rs:54-57` `export()` takes `&[u8]` and rebuilds a `CStr` (callers pass `c"...".to_bytes_with_nul()` at `:64-67`, `bootstrap.rs:71`, `frame_dump.rs:60`): use `rsf_game_sys::win32::typed_export(module, c"...")`; `games/ac7/src/lib.rs:108-113` and `games/anomaly/src/lib.rs:118-119` redeclare `RSF_OK`/`RSF_ERROR_*` and `ac7/src/lib.rs:204-217`, `anomaly/src/lib.rs:104-124` hand-roll probe validation (the plugin-entry entry), and anomaly `rsf_anomaly_publish_api` (`lib.rs:135`) is a `#[no_mangle]` export whose only caller is `plugin_entry.rs:47`; `games/ac7/src/contact_shadow.rs:120,136` `word`/`store_word` repeat `velocity_container.rs` `store` and `dxbc_chunks.rs:4` `word`; `games/anomaly/src/sr_stage/native.rs:349-356` truncates to "the former 260-byte snprintf buffer", C++ behaviour carried over with no current reader. Keep: the shared helpers named. Confidence: h. **Done:** literal export names use `typed_export`. `runtime_module::export` stays only for bindgen's byte-string names. Both games use the SDK result codes. `rsf_anomaly_publish_api` and the probe check are plain code in `plugin_entry.rs`. AC7 `contact_shadow` uses `dxbc_chunks::word` and `velocity_container::store`. `TwinLog`'s 260-byte truncation is gone (round 2). +- [x] **BT-09 Four identical AC7 INTERFACE targets.** `games/ac7/CMakeLists.txt:10-13` (`rsf_ac7_view`), `:36-39` (`rsf_ac7_ui_rules`), `:42-45` (`rsf_ac7_scene_color`), `:72-75` (`rsf_ac7_velocity_pass`): each is `include` plus `rsf_ac7_rust`; `scene_color` and `velocity_pass` add `Graphics`; `loader/proxy/CMakeLists.txt:13-17` links all into one target. Keep: give `rsf_ac7_rust` the include directory and link it; one alias; drops 3 targets and 3 aliases. Confidence: h. **Done:** rsf_ac7_view and rsf_ac7_ui_rules are aliases of rsf_ac7_rust (which now carries the include directory); scene_color and velocity_pass are one rsf_ac7_graphics. + +AC7 `warp-fixture` in the shipping DLL (GM-G4) is X1; anomaly fixtures in shipping crates (GM-G4) are X3; `engine.json` port logs (GM-G12) are DOC-D5-ENG; the AC7 carrier built twice is RS-A2; `sr_swap` tests are X9. + +### Games: other games and integrations + +- [x] **GO-A1 + S3.1 + S3.2 (skyrim) Skyrim SE: three nested versioned tables, a 20-tag opcode dispatcher and 18 Rust-only exports.** `games/skyrim-se/src/session.rs:34` (`LEAVES_VERSION = 4`), `:36-54` (20 operation tags), `:94-122` (`Leaves`, 13 fn pointers), `:143-158` (`NATIVE_LEAVES`), `:163-250` (`impl Leaves`: `run` (`:186-230`, a `match` over the tags calling Rust directly), `check`, `check_with`, `log`, `log_text`, `host_create`, `set_active`), `:306-322` (`publish`: header read, version compare, `register`); `observers.rs:24-52` (`observers::Leaves`, 7 pointers, `assert size == 56`, `NATIVE_LEAVES`); `platform.rs:19` (`PLATFORM_VERSION = 4`), `:60-75`, `:81-137` (`native::NATIVE_PLATFORM`), `:145-205` (`inspect`, `register`, `get`, `AtomicPtr`); `plugin.rs:110-150` (`publish_api` takes `leaves` so fixtures can inject; `plugin.rs:114` passes `ptr::from_ref(&session::NATIVE_LEAVES)`); seams used by `session/tests.rs:88-110`, `platform/tests.rs:10-23`. The tables are published from Rust to Rust, so the size/version check cannot fail in production; the 20 tags exist so "operation tags also drive the injectable lifecycle fixture" (`session.rs:35`). The 18 `#[no_mangle]` functions (`cpu_hooks.rs:371-427`, `presentation.rs:403-445`, `sampling.rs:183-224`, `compatibility/initializer.rs:574`, `plugin.rs:36`, `resolution.rs:242`, `cpu_events.rs:922`, `cpu_sources.rs:708`) exist to be addressable from the dispatcher. Real C leaves are three: `rsf_skyrim_guarded_read` (`guarded_read.c`), `host_create_guarded`/`host_active_guarded` (`render_detours.c:136,147`), `creation_begin/end_guarded` (`native_creation.c`). Keep: direct calls to the subsystem functions as `pub(crate) fn` (`cpu_hooks::prepare()`, `sampling::start(host)`), three direct `extern "C"` declarations for the C leaves, a `#[cfg(test)]` module swap or generic parameter on `Session` for the lifecycle tests (`a_refused_stage_and_its_predecessors_retire`, `a_throwing_stage_is_retired_with_every_earlier_stage`, `quiesce_withdraws_a_start...`, ctest `game_skyrim_se_plugin_contract`); `inspect`/`register`/`get`/`publish` and both `*_VERSION` constants go away. Est. 450 to 600 lines plus the 18 exports. Confidence: h. Done (reduce-rb-games): LEAVES_VERSION/PLATFORM_VERSION tables, tags, publish/register/AtomicPtr and the 18 Rust-only exports are gone; the session calls the subsystems directly and its tests swap them with a cfg(test) `subsystems` module. Kept: `observers::Leaves`, an unversioned seam that the observer and session tests fill with different fakes; the start-stage "throw" path was deleted (the stages are Rust and cannot throw). +- [x] **GO-A2 + S4 (godot) Godot: 60-entry platform table, its C mirror, static-assert file and fake.** Rust table `integrations/godot/native/platform.rs:18` (`PLATFORM_VERSION = 9`), `:578-655` (`Platform`, 60 fields), `:769-785` (`register`, `registered`), `:787-1086` (one accessor per field), `:13` `#![allow(dead_code)]`; binding `host.rs:665-727` (`static PLATFORM`), `:728` `native_platform()`; fake `native/platform/fake.rs` (722-744 lines, 9 helpers test-only); C mirror `native/godot_platform.h:234-346` (`rsf_godot_platform`) and prototypes `:373-415`, `native/vulkan_control.h` (29 lines, no includer), `native/host_abi.h` (663 generated lines, no C includer); layout asserts `native/runtime_platform.c:11-105` (about 95 lines over Rust-owned records; its CMake comment says it supplies "the optional provider symbols, the project version, the layout checks and DLL unload"); `vulkan/creation.rs:130,144,152` test-only. `rg "rsf_godot_platform"` finds no C or C++ that fills or reads the table. Keep: call the Runtime exports directly from the owning module (`rsf_fg12_install`, `rsf_sr12_evaluate`; `host.rs:40-60` already declares many); delete `Platform`, `register`, `registered`, the 60 accessors, `fake.rs`, `godot_platform.h`, `vulkan_control.h`, `host_abi.h`, the asserts for Rust-only records and `PLATFORM_VERSION`; `runtime_platform.c` keeps only `rsf_godot_version`, `rsf_godot_vk_native_features` and the unload hook; `rsf_godot_boot(native_platform(), setup)` (`runtime.rs:19`) loses its table argument. Godot unit suites (`control/tests.rs`, `d3d12/tests.rs`, `vulkan/tests.rs`, `vulkan/sr/tests.rs`, `window/tests.rs`) drive the fake and must be re-seamed with a `#[cfg(test)]` swap. Est. 2,000 to 2,500 lines (table and accessors about 450, fake 722, headers and asserts about 600). Confidence: h (mirror, validation), m (test seam shape). **Note (integrations/loader reduction):** partial: `godot_platform.h`, `vulkan_control.h` and the layout asserts for Rust-only records are gone; `runtime_platform.c` keeps only the `api.h` records, the CPU service and the Runtime constants. **Round 2:** done. `Platform` is a unit type implemented by `host.rs` and `vulkan/native.rs` and by the cfg(test) fake; the table, `register`, `PLATFORM_VERSION` and the 60 accessors are gone. +- [x] **S4 (godot) `native/vulkan/creation/abi.rs` (4,291-4,323 lines) is a bindgen pass over `vulkan_core.h`.** It emits 49 `Vk*` structs and 445 `VK_*` constants (all in `ash`, already a workspace dependency) and 26 `rsf_*` contract records that other bindings define (`rsf_srvk_setup` has 8 copies, e.g. `creation/abi.rs:3103`, `runtime/orchestrator/src/vulkan_sr_abi.rs:27`, `integrations/godot/modules/rescaleframe/packet_abi.rs:103`; `rsf_fgvk_setup` 7; `rsf_camera_frame` 5). Generator `tools/generate-godot-vulkan-bindings.py` needs a pinned Godot 4.7.2 `thirdparty/vulkan/include` (checks `VK_HEADER_VERSION 335`). Keep: `rsf_*` records in the orchestrator or SDK bindings, `ash::vk` for the Vulkan structs; delete most of the file. Confidence: h. **Note (integrations/loader reduction):** kept: D26 keeps vendor-header output committed with `--check`, and `ash` is not a dependency of `rsf-godot`; moving the 49 `Vk*` structs to `ash::vk` rewrites `creation/typed.rs`, `chain.rs`, `creation.rs` and `native.rs` and needs a build. **Round 2:** done; `rsf-godot` depends on `ash`, `abi.rs` and its generator are deleted. +- [x] **GO-A3 + S3.5 (unity) Unity package: 53-entry platform table with Rust -> C -> Rust loops and 1:1 forwarders.** `integrations/unity/native/package.c:90-146` (`static const rsf_unity_package_platform platform`, 53 entries), `:36-60` (static asserts), `:150-205` (`rsfu_*` exports, `UnityPluginLoad`; comment `:3-4` admits "Entries without a body here are Runtime or Rust functions; the wrappers only adapt result types"); `package_state.h:71-164` (struct), `:203`; Rust consumer `games/unity-mono/src/package_state.rs:194` (`Leaves::adopt`), `:127` (`LEAVES: OnceLock`), `package_state/presentation.rs:206`, `package_state/routing.rs:265`; test double `package_state.rs:1530-1534`. Entries: Runtime C functions (`rsf_fg12_install`, `rsf_sr12_evaluate`), 8 wrappers that only convert `bool` to `uint32_t` (`dlss_preset_valid`, `end_session`, `present_has_owner`, `preview_owns`, `vulkan_owns`, `sharpening_valid`, `sharpening_defaults`, `renderer_vulkan`; `package.c:63-88`), about 21 Rust functions declared in C and passed back (`package_state/windows.rs:63,68,79,85,90,110,130,181,233,259,290`, `package_state/native.rs:48,121,139,157`, `bridge_native/package.rs:59,86,100,113,129,163`; `package.c:24-34`). The Rust crate links into the same DLL (`integrations/unity/CMakeLists.txt` links `rsf_unity_mono_rust` and `rsf_orchestrator_core`), and the 10 `rsfu_*` exports (`package.c:150-198`, e.g. `rsfu_configure -> rsf_unity_package_configure`) are forwarders. Keep: Rust declares the Runtime externs (pattern of Godot `host.rs:40-60`) and calls its own functions; Unity SDK calls stay in C (`graphics_interface`, `device_callback`, `renderer_vulkan`, SEH leaves in `vulkan_bridge.c`); about 5 table entries or none; `rsfu_*` become Rust exports listed in `native/bridge.def`; `package_state.h:71-164` and about 400 lines of `package_abi.rs` shrink. Tests: `exports_check_structure_sizes`, `package_state` tests (`TABLE`, `package_state.rs:1534`), `eng/test-unity-sharpening.ps1`, `tests/unity-managed`; C# needs only the exported names. Est. 700 to 900 lines. Confidence: h. **Note (integrations/loader reduction):** not done: the table and its Rust consumer live in `games/unity-mono` (D25 move), which another reduction pass owns. Not done (reduce-rb-games): the table is also the package tests' seam (326 uses, a fake `TABLE`), and `package.c` cannot be compiled without the Unity SDK headers; it needs a pass with a Unity-provisioned build. **Round 2 (unity):** Done in source, untested: the table, its C struct and the C wrappers are gone; `package_state/native.rs` binds `Leaves` to the Runtime exports, the bridges and the Win32 calls directly, and the package tests keep binding fakes to the same `Leaves`. `package.c` keeps `dlss_preset_valid`, `renderer_vulkan`, `graphics_interface`, `device_callback` and `UnityPluginLoad/Unload`; the `rsfu_*` exports are Rust and listed in `bridge.def`. Not compiled here: `package.c` and `vulkan_bridge.c` (Unity SDK headers). +- [x] **GO-A4 + S3.1 (wingman) Wingman: 11-entry table, 5 entries Rust functions routed through C.** `games/project-wingman/src/observer.rs:30-51` (`Platform`, `assert size == 11 * usize`), `:64` (`bind`), `:51` (`OnceLock`), `:77` `rsf_wingman_accepting`; `src/native_platform.c:28-36` (externs of Rust functions), `:139-160` (`WingmanPlatform`), `:162-165` (`rsf_get_game_plugin_api` forwards to Rust `rsf_wingman_publish_api`); `src/lib.rs:36-77`; Rust fns `rsf_wingman_verify_executable`, `_image_base`, `_copy`, `_tick_count` (`windows.rs:79,92,100,105`). Only `create_hook/enable_hook/disable_hook` (MinHook), `acquire_texture`, `release_texture`, `report_execution`, `guarded_log` are C leaves needing `__try`. Keep: Rust calls its own functions directly; five `extern "C"` declarations for the real leaves; `rsf_get_game_plugin_api` as a Rust `#[no_mangle]` export (rdr2's `plugin.def` shows the pattern); MinHook via `rsf_windows::minhook`. About 150 lines. Tests: `wingman_camera_contract`, `game_project_wingman_plugin_contract`, `execution.rs` `partial_enable_can_retry_after_rollback`. Confidence: h. Done (reduce-rb-games): Rust calls its own functions and declares the four C leaves; MinHook through `rsf_windows::minhook`, the BCrypt copy through `rsf_windows::sha256_file_hex`; `rsf_get_game_plugin_api` stays a two-line C forwarder; a build.rs compiles `native_platform.c` for Cargo tests. +- [x] **GO-A5 + S3.1 + S3.2 (rdr2) Rdr2: `Platform` table with a test-only seam and 53 Rust-only `pub(super)` exports.** Table `games/rdr2/src/platform.rs:74` (`PLATFORM_VERSION = 2`), `:87-149` (29 entries), `:162-200` (`register`, `AtomicPtr`), filled at `native_platform.rs:373` (`pub(super) static NATIVE`); `asi.rs:22,173`; `lib.rs:140-178` (`rsf_rdr2_publish_api(requested, out, platform)`), `:131` `rsf_get_game_plugin_api` passes `platform::native()`. 53 `#[unsafe(no_mangle)] pub(super) unsafe extern "C" fn rsf_rdr2_capture_*`: `capture_state/recordings.rs` (`:205,223,237,254,266,289,300,312,331,348,365`), `metadata.rs` (12), `shots.rs` (5), `gpu_leases.rs` (5), `d3d12.rs` (6), `pipeline.rs` (2), `artifacts.rs` (1); callers are Rust only (`detours.rs:350,379,511,546`, `ngx.rs:6,122`, `shots.rs:478-518`) and `pub(super)` + `no_mangle` cannot be reached from another object. Keep: plain `pub(super) fn` on `&Capture`/`&mut Recordings` (drops `unsafe extern "C"`, null checks, the `unsafe { &*owner.recordings.get() }` re-borrow); `Platform`-style indirection only as a `#[cfg(test)]` substitute of `native_platform.rs`; `lib.rs:131-178` fills `rsf_game_plugin_api` without an out-parameter table. `capture_state` tests (`recordings.rs:481-607`, `shots.rs:503-529`, `bundle.rs:232`) call the exports by name and are re-pointed. Est. 500 lines. Confidence: h (exports), m (table). Done (reduce-rb-games): the 48 capture exports are plain functions; the game-DLL `Platform` and the ASI `AsiPlatform` tables are gone (direct calls; `rsf_rdr2_publish_api` folded into `rsf_get_game_plugin_api`; the ASI records attachment in one flag so the game DLL and unit tests still see no ASI services). The C-filled `rsf_rdr2_asi_services` link table stays (optional RenderDoc, dump and census libraries are chosen by the C link). +- [x] **GO-A6 + S3.3 (Threw) Fallout 4 `Ops` unit struct, `OnceLock` flag, six identical C guard thunks and the `Threw` result type.** `games/fallout4/src/lib.rs:79` (`struct Ops;`), `:135` `ops()`, `:358` `OPS.get_or_init(|| Ops)`, `:98-262` (`impl Ops`: `log`, `log_host`, `initialize_hooks`, `enable_hook`, `disable_hook`, `host_create`, `host_set_active`, `creation_begin`, `creation_end`, `bind_presentation`), `:130-137` (`Threw`, `completed()`), `src/host_boundary.c:11-56` (six `TRY { *result = f(args); } CATCH_CXX { return false; }` copies); `ops()` callers `session.rs:335`, `creation.rs:453`, `cpu_events.rs:212`, `render_inputs.rs:1447`; `Ops` is named 10 times in `session.rs`, 5 in `render_hooks.rs`, 6 in `creation.rs`. `ops()` is a "published" flag that threads `&Ops`. `struct Threw` is also defined at `games/ac7/src/lib.rs:129`, `games/skyrim-se/src/session.rs:161`, with bool-to-Result `completed()` helpers in about 20 files. Keep: free functions and the shared foreign-exception guard; remove `Ops`, `OPS`, `ops()`, `Threw` and `completed()`. About 250 lines. Tests: `game_fallout4_plugin_contract`, `session` tests. Confidence: m (threaded through many signatures). Done (reduce-rb-games): `Ops`, `OPS`, `ops()` and the `&Ops` parameters are gone (crate functions). Kept: `Threw` (the result of a guarded call that really threw) and the six C guard thunks, until a shared foreign-exception guard (GO-B1) exists. +- [x] **GO-B7 Per-monitor-v2 DPI request in two adapters (decision D31).** `games/fallout4/src/dpi.rs:1-171` (resolves four `user32` exports, requests, verifies process and thread, counts windows, refuses when the process already owns a window) and `games/skyrim-se/src/session.rs:71-72,360-372` (resolves one export, requests, no verification). Keep: one `sdk/game::win32::request_per_monitor_v2() -> Result<(), Refusal>` (Fallout 4's verified form); adapters keep their own "safe to request now" condition. Skyrim's behaviour changes if verification is stricter; check its `prepare` path. About 100 lines. Confidence: m. Done (reduce-rb-games, D31): `rsf_game_sys::dpi::request_per_monitor_v2(cold)` holds the verified form; Fallout 4 keeps its owner check and refusals, Skyrim now verifies and logs but still does not refuse prepare. +- [x] **GO-B8 C# native mirrors in two assemblies.** [UnityBridgeAbi.cs](integrations/unity/com.kpc.rescaleframe/Runtime/Engine/UnityBridgeAbi.cs) is the single definition of CameraFrame, Packet, Configuration, Api, CpuFact, and PacketFlags. Both assemblies use that source through their existing Runtime/Engine wiring, and the package layout fixture includes it explicitly. Source comparisons matched field order, versions, flags, expected x64 sizes, and the Packet.Camera offset. Compilation and fixture execution remain pending with the pinned Unity managed references. +- [x] **GO-D1 Unity package code lives in `games/unity-mono`, one crate built twice (decision D25).** `games/unity-mono/Cargo.toml` (`[features] mono-plugin`) is built twice by `games/unity-mono/CMakeLists.txt` (`rsf_unity_mono_rust` and `rsf_unity_mono_plugin_rust ... --features mono-plugin`); about 30 `cfg(feature = "mono-plugin")` gates (`d3d11_state.rs`, `d3d11_pass.rs`, `bridge_native.rs`, `package_state.rs:14`, `lib.rs:14-24`) split Package-only and Mono-only code inside the same files, and `integrations/unity/CMakeLists.txt` links code from `games/` (inverts Rule 1). Keep: split `package_state*`, `d3d11_*`, `vulkan_*`, `bridge_*` into a crate under `integrations/unity`, leave the Mono plugin (`lib.rs`, `lifecycle.rs`, `mono.rs`, `runtime_setup.rs`, `startup_policy.rs`) in `games/unity-mono`; a move that removes the feature switch (see also X14). Tests: CMake wiring, `tests/unity_mono_runtime.rs`. Confidence: m. **Note (integrations/loader reduction):** not done (D25 move): touches about 30 `mono-plugin` gates across `games/unity-mono`. Done (reduce-rb-games, D25): the package code is the `rsf-unity` crate in `integrations/unity` (src/, native/, include/); `games/unity-mono` keeps the Mono plugin and has no feature or second archive. `rsf-unity` keeps a `mono-plugin` feature (the plugin's subset, enabled by rsf-unity-mono): removing it needs the shared/package-only split of bridge_native, vulkan_state and d3d11_* (X14 still applies). +- [x] **GO-E1 + S3.2 (fallout4) Fallout 4 dead export and Rust-only exports.** `games/fallout4/src/render_inputs.rs:1445-1448` `rsf_fallout4_inputs_verify` has no caller (confirmed with `rg -w`); `rsf_fallout4_depth_verify`, `rsf_fallout4_resolution_verify`, `rsf_fallout4_verify_screen_queries`, `rsf_fallout4_resolution_inputs`, `rsf_fallout4_cpu_begin_render` are `#[no_mangle] extern "C"` but called only from `render_hooks.rs:267-269,526` and `render_hooks/publication.rs:264`. Keep: delete the dead one; plain `fn` for the rest. About 30 lines. Confidence: h. Done (reduce-rb-games): the dead export and `creation::verify_executable` deleted; the five checks and `rsf_fallout4_camera_motion_to_uv` (test-only) are plain functions or gone. +- [x] **GO-E2 Rdr2 research and diagnostic machinery inside the shipping ASI and game DLL (decision D13).** `games/rdr2/src/capture_state.rs` and `capture_state/*` (4,747 lines, 17 files: recordings, shots, metadata, gpu leases, bundle, artifacts, `d3d12`, detours, ngx, install, poll), `camera_probe.rs` (361), `diagnostics.rs` (231: module sampling, census, RenderDoc request worker), `d3d12_trace.rs` (106), `asi/diagnostics_abi.rs` (277), `asi/diagnostic_services.rs` (132), `capture_ngx.c` (51), `social_club.rs` (245). F10-triggered frame capture, NGX trace, module entropy sampler; opt-in by INI; `RESEARCH-HANDOFF.md` and `README.md` call them research evidence for an unfinished integration (`Rendering readiness 0`). Only fixtures are feature-gated (`Cargo.toml:14-15`). Accounts for most of the 53 Rust-only exports. Keep: delete if research is finished, otherwise behind a `research` cargo feature compiled only into developer builds. About 5,500 lines move out of shipping. Confidence: m (delete) to l (the capture may still be in use). Done (reduce-rb-games, D13): capture_state, capture_ngx.c, camera and native-settings probes, D3D12 trace, census, module dumps and the RenderDoc probe build only with the `research` feature (`-DRSF_RDR2_RESEARCH=ON`, default OFF); `capture-fixture` implies it. Social Club fix, ForceD3D12 and engine settings stay. +- [x] **GO-E3 Fallout 4 per-gate diagnostic receipts in the CPU event owner (decision D14).** `games/fallout4/src/cpu_events.rs:1034-1214` (`first_seen`, `gate_receipt` with a 40-argument `format!`, `PhaseChecks`, `downstream_receipt` with 50 arguments), `poll_receipt` (`:1813-1885`) and counters `SOURCE_RECEIPTS`, `GATE_RECEIPTS`, `DOWNSTREAM_RECEIPTS`, `CYCLE_STAGES`, `POLL_COMBINATIONS` (`:166-173`) emit once-per-key log lines when a proof gate refuses; they write to the host log and feed no decision. About 300 lines in the largest file of the area (3,224 lines). Keep: only while a current investigation reads them. Confidence: l. Kept per D14. +- [x] **GO-E4 Minecraft status generator (decision D30).** `games/minecraft/eng/generate-native-status.py` (89 lines) generates `native/status.rs` (43 lines) and the Java getter array from one 26-entry table; the two files change together rarely and `status.rs` carries its own `STATUS_MINIMUM`. Keep: hand-maintained `status.rs` and Java accessors, or keep the generator if the array grows. About 90 lines. Confidence: l. No change per D30. +- [x] **S4 (vulkanstory) VulkanStory integration code compiled inside runtime crates.** `integrations/vulkanstory/native/fsr3.rs` and `native/ngx.rs` are `#[path]`-included into `runtime/vulkan/fsr3/owner.rs:31` and `runtime/vulkan/ngx/src/lib.rs:6`, inverting the dependency Rule 1 asks for. The `VulkanStoryFsr3*` names are exports consumed by the VulkanStory DLL and stay. Keep: resolved by D7 (orchestrator owners plus a VulkanStory shim); the integration depends on the runtime, not the reverse. Confidence: h. **Note (integrations/loader reduction):** deferred to the D7 owner (`runtime/vulkan`); not touched. **Done (stage B):** `native/fsr3.rs` is replaced by `fsr3.def` aliases; `native/ngx.rs` moved into the NGX package crate and its always-on `vulkanstory-compat` feature is gone. +- [x] **S3.5 (unity-mono) Shared-record copies in `games/unity-mono`.** `runtime_setup.rs:71` `#[path]`-includes `runtime/orchestrator/src/overlay_saved_abi.rs` (as do `games/rdr2/src/runtime_worker.rs:38` and `games/anomaly/src/overlay.rs:28`); `shared_surface_abi.rs` repeats all 5 records of `tests/presentation/src/shared_surface_abi.rs` from the same header. Keep: one crate owning each (see S1 mechanisms 1 and 4). Confidence: h. **Done (tree check):** the `#[path]` includes of `overlay_saved_abi.rs` and the `shared_surface_abi.rs` copy are gone from `games/unity-mono` (and rdr2, anomaly); the records come from `rsf-game-sys` (`games/unity-mono/src/runtime_setup.rs:17,126-136`, `integrations/unity/src/bridge_d3d11.rs:199`). +- [x] **S4 (steam) `integrations/steam/src/lib.rs:456,467` duplicates the guarded-log and `completed` pattern.** Keep: `host_log` and the shared guard (see those entries); the real `ReadProcessMemory`/`VirtualProtect` work and two SEH leaves stay. Confidence: h. **Note (integrations/loader reduction):** deferred: depends on the shared foreign-exception guard and `host_log` (GO-B1, S3.3) that do not exist yet; the Steam crate keeps its two SEH leaves. Done (reduce-rb-games): the log guard is `rsf_game_log_guarded`, the dispatch guard uses the shared header, and the guarded read is `rsf_game_sys::win32::read`. + +### Tests + +Scale: `tests/` holds 405 tracked files: 205 `.rs` (72,114 non-blank lines), 98 `.c` (8,224), 9 `.cmake` plus `CMakeLists.txt` (1,624 lines, 145 `add_executable`, 194 `add_test`, 105 `set_tests_properties`), 15 `.py`. Only 2 of the 205 `.rs` files use `#[test]`; everything else is an exit-code fixture reached through a C `main`. The fixtures in shipping crates (X1 to X3), the unwired Python tests (X8), the tracked Unity binaries (X5) and the CMake paren (X7) are under Correctness. + +- [x] **S7.2 mechanism 5 Test harness outside cargo.** 222 `rsf_*fixture*` C-ABI entry points (72 in `tests/presentation`, 52 in `tests/vulkan-fg`), 75 C `main` stubs that only forward `argc`/`argv` (e.g. `tests/sr_backend_switch_device_main.c:2-6`, `tests/anomaly_sr_jitter.c:4-7`), 14 staticlib test crates that exist only to be linked by those stubs, and 38 test-only bindgen files (16,344 lines; 40 files and 17,965 non-blank lines by the tests audit) because fixtures reach the code under test through C headers such as `tests/presentation/present_fixture_loops.h`, `tests/vulkan-fg/dlss_abi.h`, `tests/game-sdk/render_host_fixture_abi.h`. Keep: `cargo test` (integration tests or `harness = false` binaries), which deletes the stubs, the `RSF_GRAPHICS_FIXTURE=` CMake wiring and most of the test bindgen files; `tests/ac7_*_abi.rs`, `engine_sharpening_abi.rs` and `native_sr_fsr4_vulkan_abi.rs` feed bare-`rustc` fixtures (T11) and go with them. Confidence: h. **Status (round 4, constraint annotations only):** done in earlier rounds: T4 step 1, T9, X2, X3, T13, the `check!`/WARP/window duplicates, the `game-sdk/anomaly_main.c` and `contract_main.c` stubs; test bindgen is generated at build time (no committed files) and the bare-`rustc` fixtures are Cargo crates (`tests/process`, T10, T11). Round 4 moved the FSR4 FG, DLSS-G FG and XeLL fixtures into the orchestrator's test-fixtures archive (no more `tests/vulkan-fg` C-ABI round trip for them) and deleted six more launchers whose only work was forwarding or decoding `argv` (`anomaly_sr_jitter.c`, `anomaly_temporal_tests.c`, `anomaly_motion_contract_main.c`, `capture_fixture_main.c`, `vulkan-fg/ffx_fixture.c`, `native_fg_xess_vulkan_interop.c`; the Rust entries read the command line behind `tests/fixture_main.c` or `fixture_main_args.c`). Still C-driven, each with its constraint: (1) the C main passes addresses that must be the DLL's own, not link thunks: `anomaly_overlay_visibility.c`, `overlay_dll_api_device.c`, `overlay_dll_api_no_sr.c`, `generation/dll_main.c`, `game-sdk/session_main.c`, `exposure_normalization_main.c`, `native_sr_fsr4_vulkan_main.c`, `presentation/fsr4_fg_bridge_main.c`, `capture_vulkan_fixture_main.c`; a Rust `extern` declaration would need dllimport semantics against the import library CMake builds. (2) The code under test is C or C++ compiled by the launcher: `dlss_sr_layout_main.c` with `dlss_sr_layout_facts.cpp` (C++-only Streamline layouts), `unity_sr_d3d12_preset.c` (`rsf_dlss_preset_valid`, `static inline` in `runtime/backends/dlss/include/rescaleframe/dlss_preset.h:9`), `skyrim_input_main.c` (links `games/skyrim-se/src/guarded_read.c`, whose `__try`/`__except` copy Rust cannot express; `tests/CMakeLists.txt:357`), `ffx_vulkan_wsi_dispatch.c` (the corrected SDK's C11 WSI dispatch section), `streamline_vulkan_dispatch.cpp` and `streamline_selected_device.cpp` (the C++ Streamline SDK fixes). (3) The executable carries what the loader needs before `main`: `presentation/gl_shared_surface_main.c` (`NvOptimusEnablement`, `AmdPowerXpressRequestHighPerformance`). (4) The launcher holds C-side behaviour of its own: `ac7_view.c` (opens the capture files in the C runtime's narrow path encoding and checks the C view ABI's invalid-argument result), `native_xess_vulkan_main.c` (CMake's `RSF_TEST_VULKAN` define decides whether the device case runs). (5) A per-archive `export_name = "main"` or `[[bin]]` with `harness = false` cannot replace the compile-time entry: each archive serves 3 to 20 executables with different entries and C libraries, and a runtime-dispatching `main` would make every executable link every fixture of its archive and fail on the libraries it lacks. **Done (final verification):** `tests/generation/fg_choice_main.c`, its Rust entry `tests/generation/src/choice.rs` and the `rsf_fg_choice_test` target are deleted. The persistence and vendor-default checks are orchestrator unit tests in `runtime/orchestrator/src/fg_choice.rs` (`saved_choice_reloads_and_refuses_what_the_host_cannot_serve`, `default_backend_follows_the_adapter_vendor`), which call `rsf_fg_default_backend` and the choice entries directly and use `temporary_ini::TemporaryIni`. The launchers left are groups (1) to (5) above, each with its constraint. Also corrected in the body: `export_name = "main"` is at `tests/game-sdk/src/unity_sr_d3d12.rs:472` and `tools/exposure_probe/src/lib.rs:547`. +- [ ] **T4 51 C launchers for Rust fixtures.** 91 C or C++ files under `tests/` contain `main`/`wmain`; 51 are 22 lines or fewer and only forward: `graphics_fixture_main.c` (8), `game-sdk/cpu_fixture_main.c` (7), `generation/main.c` (8), `overlay/main.c` (9), `loader/main.c` (8), `capture_fixture_main.c` (8), `sr_bridge_main.c` (8), `sr_pipeline_main.c` (8), `sr_backend_switch_device_main.c` (8), `generation/device_main.c` (11), `generation/fg_choice_main.c` (11), `rdr2_camera_main.c` (5), `native_sr_fsr4_state.c` (7), `ac7_session.c` (8), `ac7-capture/src/main.c` (8), `g02/fixture_main.c` (8), `anomaly_motion_device.c`, `anomaly_motion_far_device.c`, `anomaly_motion_tess_chain_device.c`, `anomaly_sr_jitter_device.c`, `anomaly_sr_jitter.c`, `anomaly_sr_profile.c`, `anomaly_sr_roundtrip.c`, `anomaly_sr_swap.c`, `anomaly_temporal_tests.c`, `anomaly_motion_contract_main.c`, `anomaly_overlay_visibility.c`, `overlay_dll_api_device.c`, `overlay_dll_api_no_sr.c` and others. Five are the same file with one macro renamed (`extern int (void); int main(void){return ();}`; `RSF_GRAPHICS_FIXTURE` 20 executables, `RSF_CPU_FIXTURE` 17, `RSF_GENERATION_FIXTURE` 6, `RSF_OVERLAY_FIXTURE` 3, `RSF_FIXTURE_ENTRY` 2). `tests/game-sdk/src/unity_sr_d3d12.rs:472` (`export_name = "main"`, linked with `/INCLUDE:main`, `tests/CMakeLists.txt:109-118`) and `tools/exposure_probe/src/lib.rs:547` already export `main` from Rust. Keep: step 1, one `tests/fixture_main.c` (`extern int RSF_FIXTURE_ENTRY(void)`) and one `fixture_main_args.c` (`int argc, char** argv`) chosen by a CMake function, removing at least 20 files (the five identical ones, `sr_bridge_main.c`, `sr_pipeline_main.c`, `sr_backend_switch_device_main.c`, `generation/device_main.c`, `fg_choice_main.c`, `capture_fixture_main.c` and the eight `anomaly_*` one-liners); step 2, per-archive `export_name = "main"` selected by a feature, or `[[bin]]` with `harness = false`, which also removes the `LINKER_LANGUAGE CXX` property set 43 times and the `/INCLUDE:main` special case. Confidence: h. **Status (round 4, constraint annotations only):** step 1 is done: `tests/fixture_main.c` (no arguments) and `tests/fixture_main_args.c` (`argc`/`argv`) take the entry from `RSF_FIXTURE_ENTRY` and replaced 19 launchers in round 1, `game-sdk/anomaly_main.c` and `contract_main.c` in round 3, and `anomaly_sr_jitter.c`, `anomaly_temporal_tests.c`, `anomaly_motion_contract_main.c`, `capture_fixture_main.c`, `vulkan-fg/ffx_fixture.c` and `native_fg_xess_vulkan_interop.c` in round 4 (their Rust entries now read the command line). `rsf_add_fixture_test` (T5) owns the launcher choice and the `LINKER_LANGUAGE CXX` flag for its 47 registrations (`tests/CMakeLists.txt`), and 25 other targets there set `LINKER_LANGUAGE CXX` themselves. Step 2 (per-archive `export_name = "main"` or `[[bin]]` with `harness = false`) is not possible for the reason in S7.2 (5); the launchers that remain are the S7.2 groups 1 to 4, each with its constraint. `LINKER_LANGUAGE CXX` stays on the executables that link C++ runtime archives (the C++ standard library comes from the link driver). Verified: `tests/fixture_main.c` and `tests/fixture_main_args.c` exist; the six launchers named as deleted in round 4 are gone; the launchers that remain are those listed in S7.2 groups (1) to (4), checked file by file. The constraint for step 2 is S7.2 (5): the fixture archives are shared (`rsf_orchestrator_rust` is linked by 19 targets, `rsf_generation_fixtures_rust` by at least 8). The Skyrim input fixture now also uses the shared no-argument launcher. Its Rust entry links the original guarded-read symbol and CTest keeps the same target and C++ link driver. +- [x] **T5 CMake registration boilerplate.** 145 `add_executable`, 194 `add_test`, 105 `set_tests_properties`, 87 `TIMEOUT`, 52 `SKIP_RETURN_CODE 77`, 153 `rsf_build_options`, 43 `LINKER_LANGUAGE CXX`; the same four lines repeat for every graphics, cpu, generation and overlay fixture (e.g. `tests/CMakeLists.txt:381-412,432-437,449-458,466-475,561-571`). Helpers already used for part: `rsf_add_loader_test` (`thin_loader.cmake:6`), `rsf_add_capture_fixture` (`CMakeLists.txt:228`), `rsf_add_g02_fixture` (`g02/fixture.cmake:4`). Three files repeat the "client that imports Runtime.dll" block: `d3d11_present_api.cmake:6-17`, `d3d11_fg_api.cmake:4-13`, `overlay_dll_api.cmake:3-20`; `anomaly_support.cmake:168-182` (`rsf_anomaly_sr_runtime_api_test`) is a fourth. Keep: one `rsf_add_fixture_test(NAME target ENTRY symbol LIBS ... [TIMEOUT n] [DEVICE])` and one `rsf_add_runtime_client(target source)`; verify with `ctest -N` listing the same 194 names. Confidence: h. **Reconciled against the tree:** Unfinished: no `rsf_add_fixture_test` or `rsf_add_runtime_client` exists; `tests/CMakeLists.txt` and `tests/*.cmake` still carry 174 `add_test`, 133 `add_executable`, 49 `SKIP_RETURN_CODE` and 42 `LINKER_LANGUAGE CXX`, and the "client that imports Runtime.dll" block is still repeated in `tests/d3d11_present_api.cmake`, `d3d11_fg_api.cmake`, `overlay_dll_api.cmake` and `anomaly_support.cmake`. Helpers present: `rsf_add_capture_fixture` (`tests/CMakeLists.txt:193`), `rsf_add_loader_test` (`tests/thin_loader.cmake:6`). Check with `ctest -N` that the test names do not change. **Round 3 (r3-tests):** `tests/fixture.cmake` defines `rsf_add_fixture_test(target [NAME] ENTRY LIBS [ARGV] [CXX] [MANUAL] [SKIP77] [TIMEOUT] [ARGS] [DEFINES] [SOURCES])`, `rsf_add_runtime_client(target sources)` and `rsf_add_c11_header_check`. About 40 fixture registrations in `tests/CMakeLists.txt` and the three Runtime-importing client blocks in `d3d11_present_api.cmake`, `d3d11_fg_api.cmake` and `overlay_dll_api.cmake` use them; target and test names are unchanged. Not converted, deliberately: the Vulkan registrations (the Vulkan worker rewrites them), the anomaly blocks in `anomaly_support.cmake` and `anomaly_fg.cmake` (including `rsf_anomaly_sr_runtime_api_test`, which shares a loop with the temporal-device client), `rsf_native_latency_vulkan_test`, and the capture and census blocks that already have their own helpers. The check is `ctest -N` against the earlier list, minus the three removed `*_c11_contract` entries (T13). +- [x] **T6 + BT-02 The same crate compiled once per feature in separate target dirs.** `cmake/rust_static.cmake:9-11` makes `cargo_dir/${package}-${target}` unique whenever `ARGN` is non-empty, so each `rsf_add_rust_static(... --features X)` is a full separate cargo compile (rebuilding `windows`, `windows-sys`, `ash` and the crate). 59 calls: `rsf-game-sdk-fixtures` 9 archives (`render-host-fixtures`, `cpu-fixtures`, default, `unity-sr-d3d12-fixture`, `plugin-session-fixture`, `fg-cpu-fixture`, `d3d11-host-fixture`, `vk-latency-fixtures`, `xell-fixture`; `tests/CMakeLists.txt:37,48,92,107,157,424,439,678,1123`), `rsf-vulkan-fg-fixtures` 10 (`xess-device`, `wsi-dispatch`, `ffx`, `xess-sr`, `xess-input-range`, `dispatch`, `fsr4-state`, `streamline-dispatch`, `streamline-selected`, `dlss`; `:740,751,760,853,863,871,904,918,936,947`), `rsf-anomaly` 10 (default, `native-entry`, `sr-fixtures`, `motion-binder-fixture`, `motion-device-fixture`, `motion-hooks-fixture`, `native-hook-fixture`, `input-hook-fixture`, `overlay-device-fixture`, `fg-fixture`), `rsf-capture-fixtures` 6, `rsf-rdr2` 2-3, `rsf-presentation-fixtures` 3 (`:370,505,833`), `rsf-unity-mono` 2; about 31 extra full dependency-tree compiles, 47 `rsf_add_rust_static` instantiations in the tests tree. Fixture features are additive and each executable selects its entry with `RSF_*_FIXTURE=`, so one archive with all features serves every executable (the linker pulls only referenced objects; the features add only `windows-sys` flags and optional crates). Keep: one archive each for `rsf-game-sdk-fixtures`, `rsf-vulkan-fg-fixtures`, `rsf-capture-fixtures`, `rsf-presentation-fixtures` (about 20 of the 47 compiles) and the eight Anomaly fixture features; `rsf-anomaly` and `rsf-rdr2` features that change production `cfg`s (`native-entry`, `mono-plugin`, `not(feature)` code) stay separate (X14). Risk: duplicate `#[no_mangle]` names show at link time. Where: also `tests/anomaly_support.cmake`, `tests/anomaly_fg.cmake`, `tests/overlay_dll_api.cmake`, `games/anomaly/CMakeLists.txt:4-5`, `games/unity-mono/CMakeLists.txt:4-5`; `tests/game-sdk/Cargo.toml:12-21`, `tests/vulkan-fg/Cargo.toml:14-27`. Confidence: m-h. **Done:** one target directory for every archive (cmake/rust_static.cmake copies each build to its own archive name and chains builds of one package); presentation, game-sdk, vulkan-fg, capture and anomaly fixtures build once with every fixture feature, the two rdr2 fixtures share one archive, 32 cargo calls removed. native-entry, mono-plugin, the rdr2 and AC7 variants stay separate archives. Duplicate #[no_mangle] names across the merged features show only at link time. +- [x] **T9 + S7.2 D3D11/D3D12 device, window, swap-chain and check-macro setup copied about 35 times.** 37 files create a D3D11 WARP device (25 in `tests/`, 6 in `games/anomaly`, 4 in `runtime/orchestrator`, 1 in `games/rdr2`, 1 in `tools/exposure_probe`), 11 call `D3D11CreateDeviceAndSwapChain`, 21 call `RegisterClass*` (15 register a hidden `DefWindowProcW` window), 15 files call `D3D12CreateDevice` in tests, and 15 local `check!`/`expect!`/`ensure!`/`verify!` macros exist. Shared one: `tests/support/src/device.rs` (was `tests/graphics_fixture_device.rs:18-35`). D3D11 copies: `tests/presentation/src/lib.rs:97-123` and `fixture_device.rs:118-140` (two in one crate), `tests/capture/src/windows/d3d11.rs:53,73-94` and `texture.rs:39`, `tests/ac7-capture/src/warp.rs:110,168-188`, `tests/overlay/src/host.rs:286,336`, `tests/overlay-service/src/device/native.rs:94,137`, `tests/g02/d3d11.rs:43`, `tests/generation/src/leases.rs`, `tests/loader/src/windows/census_warp.rs`, `tests/auxiliary_sr.rs:36`, `tests/ac7_native_graph.rs:876`, `tests/ac7_velocity_warp.rs:47`, `tests/sr_backend_switch_device.rs:118`, `depth_scale.rs`, `exposure_normalization.rs`, `native_reinsert.rs`, `sharpening_d3d12.rs`, C files `d3d11_observer.c`, `d3d12_observer.c`, `frame_tap.c`; fixtures inside production crates `games/anomaly/src/{motion/device_fixture.rs:93, overlay/fixture.rs:96,181, sr_fixture_device.rs:25, fg_stage/fixture_device.rs:121,176}`, `games/anomaly/examples/{anomaly_foliage_shader_device.rs:395, anomaly_motion_tess_device.rs:46, temporal_shader_device/mod.rs:178}`, `games/rdr2/src/capture_state/fixture/driver.rs:438`, orchestrator `dlss_pipeline/exports/fixture.rs:78`, `dlss_streamline/exports/fixture.rs:49`, `shader_patch/fixture/device.rs:236`, `sr_bridge/fixture.rs:237`, `tools/exposure_probe/src/lib.rs:186`. D3D12 copies: `tests/capture/src/windows/d3d12.rs:23-34`, `exposure_normalization.rs:173`, `game-sdk/src/unity_sr_d3d12/gpu.rs:77,493`, `generation/src/device.rs:63,95`, `generation/src/leases.rs:68`, `overlay/src/native12.rs:42`, `presentation/src/fixture_device.rs:167`, `presentation/src/lib.rs:134`, `sharpening_d3d12.rs:89`. Window-class copies also at `tests/loader/src/windows/census_present.rs:64`, `tests/overlay/src/lib.rs:56`, `presentation/src/gl_fixture.rs:405`, `present_fixture_startup.rs:102`, `vulkan-fg/src/xess_present.rs:46`. Macro copies: `tests/generation/src/leases.rs:42`, `session.rs:56`, `sr_backend_switch_device.rs:74-77`, `vulkan-fg/src/fsr4_state.rs:71-85`, `engine_sharpening.rs:82`, `loader/src/windows/census_modes.rs:25`, `presentation/api/src/lib.rs:159`, `godot_graph_handoff.rs:214,272`, `games/anomaly/src/motion/device_fixture/harness.rs:50`, and a hard duplicate in `runtime/orchestrator/src/fsr4_fg_bridge/state_fixture.rs:44-50,352-360` and `vulkan_fsr4_sr/state_fixture.rs:71-86` (same `check!`, same `expect!`, same `leaf!`; the second adds `Some(callback)`). Keep: one `tests/support` crate (path dependency, not shipped) with `warp_d3d11()`, `warp_d3d12()`, `hidden_window()`, `warp_swapchain()`, `check!`, `wide()`, built from `tests/graphics_fixture_device.rs`; orchestrator and anomaly fixtures take it as an optional dependency under the fixture feature. Copies differ on purpose in places (feature levels `None` vs `[11_1, 11_0]`, `DEBUG` flag first, adapter parameter): the helper takes arguments. Each user is a CTest entry. Confidence: h (duplication), m (line savings). **Status (round 4, constraint annotations only):** `tests/support` (`rsf-test-support`) holds the shared `Window`, `default_window_procedure`, `Library`, `d3d11_device`, `warp_d3d11`, `d3d11_swapchain`, `warp_swapchain`, `warp_d3d12`, `enable_d3d12_debug_layer` and `check!`. Rounds 1 and 3 moved the generation, overlay, overlay-service, ac7-capture and capture fixtures and the orchestrator files compiled from `tests/` onto it, and the two orchestrator state fixtures share `runtime/orchestrator/src/fixture_checks.rs`. Round 4 moved the rest that match a helper: the orchestrator `shader_patch/fixture/device.rs` and `dlss_streamline/exports/fixture.rs`, the Anomaly `overlay/fixture.rs` and the `anomaly_foliage_shader_device`/`temporal_shader_device` examples (feature level read with `GetFeatureLevel`), the RDR2 `capture_state/fixture/driver.rs` D3D12 device, and `tests/ac7_velocity_warp.rs` and `tests/ac7_native_graph.rs` (rsf-ac7 and rsf-ac7-plugin take the crate under `warp-fixture`); each crate takes it as an optional dependency of the fixture feature, or a dev-dependency, so shipping builds never link it. Not folded, with the reason: the remaining device setups create on a chosen adapter with `D3D_DRIVER_TYPE_UNKNOWN`, which the helpers do not take (`tests/presentation/src/{lib,fixture_device}.rs`, `runtime/orchestrator/src/dlss_pipeline/exports/fixture.rs` and `sr_bridge/fixture.rs`, `tests/sr_backend_switch_device.rs`, `tools/exposure_probe/src/lib.rs`, the Anomaly `motion/device_fixture.rs`, `sr_fixture_device.rs`, `fg_stage/fixture_device.rs` and `anomaly_motion_tess_device.rs`); `tests/loader/src/windows/census_warp.rs` reaches D3D12 through `GetProcAddress` on purpose; the other local check macros count failures in different places (`sr_backend_switch_device.rs` a `&mut` counter, `godot_graph_handoff.rs` a C++ runner, `census_modes.rs` a `Checks` value, `motion/device_fixture/harness.rs` returns `Err`, `vulkan_dx12_fg/fsr4_state_fixture.rs` a thread-local that survives its per-case state reset), so one macro would change their call sites and semantics. **Done (final verification):** every chosen-adapter setup goes through the support helpers. `tools/exposure_probe/src/lib.rs` `native_device` calls `d3d11_device_on` (the probe takes `rsf-test-support`); the Anomaly FG fixture's chosen-adapter swap chain (`games/anomaly/src/fg_stage/fixture_device.rs` `create_chain`, a `D3D11CreateDeviceAndSwapChain` call, not `D3D11CreateDevice`) calls the new `d3d11_swapchain_on`, which `d3d11_swapchain` forwards to as `d3d11_device` does to `d3d11_device_on`. The other files the review named (`tests/presentation/src/{lib,fixture_device}.rs`, `tests/sr_backend_switch_device.rs`, `games/anomaly/src/sr_fixture_device.rs`, `motion/device_fixture.rs`, `examples/anomaly_motion_tess_device.rs`, `runtime/orchestrator/src/dlss_pipeline/exports/fixture.rs`, `sr_bridge/fixture.rs`) already called `d3d11_device_on`. The `census_warp.rs` `GetProcAddress` case and the per-site `check!` macros with different failure accounting stay as written. +- [x] **T10 + S7.2 Hand-declared Win32 and raw vtables in bare-`rustc` tests.** `LoadLibraryW/ExW`, `GetProcAddress`, `FreeLibrary` declared by hand at `tests/anomaly_bootstrap.rs:16-19`, `tests/engine_sharpening.rs:31-33`, `tests/native_vulkan_exports.rs:9-14`, `tests/unity_mono_runtime.rs:13-14`; `tests/g02/d3d11.rs:7-60` implements `Com`, `slot(object, index)` and a `D3D11CreateDevice` import with raw `u32` parameters, and `g02/constant_override.rs` (23,633 bytes) and `g02/scene_promote.rs` (13,725 bytes) call D3D11 by slot number. Bare `rustc` cannot depend on crates; everything else in `tests/` uses `windows`. Keep: Cargo test crates (or members of the T9 support crate); `sdk/game/src/win32.rs:55` `typed_export` is the load helper. Tests: CTest `constant_override`, `scene_promote`. Confidence: h. **Done (tree check):** `tests/g02` is gone and `tests/process` (`anomaly_bootstrap`, `engine_sharpening`, `native_vulkan_exports`, `unity_mono_runtime`) loads DLLs through `rsf_test_support::Library`; no hand-declared `LoadLibraryW`/`GetProcAddress` remains under `tests/`. +- [x] **T11 + BT-01 Bare-`rustc` compile commands and the target-triple switch repeated.** `rustc` located five ways: `RSF_TEST_RUSTC` (`tests/CMakeLists.txt:10`), `RSF_RUSTC` (`:170`, again `:485`), `ac7_fixture_rustc` (`:301,304`), `fixture_rustc` (`g02/fixture.cmake:4-9`). Triple switch `MSVC ? x86_64-pc-windows-msvc : x86_64-pc-windows-gnu` in eight places: `rust_target` (`cmake/rust_static.cmake:3-4`), `rsf_test_rust_target` (`:11-12`), `unity_mono_fixture_target` (`:171-172`), `ac7_fixture_target` (`:306-307`), `overlay_fixture_rust_target` (`:486-487`), `godot_graph_rust_target` (`:699-700`), `anomaly_support.cmake:127`, `g02/fixture.cmake:11`. Custom commands running `rustc --edition=2024 --target ... -o `: `native_vulkan_exports` (`:19-27`), `anomaly_bootstrap` (`:70-84`), `unity_mono_runtime` (`:178-185`), `rsf_ac7_fixture_object` (`:311-324`), `ac7_session_object` (`:333-343`), `ac7_view_fixture_object` (`:813-823`), `overlay_panel_fixture` (`:494-504`), `godot_graph_object` (`:706-719`), `engine_sharpening` (`:1097-1106`), `g02` (`g02/fixture.cmake:3-30`). `ac7_session_object` and `ac7_view_fixture_object` re-spell the whole body of `rsf_ac7_fixture_object`, the function defined to avoid that. Keep: one `RSF_RUST_TARGET` variable set in `cmake/rust_static.cmake`, one `rsf_add_rust_exe`/`rsf_add_rustc_fixture(name source [CRATE_TYPE] [DEPENDS ...])` function, `rsf_ac7_fixture_object` for the two hand copies, or better Cargo crates through `rsf_add_rust_static` (T10, S7.2). The ac7 trio and `unity_mono_runtime` go first. Tests: CTest `ac7_view`, `ac7_session`, `ac7_render_scope`, `ac7_native_graph`, `unity_mono_*`, `native_vulkan_dll_exports`, `anomaly_bootstrap_contract`, `engine_sharpening_settings`, `overlay_host`, `godot_graph_handoff_contract`. Confidence: h. **Done (tree check):** the triple switch is `RSF_RUST_TARGET` in `cmake/rust_static.cmake:3-5`, and the bare-`rustc` fixture machinery was deleted (commits "Move the bare-rustc fixtures into Cargo crates", "Delete the bare-rustc CMake machinery"). Kept: `tests/CMakeLists.txt:554-570` (`godot_graph_object`) builds `integrations/godot/modules/rescaleframe/viewport.rs` with `rustc --crate-type=lib --emit=obj`, because the Godot module is built by the engine as a bare rustc object and the fixture must compile the same file the same way; its C++ includer is `tests/godot_graph_handoff.cpp` (`:573`). +- [x] **T12 + BT-17 Seven `*_embedded` CTest pairs (decision D16).** `render_frontend`/`render_frontend_embedded` (`tests/CMakeLists.txt:120-127`), `callback_host_abi`/`_embedded` (`:128-135`), `gpu_sr_policy`/`_embedded` (`:149-156`), `plugin_session_lifetime`/`_embedded` (`:161-168`), `native_translucency_abi`/`_embedded` (`:574-592`), `fg12_abi`/`_embedded` (`:605-610`), `sr12_abi`/`_embedded` (`:611-616`) build the same source, define (`RSF_CPU_FIXTURE=rsf_test_render_frontend` at `:121` and `:125`) and fixture archive twice, once linking the `rsf_orchestrator` DLL and once `ReScaleFrame::OrchestratorCore`; `rsf_orchestrator` is `SHARED $` (`runtime/orchestrator/CMakeLists.txt:141`) so both run the same objects. Keep: the DLL-linked test per pair (proves the `RSF_EXPORT` list) and one embedded smoke test for AC7's linked consumption; a `foreach` helper replaces the 14 hand-written blocks. Some embedded variants cover symbols the DLL does not export (X2). Confidence: m-l. **Done:** six of the seven embedded pairs are removed (`callback_host_abi`, `gpu_sr_policy`, `plugin_session_lifetime`, `native_translucency_abi`, `fg12_abi`, `sr12_abi`); `render_frontend_embedded` stays as the one embedded smoke test (decision D16). +- [x] **T13 C11 API clients and Rust fixtures overlap.** `tests/d3d11_present_api.c`, `d3d11_present_api_c11.c`, `d3d11_fg_api_c11.c`, `overlay_dll_api_c11.c` with Rust fixtures `tests/presentation/api/src/lib.rs` and `tests/overlay-service`. `overlay_dll_api_c11.c:26-33` checks null query, short struct, wrong version, size and version echo, all-slots-set, tail-preserving extended struct, which `presentation/api/src/lib.rs:75-100` (`refusal_contract`), `:108-` (`guard_page_contract`), `:208-` (`extension_contract`) also check; `d3d11_present_api.c:12-34` (`RSF_CHECK_SLOT` x22) asserts the slot list also at `d3d11_present_api_c11.c:25-26` and `lib.rs:158` (`slot_contract`); `d3d11_fg_api_c11.c:22-23` repeats `RSF_GAME_ABI_VERSION == 24` and `RSF_D3D11_FG_API_VERSION == 4`, which `tests/game-sdk/src/contract.rs` already pins, so every ABI bump edits several files. Compiling the public header as C11 (`C_STANDARD 11 C_EXTENSIONS OFF`) is unique. Keep: compile-only object libraries like `fg_c_header.c`, `sdk_c_header.c`, `input_dump_c_header.c`, `d3d11_host_c_header.c` (all `add_library(... OBJECT)`) and one Rust fixture per API for behaviour; drop the `main` bodies of the three `_c11.c` files and the duplicate slot list (the three `*_api` CMake client files repeat each other too, see T5). Confidence: m. **Reconciled against the tree:** Unfinished: `tests/d3d11_present_api.c` (41 lines), `d3d11_present_api_c11.c` (29), `d3d11_fg_api_c11.c` (38) and `overlay_dll_api_c11.c` (54) still define `main` and repeat checks that `tests/presentation/api/src/lib.rs` and `tests/overlay-service/src/lib.rs` make. Reduce them to compile-only object libraries (the C11 header compile is the unique part) and keep behaviour in the Rust fixtures. **Round 3 (r3-tests):** `d3d11_present_api_c11.c`, `d3d11_fg_api_c11.c` and `overlay_dll_api_c11.c` have no `main`; they are `rsf_add_c11_header_check` OBJECT libraries that keep the strict C11 compile and the layout asserts. The version pins that `tests/game-sdk/src/contract.rs` owns are gone from the FG one. `d3d11_present_api.c` keeps its `RSF_CHECK_SLOT` signature asserts (a compile-time check that each slot type matches the exported function, which `slot_contract` cannot make) and calls the Rust fixture. The `*_c11_contract` CTest entries (3) are removed. +- [x] **T14 Tests of the harness, not the product.** Four `WILL_FAIL` CTest entries confirm an unknown selector argument fails: `anomaly_temporal_unknown_selection` (`tests/anomaly_support.cmake:9-10`), `anomaly_sr_swap_unknown_selection` (`:71-72`), `anomaly_motion_unknown_selection` (`:103-104`), `anomaly_sr_jitter_unknown_selection` (`:172-173`); they exist because each fixture picks its case from `argv[1]`. Keep: register each case as its own CTest entry from one CMake list (as `thin_loader.cmake:35-42` does for 46 scenarios) so an unknown name cannot be passed. Low value. Confidence: m. **Done:** the four `*_unknown_selection` WILL_FAIL entries are deleted. +- [x] **T15 + BT-04 (thin_loader_inject) Stale hand-off notes and an unincluded cmake file.** `tests/d3d11_present_api.md` (70 lines) says "Include this one line in the parent's `tests/CMakeLists.txt`" (done at `:36`) and describes an untracked file under `build/`, referenced nowhere; `tests/thin_loader_inject.cmake` (3 lines, "Opt-in isolated registration without editing the root") has no includer, only the comment at `thin_loader.cmake:1`; hand-off comments at `d3d11_present_api.cmake:1` ("Include at the end of the root build") and `d3d11_host_rendered_fg_device.cmake:7-14` ("Coordinator integration: include this file from tests/CMakeLists.txt"); PORT.md:992,2055,2062,2114 lists `tests/anomaly_*_device.cpp` and `d3d11_host_rendered_fg_device.c` as ports while the `.cpp` files no longer exist. Keep: delete the first two, trim the comments. Confidence: h. **Done:** `tests/d3d11_present_api.md` and `tests/thin_loader_inject.cmake` are deleted and the three hand-off comments trimmed. +- [x] **T16 + BT-04 (executables) Manual experiments and orphan executables built by default (decision D17).** `rsf_exposure_probe` (`tests/CMakeLists.txt:794-811`, "Explicit hardware experiment, never run by routine CTest", built in `ALL`, with the `tools/exposure_probe` workspace crate (also compiled by clippy), `renderdoc.c`, `ngx.c`, a 288-line bindgen file); `rsf_census_present_coexistence` (`:1020`, "run by hand", `ALL`); `rsf_anomaly_motion_tess_device_test` (`anomaly_support.cmake:135`, `add_custom_target(... ALL)` running an extra `cargo build --example` per build); `rsf_shader_patch_test` (`tests/CMakeLists.txt:30-31`, same `shader_patch_main.c` as the registered device test at `:32-35`, named by no `add_test`); `rsf_d3d11_host_shared_sr_device` (`:6`) and `rsf_d3d11_host_rendered_fg_device` (`d3d11_host_rendered_fg_device.cmake:3-4`) are `EXCLUDE_FROM_ALL` with no `add_test` and are the only users of the `d3d11-host-device-fixtures` feature: `tests/presentation/src/d3d11_host_device*.rs` (about 2,850 lines with the 714-line `d3d11_host_device_abi.rs`), `tests/d3d11_host_rendered_fg_device.c` (29 KB), `d3d11_host_shared_sr_device.c` (11 KB), `d3d11_host_device_launch.h`, `d3d11_host_device_fixture.h`; `games/anomaly/examples/` (3 programs, 2,286 lines, each with a WARP `D3D11CreateDevice`) run by Python verifiers and the `:135` target, not ctest. Keep: `EXCLUDE_FROM_ALL` on all manual targets, drop `rsf_shader_patch_test`; whether the `d3d11-host-device-fixtures` code stays is the owner's. Confidence: h (build behaviour), l (keep-or-drop). **Done:** rsf_exposure_probe, rsf_census_present_coexistence, rsf_shader_patch_test (documented corpus parity run) and rsf_rdr2_attach are EXCLUDE_FROM_ALL. rsf_anomaly_motion_tess_device_test stays in ALL: it is the CTest entry anomaly_motion_tess_device. +- [x] **T17 Anomaly evidence scripts placed in `tests/` (decision D28).** `tests/anomaly_{sr,geometry,motion,fg,profile,shader_provider}_evidence.py` (about 150 KB) plus `anomaly_sr_evidence.py` imported by `anomaly_fg_evidence.py` and `anomaly_motion_evidence.py`; `anomaly_support.cmake:52-53` says `anomaly_sr_evidence.py --verify` "is not registered here because it needs the game install" and only a self-test is wired. Helpers `verify`, `main`, `ints` (fg and sr), `verify_unique_guards` (geometry and motion) are defined in several files. Keep: move to `tools/` with one shared helper module for the repeated PE and byte-guard code; docs and READMEs citing `tests/` paths (`docs/research/anomaly-sr-seam.md`, `games/anomaly/PROGRESS.md`, `src/sr_profile.h`) need updating. Confidence: m (placement, not deletion). **Done:** six scripts moved to tools/; the duplicated unique-guard loop is one function (geometry.check_guards). fg and sr keep their own ints(): the two regexes accept different profile spellings. + +### Build and tooling + +- [x] **BT-05 Vendor pins repeated and receipt logic duplicated.** Streamline source commit `2122257e0fce486f91b385aa63b9a09b0a34b363` appears in `runtime/orchestrator/CMakeLists.txt:99`, `runtime/vulkan/streamline/build.ps1:45`, `build-sdk.ps1:26`, `sdk-fixes/prepare.py:554`, `sdk-fixes/selected_device.py:10`, `integrations/godot/dependencies.json:21`. FidelityFX Vulkan commit `c6efa6bf7f2027b3ec94f28578bb5965eabb9e55` appears in 12 files (6 `fsr3/sdk-fixes/*.json`, `fsr3/generate-bindings.py:10`, `integrations/godot/dependencies.json:29`, `tools/analyze-godot-fsr2-dilation.py:100`, `tools/diagnostics/prepare-fsr2-stage.py:54`); `7539ae8b...` in `fsr4/generate-bindings.py:9` and `fsr4-fg/generate-bindings.py:9`. Receipt verification is OV-D2. Keep: `integrations/godot/dependencies.json` already holds most pins; read them from there (CMake `string(JSON ...)`, PowerShell `ConvertFrom-Json`, Python `json`). A wrong pin surfaces as a configure or script failure. Confidence: h. **Partly done:** not done: the pins sit in scripts D7 retires. **Reconciled against the tree:** receipt verification is one script (`runtime/vulkan/streamline/verify-receipt.cmake`) and `CMakeLists.txt`/`build.ps1` no longer carry the Streamline commit. Kept: the `sdkCommit` fields of `runtime/vulkan/fsr3/sdk-fixes/*.json`, `prepare.py:554` and `selected_device.py:10`, because they are the patches' own precondition and the corrected-SDK receipt pins those files' hashes (see the blocked `sdk-fixes` entries). Unfinished: `runtime/vulkan/streamline/build-sdk.ps1:26`, `verify-receipt.cmake:7`, `runtime/vulkan/fsr3/generate-bindings.py:16`, `tools/diagnostics/prepare-fsr2-stage.py:54` and `tools/analyze-godot-fsr2-dilation.py:100` should read `integrations/godot/dependencies.json:21,29`. **Round 3:** done. `build-sdk.ps1` (`ConvertFrom-Json`), `verify-receipt.cmake` (`string(JSON ...)`), `fsr3/generate-bindings.py`, `prepare-fsr2-stage.py` and `analyze-godot-fsr2-dilation.py` (`json`) read `vendor.streamline_source.revision` and `vendor.fidelityfx_vulkan.revision` from `integrations/godot/dependencies.json`. `build-sdk.ps1` is hashed into the corrected-SDK receipt as `recipeSha256`, so a cached corrected Streamline runtime built before this change fails the receipt check until `build-sdk.ps1` rebuilds it. The `fsr4`/`fsr4-fg` `7539ae8b...` pins no longer exist in the tree. +- [x] **BT-06 + S5 Seven bindgen generators repeat the same preamble and none runs in CI.** Preamble (bindgen `0.72.1` check, CRLF-to-LF rewrite, flags `--no-doc-comments`, `--use-core`, `--rust-edition 2024`, `--rust-target 1.85`) at `tools/generate-rust-bindings.py:9-10,20` (1,274 lines; 165 outputs across sdk/game, runtime/orchestrator, loader, games/*, ui/overlay, tools, tests; 178 `generate(...)` entries all pointing at existing headers and outputs), `generate-d3d12-vendor-bindings.py:32-33` (outputs `reflex_nvapi_abi.rs`, `d3d12_sr/xess_abi.rs`, `d3d12_generation/xess_abi.rs`, `vulkan_sr/xess_sdk_abi.rs`, `d3d12_sr/fsr_abi.rs`, `d3d12_generation/fsr_abi.rs`; needs `vendor/xess/inc`, `vendor/fidelityfx/Kits/FidelityFX`, a Vulkan SDK include path, an NVAPI SDK path), `generate-godot-module-bindings.py:9-10` (`packet_abi.rs`), `generate-godot-vulkan-bindings.py:12-13,112,116`, `runtime/vulkan/fsr3/generate-bindings.py:13-14,43` (needs a FidelityFX SDK checkout at `c6efa6bf...` plus Vulkan headers), `fsr4/generate-bindings.py:12-13`, `fsr4-fg/generate-bindings.py:12-13` (also `bridge_objects_abi.rs`); `generate-godot-module-bindings.py` and `generate-d3d12-vendor-bindings.py` are named by no file, not even a doc. Also `tools/generate-anomaly-native-profile.py`, `tools/generate-anomaly-sr-profile.py` (regions of `native_profile.h`, `geometry_profile.h`, `sr_profile.h`; they have `--check`) and `games/minecraft/eng/generate-native-status.py` (not bindgen). Keep: one `tools/bindgen_common.py` (`require_bindgen()`, `run()`, `write_lf()`) and one driver that also supports `--check`, run from `verify.ps1` where bindgen exists (needs LLVM on the runner, D26); see X15. Confidence: h. **Done:** committed_bindings.bindgen() holds the version check and shared flags for all seven generators (syntax-checked only; bindgen-cli is not installed here). The vendor generators stay separate: they need external checkouts. +- [x] **BT-07 Dependency declarations outside `[workspace.dependencies]`.** `Cargo.toml:47-48` has only `egui`; 21 `windows` declarations (14 as `0.62.2`, 7 as `=0.62.2`), 23 `windows-sys = 0.61`, 7 `ash = =0.38.0`, `cc = "1"` in 2 crates. Keep: `[workspace.dependencies]` for `windows`, `windows-sys`, `ash`, `cc`; members keep only their `features`; port skyrim-se off `winapi` (see that cross-cutting entry). `Cargo.lock` must resolve identically (`cargo build --locked`). Confidence: h. **Done:** windows, windows-sys, ash and cc are workspace dependencies; cargo metadata --locked leaves Cargo.lock unchanged. skyrim-se winapi is a code port and stays. +- [x] **BT-12 yyjson provisioned in two places and `build.rs` boilerplate.** `runtime/shader_patch/CMakeLists.txt:1-2` (`include(yyjson.cmake)`, downloads at configure time) and `runtime/orchestrator/build.rs:25-31` (runs `cmake -P yyjson.cmake` again, compiles `yyjson.c`); nothing in CMake compiles yyjson; the only other reader is `tools/package-anomaly.py:159,214-220`. In `runtime/orchestrator/build.rs`: the `if CARGO_CFG_TARGET_ENV == "msvc" { flags(["/Zl","/std:c11"]) }` block appears in five functions (`:33,64,78,91,108`); `:128-130` list `rerun-if-changed` for `d3d11_output_platform.h`, `d3d11_state.h`, `srv_format.h`, which nothing compiled by this `build.rs` includes; `streamline_guard()` (`:105-119`) compiles `../vulkan/streamline/sdk_guard.c` a second time (see S1.5). Keep: the `build.rs` provisioning (it also serves plain `cargo`), `package-anomaly.py` reads `vendor/shader-patch/yyjson` after a cargo build, drop the CMake include; one `fn c11(build)` helper; delete the three dead `rerun-if-changed` lines. Related: RS-C1 (D2). Confidence: m (yyjson), h (rerun lines). **Partly done:** fn c11() replaces five copies of the msvc flag block and three dead rerun-if-changed lines are gone. The yyjson provisioning in runtime/shader_patch/CMakeLists.txt and build.rs stays for the D2 serde_json replacement. **Done (tree check):** `yyjson` appears in no source, build or script file any more; D2 replaced it with `serde_json`, which removed `runtime/shader_patch/yyjson.cmake`, the CMake include and the `build.rs` provisioning. +- [x] **BT-13 Four ways to find `vulkan.h`, and options defaulting into gitignored directories.** `RSF_VULKAN_INCLUDE` (default `references/godot/engine/thirdparty/vulkan/include`, gitignored), `RSF_FRAME_DUMP_VULKAN_INCLUDE` (`find_path` with `$ENV{VULKAN_SDK}`), `find_package(Vulkan)`, and a bare `Vulkan_INCLUDE_DIR` in `tests/CMakeLists.txt:1053` set only if the Unity branch ran; `EXISTS "${RSF_VULKAN_INCLUDE}/vulkan/vulkan.h"` evaluated 11 more times; `RSF_STREAMLINE_VK_RUNTIME` defaults into `.local/`. Sites: `runtime/orchestrator/CMakeLists.txt:45-46,63,95,131-132`, `integrations/unity/CMakeLists.txt:2`, `tests/CMakeLists.txt:253,724,739,750,858,862,894,916,934,1053,1084`. A clean checkout or CI never builds the 12 `RSF_HAVE_*`/`RSF_VULKAN_*_ENABLED` variants (the "CI builds it both ways" claim, X6, is false). Keep: one `cmake/rsf_vendor.cmake` resolving each vendor once into booleans (`RSF_HAVE_VULKAN`, `RSF_HAVE_FFX_VK`, ...) and one Vulkan header lookup; configure with and without the vendor trees. Confidence: m. **Done:** cmake/vendor.cmake declares every vendor cache path and the RSF_HAVE_* flags once and finds the frame-dump Vulkan headers once; RSF_XESS_VK_INCLUDE is RSF_XESS_INCLUDE. RSF_STREAMLINE_VK_RUNTIME still defaults into .local/. +- [x] **BT-14 Duplicated helpers in Python and PowerShell tools.** `digest()` in 7 files (`anomaly_motion_deploy.py`, `anomaly_shader_tool.py`, `anomaly_temporal_shader.py`, `package-ac7.py:27`, `package-release.py:35`, `package-wingman.py:22`, `patch-drag-n-wash-motion.py`); `git()` in `package-ac7.py:23`, `package-release.py:24`, `package-wingman.py:18`; `Refusal` and `tree`/`stage` in 3 Anomaly shader tools; `package-anomaly.py:25-33`, `package-rdr2.py:7-18`, `package-release.py:130-135`, `package-unity-notices.py:9` each load `package-ac7.py` through `importlib`/`runpy` because the hyphenated name cannot be imported; `tools/dump/apply_ida.py` and `apply_ghidra.py` share 167 identical non-trivial lines (`parse_int`, `sanitize`, `rebase`, `Plan`, `_unique`, `_census_entries`, `build_plan`, `load_json`, `self_test`), documented as "shared verbatim". Keep: `tools/package_common.py` (`git`, `digest`, `copy`, `dependency_notices`) and `tools/dump/plan.py` imported by both scripts. Tests: `package_release_test.py` and `package_anomaly_test.py` (once registered, X8), the dump scripts' `--self-test`. Confidence: h. **Done:** tools/package_common.py replaces the copies and the importlib/runpy loaders in the five packagers. tools/dump/plan.py is not done: apply_ida.py and apply_ghidra.py run inside IDA and Ghidra (Jython), where a sibling import is untestable here. +- [x] **BT-15 Anomaly shader tool cluster with no production consumer (decision D28).** `tools/anomaly_shader_tool.py` (353 lines), `anomaly_shader_constants.hlsli`, `anomaly_shader_vanilla_profile.json`, `anomaly_shader_README.md` (195 lines), `tests/anomaly_shader_test.py` and ctest `anomaly_shader_tool_contract` (`tests/anomaly_support.cmake:15`). README says it is "not a temporal shader implementation"; it inventories shaders and stages an include preview. The production path is `rsf_shader_pack.py` (built by `games/anomaly/CMakeLists.txt:27-31`) plus `anomaly_temporal_shader.py` and `anomaly_foliage_shader.py`; the tool, profile and hlsli are named only by their own README and test. Keep: delete the cluster, or move to `docs/research` if the owner still wants the inventory output. Confidence: m. **Done:** tool, profile, header, test and ctest entry deleted; the README moved to docs/research/anomaly-shader-inventory.md because three docs cite it as source evidence. +- [x] **BT-16 VulkanStory standalone build scripts.** `runtime/vulkan/{fsr3,fsr4,xess-fg,streamline}/build.ps1`, `ngx/build.ps1`, `ngx/build.sh`, `integrations/vulkanstory/native/*`, `Cargo.toml:52-53`, `runtime/vulkan/ngx/Cargo.toml` (`cdylib`, `libc` for unix): five scripts with the same "stage in a temp dir, build, `Move-Item` over the target" skeleton and four build mechanisms (`rustc` direct for fsr3 and xess-fg, cargo + gcc link for fsr4 and streamline, cargo for ngx); no script in this repo calls them; `fsr4/build.ps1:12,19,34-37` requires `-MinHookRoot` and says "defaults to the sdk/minhook submodule" but the repo has no `.gitmodules` and pins MinHook only in `CMakeLists.txt:53-55`; `Cargo.toml:53` lists `vulkanstory_compat` in `check-cfg` for the whole workspace to serve one raw-`rustc` build. Keep: one build script and one pin source if the standalone DLLs remain after D7; delete the stale submodule text now. Confidence: m. **Partly done:** nothing deleted: runtime/vulkan/*/build.ps1 and the READMEs name the VulkanStory host repo (which does have the sdk/minhook and sdk/fidelityfx submodules) as their caller, so the submodule wording is correct. D7 retires the scripts with the shim. **Partly done (stage B):** `fsr3` and `xess-fg` now build with Cargo like `fsr4`, `streamline` and `ngx`, `Cargo.toml` no longer declares `vulkanstory_compat`, and the stale MinHook submodule text is gone; the five scripts stay separate because each links different SDK inputs. **Reconciled against the tree:** kept. The five `runtime/vulkan/{fsr3,fsr4,xess-fg,streamline,ngx}/build.ps1` scripts (plus `ngx/build.sh`) are called by the VulkanStory host repo, which owns the `sdk/minhook` and `sdk/fidelityfx` submodules their parameters name; each links different SDK inputs. `fsr3` and `xess-fg` build with Cargo like the others and `vulkanstory_compat` is gone from `Cargo.toml`. +- [x] **BT-19 Unreferenced scripts.** Named by no file outside themselves: `tools/package-wingman.py` (D20), `tools/send-game-key.py`, `tools/diagnostics/capture-godot-fsr2-stage.ps1`, `eng/test-godot-sharpening.ps1`, `eng/test-unity-sharpening.ps1` (note: `tests/unity-package-layout` is rebuilt by it, `eng/test-unity-sharpening.ps1:7`; keep while X5 stays). Named only by one research note: `tools/inspect-skyrim-hooks.py`, `inspect-skyrim-shaders.py`, `patch-drag-n-wash-motion.py`, `eng/deploy-unity-character-motion.ps1`, `tools/watch-runtime-stall.py`, `eng/test-fsr4-vulkan-interop.ps1`, `eng/test-xess-fg-vulkan-interop.ps1`, `eng/test-godot-sync-isolation.ps1`, `tools/analyze-godot-fsr2-dilation.py`, `tools/diagnostics/*`. Keep: the research-note ones reproduce a recorded result (AGENTS.md wants research reproducible): move them beside the note (D29), delete the first group after a check. GPL SPDX headers on several: X4. Confidence: m. **Partly done:** deleted send-game-key.py and capture-godot-fsr2-stage.ps1; moved inspect-skyrim-hooks/shaders.py, patch-drag-n-wash-motion.py and deploy-unity-character-motion.ps1 to docs/research/scripts (D29). Kept in place: eng/test-godot-sharpening.ps1 and test-unity-sharpening.ps1 (the only runners of the Godot Resource and Unity layout tests), the four Godot interop scripts (they dot-source the kept godot-artifacts.ps1 harness) and the other tools/diagnostics scripts (named by docs/research/godot-fsr2-stage-edges-20261025.md). **Reconciled against the tree:** kept as stated: `tools/package-wingman.py`, `send-game-key.py` and `capture-godot-fsr2-stage.ps1` are deleted and the Skyrim, drag-n-wash and Unity research scripts moved beside their notes. Kept: `eng/test-godot-sharpening.ps1` and `eng/test-unity-sharpening.ps1` (named by no file, but the only runners of the Godot Resource and Unity layout tests; the latter rebuilds `tests/unity-package-layout`, `:7`), `tools/watch-runtime-stall.py` (named by `docs/diagnostics.md`) and the Godot interop and analysis scripts, each named by a `docs/research/godot-*-20261025.md` note. +- [x] **BT-20 Godot harness (decision D8).** About 2,800 lines: `eng/build-godot*.ps1`, `prepare-godot.ps1`, `patch-godot.py` (465), `godot-*.ps1`, `capture-godot.ps1`, `test-godot*.ps1` (5 files, 702 lines), `tools/analyze-godot-*.py`, `tools/diagnostics/*`. Godot is not in the release set (`tools/package-release.py:130-135` lists AC7, RDR2, Anomaly, plus the Unity and Minecraft paths). Keep: owner's decision (keep or archive). Confidence: l. **Reconciled (D8 ruling):** keep. The harness stays (`eng/build-godot*.ps1`, `prepare-godot.ps1`, `patch-godot.py`, `godot-*.ps1`, `test-godot*.ps1`, `tools/analyze-godot-*.py`); the one unreferenced Godot script that D8 would delete, `capture-godot-fsr2-stage.ps1`, is gone (BT-19). +- [x] **BT-21 Smaller CMake items.** `runtime/contract/CMakeLists.txt:2` calls `add_subdirectory(runtime/common ...)` while the root never lists `runtime/common` (list it at the root); `runtime/shader_patch/CMakeLists.txt:5-12` is included from `runtime/orchestrator/CMakeLists.txt:150` and mutates two foreign targets (`rsf_orchestrator`, `rsf_graphics`); `games/fallout4/CMakeLists.txt:22-25` `rsf_fallout4_trial` is a custom target with no output; `games/rdr2/CMakeLists.txt:31-35` `rsf_rdr2_attach` is an "explicit research helper" built in `ALL`; `runtime/backends/dlss/CMakeLists.txt:1-2` `RSF_STREAMLINE_INCLUDE` is read only by test fixtures; `CMakePresets.json:20-52` has 5 build presets and 6 test presets for 3 configure presets (only `linux-cross-dxvk` is documented; the `*-vs18` presets are used only through `verify.ps1 -VS2026`). Keep: fix or remove each. Confidence: m. **Partly done:** runtime/common is listed at the root, rsf_fallout4_trial is gone, rsf_rdr2_attach is EXCLUDE_FROM_ALL, RSF_STREAMLINE_INCLUDE lives in cmake/vendor.cmake. Left: shader_patch mutating foreign targets (D2) and the preset set. **Reconciled against the tree:** done: `runtime/common` is listed at the root (`CMakeLists.txt:66`), `rsf_fallout4_trial` is gone, `rsf_rdr2_attach` is `EXCLUDE_FROM_ALL`, `RSF_STREAMLINE_INCLUDE` lives in `cmake/vendor.cmake`. Unfinished: `runtime/shader_patch/CMakeLists.txt:5-12` (included from `runtime/orchestrator/CMakeLists.txt:169`) still mutates `rsf_orchestrator` and `rsf_graphics`, and `CMakePresets.json` still has 5 build and 6 test presets for 3 configure presets (`*-vs18` is used only through `verify.ps1 -VS2026`). **Round 3:** done. `runtime/shader_patch/CMakeLists.txt` defines only `rsf_shader_patch`; the link, `/EXPORT`/`.def` and include directory for `rsf_orchestrator` moved to `runtime/orchestrator/CMakeLists.txt`, and the include directory for `rsf_graphics` to `runtime/graphics/CMakeLists.txt`. Presets: no preset is unused, so none was removed. Callers: `eng/verify.ps1:28-31` (`windows-x64[-vs18]`, `windows-debug|release[-vs18]` build and test), `eng/build-godot.ps1:32`, `eng/build-unity-package.ps1:17-19` and `eng/build-unity-sr.ps1:31-32` (the same preset names), `AGENTS.md:179-181` (`linux-cross-x64`, `linux-cross-debug`), `eng/wine-test-prefix.sh:106` (`linux-cross-dxvk`). +- [ ] **BT-22 Fixture crates (decision D10).** `Cargo.toml:4-29` lists the `tests/*` fixture crates (14 workspace members plus `tests/loader`), each with its own `windows` feature list (13 to 19 features in 5 of them), so each test exe links one archive. Keep: merge `tests/presentation` + `presentation/api`, `overlay` + `overlay-service`, `capture` + `ac7-capture` and translucency into larger fixture crates; removes manifests and archives. Risk: duplicate `#[no_mangle]` names. Confidence: l. **Kept (constraint):** the crates are separated by what their executables may link. `tests/presentation/api` and `tests/overlay-service` are the DLL-import clients (`tests/d3d11_present_api.cmake`, `overlay_dll_api.cmake`: free of OrchestratorCore and its public `RSF_RUNTIME_BUILD` define) and depend only on rsf-game-sys, windows or windows-sys and, for `tests/overlay-service`, the non-shipped `rsf-test-support`; merging them into `tests/presentation` or `tests/overlay` (rsf-orchestrator, rsf-ac7) would put an embedded orchestrator and its `#[no_mangle]` exports into a client that must import the DLL. `tests/capture` (Graphics and GraphicsLeaves only, for `rsf_texture_dump`) and `tests/ac7-capture` (rsf-ac7, rsf-orchestrator) differ the same way, and `tests/translucency` imports the DLL. The T9 support crate D10 waited for exists; round 4 shrank `tests/vulkan-fg` and `tests/game-sdk` by moving their FSR4, DLSS-G and XeLL fixtures into the orchestrator instead of merging crates. Verified against the manifests: `tests/presentation/api` depends on `rsf-game-sys` and `windows-sys` only; `tests/overlay-service` on `rsf-game-sys`, `rsf-test-support` and `windows`; `tests/ac7-capture` on `rsf-ac7`, `rsf-orchestrator` and `rsf-runtime-common`; `tests/capture` on `rsf-game-sys` and `rsf-test-support`; the DLL-import CMake files are `tests/d3d11_present_api.cmake` and `tests/overlay_dll_api.cmake`. The constraint is a link model, not a native-code need: a client built for `RSF_RUNTIME_BUILD`-free DLL import must not embed `rsf-orchestrator`. + +### Docs + +Tracked Markdown is 6,387 KB; `docs/` is 5.55 MB. The C++-to-Rust port is narrated four times (`PORT.md` 588 KB, `docs/research/rust-*.md` 153 files and 1,517 KB, `docs/implementation.md` about 307 KB of its 538 KB, `docs/rust-migration.md` 48 KB), about 2.5 MB or 39% of tracked Markdown; git history already records every cutover. Do not touch: fingerprints, RVAs, hashes, `docs/research/evidence/*.json` (all 13 referenced), `ue418-hook-map.md`, `methodology.md`, `source-map.md`, `ghidra-tooling.md`, `ue-reflection-mapping.md`, `docs/tooling.md`, `docs/dependencies.md`, dated game research that records failed approaches (consolidate behind an index, do not delete), `.claude/skills/game-render-analysis/SKILL.md`, `docs/releases/*-install.md` and the release template. Suggested order: D1 with D6, then D2 + D4 + D5-ENG + D3 in one pass, then D5/D5b, then D7. Stale facts are X6. + +- [x] **DOC-D1 `PORT.md` is a finished checklist of deleted C++ files (decision D19).** 588 KB, 3,116 lines (header and scope `:1-147`, chunks `:149-3108`): a per-agent work assignment with 508 Rust review findings pasted per chunk. 1,327 of 1,357 checkboxes are `[x]`; 547 of its markdown links point to deleted files (`tests/negotiate.cpp`, `runtime/orchestrator/src/native_fg.cpp`, `loader/proxy/src/thin_loader.cpp`); nothing outside `docs/` references it (18 port notes, 25 hits). The 30 unchecked entries (`:147`, `:473`, `:475`, `:480`, `:1504-1511`, `:1518-1519`, `:1576-1581`, `:1768`, `:2978-2999`) are 29 "blocked: C++ is the only way" constraints and one review finding: (1) Streamline/FidelityFX SDK patchers that edit vendor C++ (`runtime/vulkan/streamline/sdk-fixes/*` `:1508-1511`, `runtime/vulkan/fsr3/sdk-fixes/*.json|.h` `:1576-1581`); (2) `sl.h` layout checks needing a C++ compiler (`tests/dlss_sr_layout_facts.cpp` `:147`, `tests/loader/vendor_layout_facts.cpp` `:480`, `sdk_fg_options_checks.h`, `sdk_records_checks.h` `:1504-1505`, `tests/streamline_selected_device.cpp`, `tests/streamline_vulkan_dispatch.cpp` `:1518-1519`); (3) MSVC RTTI and NGX fixtures (`tests/loader/module_dump_rtti_fixture.cpp`, `vendor_census_ngx_platform.cpp` `:473-475`); (4) Godot engine glue (`integrations/godot/modules/rescaleframe/*.cpp|.h`, `eng/patch-godot.py`, `tests/godot_graph_*` `:2978-2999`); (5) one open review finding (`:1768`, view `is_main_view` versus `fills_target`). The 12 first-party `.cpp` files left in the tree are these (5 Godot module files, 7 under `tests/`). `PORT.md:1549` is the only place the Rule 1 violation of `rsf_vulkanstory_*` export names in `runtime/vulkan` is written up (now D7). Keep: a short "Retained C++ and why" table in `docs/rust-migration.md` (one row per group, with the blocking constraint), the `:1768` finding as an open item in `docs/implementation.md`, the `:1549` note in the open-items list; delete `PORT.md`. Check `rg 'PORT\.md'` afterwards; `.local/bloat-survey.md` cites `PORT.md:1549`. Confidence: h. **Reconciled against the tree:** the "Retained C++ and why" table exists (`docs/rust-migration.md`, `docs/design.md#retained-native-code`). Kept: `PORT.md` itself, because D19 keeps it as the tracker until this Simplification list closes, and 11 files still link to it; delete it and repoint `rg 'PORT\.md'` once every open entry above is checked. **Rejected (coordinator, 2026-11-24):** `PORT.md` stays as the record of retained native code and its constraints; the D19 retirement is withdrawn. +- [x] **DOC-D2 `docs/research/rust-*.md` and eight unprefixed port notes are per-commit cutover diaries.** 153 files, 19,901 lines, 1,517,447 bytes (largest `rust-fallout4-render-hooks.md` 57 KB, `rust-anomaly-sr-stage.md` 45 KB, `rust-skyrim-native-creation.md` 34 KB, `rust-anomaly-motion-stage.md` 33 KB, `rust-loader-diagnostics.md` 32 KB), plus `ac7-render-scope-port-a02.md`, `d04-d3d12-host-port.md`, `vulkan-sr-native-port-followup.md`, `vulkan-sr-provider-admission-port.md`, `overlay-native-sdk-port.md`, `overlay-direct-admission.md`, `overlay-typed-dispatch.md`, `overlay-saved-unicode.md` (about 64 KB). 109 of 153 notes have 2 or fewer evidence markers (RVA, `0x......`, sha256, fingerprint, "measured", "captured", "accepted"), 54 have none (e.g. `rust-d3d11-present-sync.md`, `rust-d3d11-present-slots.md`, `rust-vulkan-dx12-interop.md`, `rust-unity-d3d11-packet-leases.md`, `rust-callback-host-cutover.md`). `docs/implementation.md` cites them 250 times. Evidence-bearing subset to salvage first (marker counts): `rust-fallout4-render-hooks` (50), `rust-skyrim-cpu-ownership` (40), `rust-ac7-carrier-startup` (20), `rust-anomaly-motion-stage` (17), `rust-skyrim-native-creation` (17), `rust-vulkan-ffx-v05` (15, how SDK 2.4.0 constants were read, cited by `fsr4/sdk.rs:127` and `fsr4-fg/sdk.rs:92`), `rust-anomaly-fg-stage` (13), `rust-anomaly-shader-loader` (11), `rust-vulkan-dlss-fg-cutover` (11), `rust-loader-diagnostics` (11), `rust-ac7-a01`, `rust-ac7-truesky-relays`, `rust-overlay-host`, `rust-vulkan-xess-fg-v06`, `rust-anomaly-native-geometry`, `rust-ac7-native-sites`, and `rust-anomaly-cpp-baseline.md` (Standard and AVX executable hashes AGENTS.md says to keep). `rust-port-introduced-cpp-closure.md` and `rust-c01-header-policy.md` hold one fact worth keeping: C11 SEH leaves exist only to contain the MSVC C++ exception code `0xE06D7363` (one paragraph in `docs/design.md` or the retained-C++ table). Keep: move retained facts (RVAs, byte layouts, the SEH policy, failed approaches) into the matching game note (`rdr2-renderer.md`, `ue418-hook-map.md`, `skyrim-se-integration.md`, `anomaly-sr-seam.md`, `fallout4-render-integration-20261116.md`); delete the 109 low-evidence notes and the rest after salvage; repoint the 12 source comments (`games/ac7/src/native_renderer.rs:12`, `render_scope.rs:11`, `truesky.rs:10`, `games/anomaly/src/sr_stage.rs:2`, `games/fallout4/src/render_hooks.rs:14`, `imagespace.rs:13`, `producer.rs:15`, `publication.rs:13`, `recovery.rs:10`, `scope.rs:13`, `runtime/vulkan/fsr4-fg/sdk.rs:92`, `fsr4/sdk.rs:127`, `ngx/src/lib.rs:41`) and the files that cite the notes (`games/{ac7,skyrim-se}/engine.json` 6 refs, `games/ac7/README.md`, `games/rdr2/README.md`, `games/skyrim-se/README.md`, `runtime/shader_patch/README.md`, `integrations/godot/NATIVE.md`, `ue418-hook-map.md`, `sharpening.md`, `runtime-shader-patching.md`, `anomaly-sr-seam.md`, `ac7-motion-depth-20261004.md`, `godot-xess-vulkan-20261025.md`). `rg 'rust-[a-z0-9-]+\.md'` must return zero lines afterwards. Confidence: h (109 deletions), m (salvage list; the audit read about 25 heads and the marker counts of all 153). **Status (reduce-rb-docs):** Partly done. 45 notes with no fingerprints, RVAs, hashes, offset audits or measurements are deleted (cutover narration only); the SEH policy moved to `docs/design.md` ("Retained native code"). 108 `rust-*` notes stay because they hold layouts, offsets, SDK hashes, objdump audits or game observations (the audit counted 109 low-evidence notes by a looser marker count; the audit's own salvage list is entirely kept). The eight unprefixed port notes stay and are now indexed. No source comment needed repointing because every note they cite is kept. **Reconciled (reduce-rb-docs):** kept as stated. 108 `rust-*` notes plus the eight unprefixed port notes stay because they hold layouts, offsets, SDK hashes and measurements; they are indexed in `docs/research/README.md`. +- [x] **DOC-D3 `docs/implementation.md` (538 KB) is mostly the same port diary.** Lines 1-321 (19.9 KB, newest-first port paragraphs; "the tip does not configure, so no CMake build or CTest result exists"), `:322-1267` "Remaining Rust integration ports" (55 KB), `:1268-4602` "Rust orchestrator and first Anomaly port" (198 KB), `:7817-8316` (33.6 KB: `### Vulkan SR provider admission (V01)`, `### D04 D3D12 host source port`, `### Typed overlay SDK calls`, `### Direct3D DLSS SR SDK calls`, each ending with a `rust-*` link); about 307 KB, 250 links to `research/rust-*`. AGENTS.md says to track built, synthetic-tested, game-tested, device-tested results here; these sections say "source checks passed; builds pending" for hundreds of commits; `docs/current-status.md` is the maintained summary. Keep: `:4603-7816` (dated Fallout 4, Skyrim, Anomaly, RDR2, Godot, Unity entries that carry acceptance results) after pruning, and `:7348-7706` open items; delete the port diary ranges; add one table at the top (integration, built, synthetic-tested, game-tested, device-tested, links to dated entries). Stale open items in the kept part: 85 unchecked items in `:6343-7398`, three citing deleted code: `:6808` (`games/ac7/src/ui_rules.cpp`), `:7153` (`MotionToPixels::unreal` in a `runtime/backends/rsf-upscaler` crate that does not exist, and `runtime/orchestrator/src/dlss_pipeline.cpp`; `rg MotionToPixels` finds no code), `:7162` (`games/ac7/src/view_uniforms.cpp`); re-verify against the Rust code (`view.rs`) and close or rewrite. `docs/review.md` and `docs/representation-plan.md` link into it. Check `rg 'implementation\.md#' -g '!.local'`. Confidence: h (ranges), m (where the kept part begins; 6 boundary points spot-read). **Status (reduce-rb-docs):** Done. `docs/implementation.md` lost its port diary (lines 1-4602 and 8005-8316 of the old file; 8,316 to about 3,400 lines), gained the built / synthetic / game / device table at the top, and the three open items citing deleted code are rewritten. +- [x] **DOC-D4 `docs/rust-migration.md` (48 KB, 537 lines) restates D1 to D3.** `:5-96` ("Fast path", "Candidate `9f53f1b0`", per-subsystem paragraphs), `:97-142` ("Remaining integration ports"), `:143-246` (C ABI comparison, linkage audits, source audit checkpoint), `:247-568` ("Native policy cutover", one paragraph per cutover, 20 links to `rust-*`), `:569-632` (D3D11/D3D12 observer probes), `:632` (verification coverage); same events as `implementation.md:322-4602`; "Build and test execution belongs to the user" repeats AGENTS.md "Delivery". Keep: about 60 lines: the C ABI comparison conclusion (GameSDK stays at 24, the four headers that differed, carrier `.def` files unchanged), the DOC-D1 retained-C++ table, the candidate acceptance table (`:22-35`) if wanted. Only `docs/implementation.md` links here. Confidence: h. **Status (reduce-rb-docs):** Done. `docs/rust-migration.md` is now about 60 lines: scope, the C ABI comparison conclusion (export counts per DLL) and a "Retained C++ and why" table. +- [x] **DOC-D5-ENG + GM-G12 `games/*/engine.json` carries per-commit port records.** `games/ac7/engine.json:870-921` (`rust_game_entry`, `rust_native_sites`, `rust_renderer_transaction`, `rust_truesky_relays`, `rust_scope_facts_and_scene_effects`, `rust_render_scopes`; each with `date` 2026-11-21/22, `validation: "Source review only ... Not compiled, linked"`, `evidence:` pointing at a `rust-*` note), `games/skyrim-se/engine.json:563-570` `rust_native_creation`, `games/anomaly/engine.json:7-16` `sr_stage_admission` and `motion_window_admission` (`source_baseline c57905d1`, `bfbed34e`, "native build, fixtures and game runs pending"). They are changelog entries duplicating the `rust-*` notes (`games/ac7/engine.json` also holds `native_renderer_refactor`, 28 entries, a session log: "Diagnostic build installed; crash unresolved. No autonomous launch."; the `rust_*` texts are already stale: `rust_game_entry` says "plugin.cpp keeps rsf_get_game_plugin_api", `rust_render_scopes` (`:914`) says "render_scope.cpp keeps", both files are now C; no code reads `games/ac7/engine.json`, `sites.rs:8` only cites it). Keep: every RVA, fingerprint, `executables` hash and `validation` summary describing game behaviour; only `tools/package-rdr2.py:99` and `tools/package-wingman.py:55` read an `engine.json`, both only `["game"]`. Validate each edited file with `python -c "import json;json.load(open(...))"`. Confidence: h. **Status (reduce-rb-docs):** Done. Removed the six `rust_*` entries from `games/ac7/engine.json`, `rust_native_creation` from skyrim-se, `sr_stage_admission` and `motion_window_admission` from anomaly. Kept `native_renderer_refactor` (AC7 session log) and every RVA, hash and validation record; the audit named it only as a session log. +- [x] **DOC-D5b + GO-F1 (godot) Per-slice port prose inside live READMEs and NATIVE notes.** `games/unity-mono/README.md:11-95` (about 85 lines of "X is Rust too ... `bridge.cpp` keeps ..."); `games/ac7/README.md:90-140` ("owned by the Rust crate `rsf-ac7`", "formerly `native_renderer.cpp`", links to six `rust-ac7-*` notes); `integrations/godot/NATIVE.md` (89 KB, 1,012-1,156 lines): `## ... first slice` (`:240`) to `## ... eighth slice` (`:657`), `### E02 checklist evidence` (`:71`), `## Remaining Godot ownership slices` (`:763`), engine-module sections `:793-1139`, an append-only history of platform table versions 2 to 5 (`:325,368,420,482,558,710`) describing a table that GO-A2 removes; `games/minecraft/NATIVE.md` (13 of 242 lines match "Rust/removed/formerly"); `games/rdr2/README.md:45-59`, `games/rdr2/NATIVE-OPTIONS-RESEARCH.md`. They overlap `docs/research/godot-engine-integration.md` (84 KB, 1,138 lines: Vulkan SR, PCL, exports). Keep: one ownership table per integration (file, owns) and build requirements (`NATIVE.md:1140`) and the control surface; merge surviving Godot evidence into `docs/research/godot-engine-integration.md`, leaving one Godot design note; delete slice narration. Confidence: m (needs a read of each; headings and stale names verified). **Status (reduce-rb-docs):** Partly done. Unity Mono and AC7 READMEs and Godot `NATIVE.md` now carry ownership tables (Godot slice narration and the platform-table history are gone; the Vulkan Auto policy and caveats are kept). Not done: the engine-module sections of `NATIVE.md` still say "this slice", `games/minecraft/NATIVE.md`, `games/rdr2/README.md:45-59` and `NATIVE-OPTIONS-RESEARCH.md`, and the merge of surviving Godot evidence into `godot-engine-integration.md`. **Follow-up:** Done. Godot `NATIVE.md` is rewritten as current ownership (Rust owners table, Vulkan Auto policy, residual C++, engine hook trigger order, CPU frame callbacks, pass records; 626 to about 330 lines; the leaf table is stated as `PLATFORM_VERSION` 9). `games/minecraft/NATIVE.md` and `games/rdr2/README.md` already describe current ownership and were left; `NATIVE-OPTIONS-RESEARCH.md` is research and was left. Surviving Godot evidence was not merged into `godot-engine-integration.md` (the removed slice text held source-review narration only). +- [x] **GO-F1 (rdr2, port journals) `games/rdr2/RESEARCH-HANDOFF.md` and port journals.** `games/rdr2/RESEARCH-HANDOFF.md` (856 lines) is dated "26 October", lists live PIDs and "Current INI" states (`:186,391,477,521`) and says what to do next; `NATIVE-OPTIONS-RESEARCH.md` is similar; the README says to read the handoff before continuing (README line 3). Port journals with the same shape: `docs/research/rust-unity-*` (18 notes, about 1,300 lines), `rust-fallout4-*` (6), `rust-godot-*` (3), `rust-rdr2-*` (3), `rust-skyrim-*` (2). Keep: measured evidence and failed approaches (AGENTS.md requires them), drop session state; the port journals follow DOC-D2. Confidence: m. **Status (reduce-rb-docs):** Port journals follow DOC-D2; `RESEARCH-HANDOFF.md` not touched (session state, medium confidence). **Follow-up:** Done. `games/rdr2/RESEARCH-HANDOFF.md` lost its session state (current task, installed hashes, pending human actions, orchestration handles, INI state) and now says SR and FG have been implemented since; measured evidence and failed approaches are kept. The Godot NATIVE.md table versions (2 to 5 against code 9) are fixed under DOC-D5b. +- [x] **DOC-D6 Documents whose subject no longer exists.** `docs/representation-plan.md` (57 KB; banner "Historical design"; body `:8-571` is the ABI 2 / UI-diversion / `ui_rules.cpp` plan with 12 references to deleted `.cpp` at `:216,306,309,316,321,323,333,350,398,661,663`; AGENTS.md and `sdk/game/README.md:30` carry a sentence only to say ignore it; 17 inbound links, mostly research notes); `docs/review.md` (13 KB, review of `a9f3d5d` of 7 Sep about files since rewritten in Rust; inbound `loader/README.md:72`, `runtime/backends/README.md:40`, `runtime/graphics/README.md:77`, `docs/implementation.md:6649,7384`); `docs/reviews/codebase-review-20261009.md` (59 KB, 31 links to deleted files, nothing acted on; inbound `docs/implementation.md` only); `docs/documentation-audit.md` (6 KB, 7 Oct audit, its own claims ABI 13 and "79 Markdown files" are stale; inbound `docs/implementation.md` only); `games/anomaly/PROGRESS.md` (13 KB, "STOPPED for today at the user's request", 12 Nov checkpoint, "192 discovered, 181 passed" at `e991e89`; no inbound links). Keep: only the `representation-plan.md` appendix (`:572-end`: runtime map, reference findings, AC7 SDK facts, binary facts, vendor contracts, marked "kept as evidence") as a research note (`docs/frame-generation-plan.md` already says it replaces the plan assumptions) and remove the AGENTS.md and `sdk/game/README.md` sentences; delete `review.md`, `reviews/...`, `documentation-audit.md` and repoint the five links to `docs/current-status.md`; move `PROGRESS.md` "Goal and non-negotiable constraints" and the acceptance matrix into `docs/research/anomaly-sr-seam.md` or `current-status.md`, then delete. Check `rg 'review\.md|representation-plan|PROGRESS\.md|documentation-audit'`. Confidence: h (review, audit, PROGRESS), m (representation-plan appendix split). **Status (reduce-rb-docs):** Done. Deleted `docs/review.md`, `docs/reviews/`, `docs/documentation-audit.md`, `games/anomaly/PROGRESS.md` (goal and acceptance matrix moved to `docs/research/anomaly-sr-seam.md`); `docs/representation-plan.md` keeps only its appendix at the same path because six C headers and AGENTS.md cite that path (AGENTS.md untouched, D32); the `sdk/game/README.md` sentence is removed. +- [x] **DOC-D7.1 Two release notes for one release.** `docs/releases/v0.1.0.md` (corrected package) and `docs/releases/v0.1.0-ac7.md` (original text) carry the same 3-line header and describe `ReScaleFrame-0.1.0-AC7-Windows-x64.zip`; the latter was "replaced on 2 October 2026", duplicates `ac7-install.md`, and nothing links it (`rg 'v0\.1\.0-ac7'` empty). `v0.1.1-windows.md` also documents a withdrawn Project Wingman preview; `docs/releases/README.md` says per-game tags are historical. Keep: `v0.1.0.md`; one line per release; cut the preview text. Confidence: h. **Status (reduce-rb-docs):** Half done: `docs/releases/v0.1.0-ac7.md` deleted. The Wingman preview text in `v0.1.1-windows.md` is kept. **Reconciled against the tree:** `docs/releases/v0.1.0-ac7.md` is deleted. Unfinished: `docs/releases/v0.1.1-windows.md:14-16,19` still describe the withdrawn Project Wingman preview (the correction at `:3-6` should stay). **Round 3:** done. The Wingman bullet, install-guide placeholder, forwarding-fixture paragraph and packager sentence are gone from `v0.1.1-windows.md`; the correction and the AC7 build record remain. +- [x] **DOC-D7.2 Two Community Shaders inventories.** `fallout4-community-shaders-inventory-claude-20261116.md` (34 KB, 20 links to deleted `.cpp`) and `...-root-20261116.md` (24 KB; states it reconciled the other). Keep: the root note, folding in only the differences the Claude note adds; delete the Claude note. Confidence: h. **Status (reduce-rb-docs):** Not done. The Claude inventory is cited by `games/fallout4/engine.json` and four research notes and holds 375 lines of independent evidence; the root note already has a reconciliation section. Kept. **Reconciled (reduce-rb-docs):** kept: `docs/research/fallout4-community-shaders-inventory-claude-20261116.md` is cited by `games/fallout4/engine.json` and four research notes (5 files) and holds independent evidence. +- [x] **DOC-D7.3 Banner repeated 39 times.** "Research history: findings, hook addresses and pending statuses below apply to their recorded experiments. Later increments can supersede earlier conclusions. See ..." heads 39 research notes (`rg '^Research history: findings' docs`); `docs/research/README.md` already says it once. Keep: the README copy; delete the 39. Confidence: h. **Status (reduce-rb-docs):** Done. The banner is removed from all 39 notes; `docs/research/README.md` states it. +- [x] **DOC-D7.4 31 research notes outside the index.** No inbound reference from any doc: 8 `vulkan-*-20261115` notes (1.4 to 7 KB each), 8 `rust-*` notes, 15 others (six `fallout4-*` audits of 16 Nov, `native-depth-domain-contract`, `native-marker-admission`, `generation-provider-state-invalidation`, `d3d11-private-chain-usage`, `auxiliary-numeric-packed-colour`, `dlss-present-immediate-legacy-flush`, `ac7-website-input-dump`, `skyrim-presentmon-validation-20261115`, `unframed-input-receipt-routing-proposal-20261116`). The Fallout 4 set is 26 files (637 KB) and Skyrim 16 files (334 KB). Keep: evidence-bearing ones with an index entry; a `docs/research/fallout4.md` index like `skyrim-se-integration.md`; small `vulkan-*-20261115` files folded into one `vulkan-fg-hardening-20261115.md`. Confidence: m. **Status (reduce-rb-docs):** Done as an index: `docs/research/README.md` lists every surviving `rust-*` note and the 31 unindexed notes by area. The `vulkan-*-20261115` notes were not folded into one file. +- [x] **DOC-D7.5 AGENTS.md "Reference completeness and shader coverage" (3 paragraphs)** restates `.agents/skills/game-render-analysis/references/reference-and-shader-audit.md`, which says it is the procedure. Keep: the rule as 3 lines in AGENTS.md linking the skill (decision D32). Confidence: l (AGENTS.md is the policy owner). **Status (reduce-rb-docs):** Not done by ruling (D32: no AGENTS.md change without the user). **Reconciled:** Kept: `AGENTS.md` "Reference completeness and shader coverage" stays because D32 forbids an AGENTS.md change without the user; the decision is the user's. **Done (user ruling, 2026-11-24):** the four paragraphs moved verbatim into `.agents/skills/game-render-analysis/references/reference-and-shader-audit.md` under "Core rules" (several rules were not in the reference before); AGENTS.md keeps three lines linking it. The Architecture table no longer lists the deleted `rsf_bootstrap` and `rsf_launcher`. +- [x] **DOC-D7.6 `.agents/skills/reverse-engineer-anything/` (7 files, 49 KB) is a vendored copy of the REA product skill** the harness already provides. Keep: delete if not customised (not diffed) and keep the pointer in `docs/tooling.md` (decision D32). Confidence: l. **Status (reduce-rb-docs):** Not done by ruling (D32): the vendored copy differs from the installed REA skill (SKILL.md is 13.6 KB against 43.6 KB; the installed one has `desktop-build.md` and `environments.md` too), so it is not identical to upstream. **Reconciled (D32 ruling):** kept: `.agents/skills/reverse-engineer-anything/SKILL.md` differs from the installed REA skill, and D32 deletes the vendored copy only if it matches upstream. +- [x] **DOC-D7.7 `docs/current-status.md` (185 lines) is a dated diary** ("16 November", "15 November", "End-of-day checkpoint, 25 October") that duplicates `implementation.md:4603-5600`. Keep: a table of built / synthetic / game / device per integration (the DOC-D3 table), dated paragraphs dropped. Confidence: m. **Status (reduce-rb-docs):** Not done. Only the ABI table was corrected; the dated paragraphs record acceptance results AGENTS.md requires. **Follow-up:** Done. `docs/current-status.md` opens with one table of the latest recorded acceptance per integration (Fallout 4, Skyrim SE, Anomaly, Godot, Unity); the 25 October end-of-day paragraph, the 7 October documentation-check paragraph and the long Godot prose are dropped (the tracker keeps the restart checkpoint). +- [x] **OV-J + S-docs Stale comments and README sections in the runtime area.** `runtime/backends/README.md:23-47` (AC7 motion notes, Wine notes) is research, not a backends README; move to `docs/research/`. `runtime/vulkan/README.md:21-30` is current (the managed host module `runtime/managed/ReScaleFrame.Vulkan` exists). The contradictions in `runtime/backends/README.md:5,15` and the `dlss_streamline.cpp` citations are in X6. Keep: one home for the AC7 and Wine notes. Confidence: m. **Status (reduce-rb-docs):** Done. The AC7 motion, Streamline and Wine notes moved from `runtime/backends/README.md` to `docs/research/dlss-backend-notes.md`. + +### Round 2: games/fallout4 and games/skyrim-se + +Logic-level review of both adapters, module by module. Most of the code is exact-build native admission +(RVAs, expected bytes, owner and camera proofs, refusal receipts), which is the evidence the adapters exist +for, so the cuts are repeated helpers, forwarding layers and C-shaped signatures, not admission checks. + +- `fallout4/lib.rs`: owns the one guarded `load`, `guard` (rva plus expected bytes, any length), `bits` and + `same_object`; `matches_bytes::` is gone. +- `fallout4/depth_domains.rs`, `render_inputs.rs`, `resolution.rs`, `screen.rs`, `render_hooks.rs`, + `cpu_events/native.rs`: deleted their private copies of those helpers (three `load`, six byte comparers, + two `bits`, two `same_object`); `depth_domains` reuses `camera::above` instead of its own copy. + `cpu_events` and `native.rs` now call the shared `load` (address first), so every module reads engine + memory the same way. +- `fallout4/creation.rs`, `session.rs`, `render_hooks.rs`, `render_inputs.rs`, `cpu_events.rs`: `ExactBuild` + was a unit struct passed as an ignored argument through four `prepare` functions; `admit_build` returns + `bool`. `render_hooks::prepare` repeated the guard walk `session::prepare` had just run, and + `render_inputs::verify` took an always-true closure; both are gone. +- `fallout4/render_hooks/recovery.rs`, `publication.rs`, `imagespace.rs`: `Leaves::report_text` duplicated + `Leaves::report`. +- Fallout 4 comments: about twenty that narrated the C++ port (stack lease, value-initialized record, MSVC `%p` + history) now state the behaviour or are removed; same for three in Skyrim `session.rs`. +- `skyrim-se/cpu_sources.rs`, `cpu_events.rs`, `cpu_policy.rs`: the `rsf_skyrim_jobs_*`, `_epochs_*` and + `_poll_*` functions only forwarded to `JOBS`, `EPOCHS` or one `PollScope` field, so `cpu_events` calls those + directly. The event builders, `queued_move`, `free_camera`, `sources_reserve/adopt/owned/release` and + `worker_counts` return values instead of filling caller-owned out records. The four redeclared + `SCREEN_*` constants use `rsf_game_sys::RSF_SCREEN_*`. +- `skyrim-se/platform.rs`, `cpu_events.rs`, `CMakeLists.txt`, `build.rs`: the SEH `rsf_skyrim_guarded_read` leaf + duplicated `rsf_game_sys::win32::read_process` (same signature); Rust and the CPU input-kind reader use the + SDK function and `guarded_read.c` left the adapter. Finishes the Skyrim part of S3.3 + S6 + GO-B5; the file + stays because the `skyrim_input` ctest executable links it directly (`tests/CMakeLists.txt`). +- Kept, `fallout4/cpu_events.rs`: the native-cycle, gate, downstream and poll receipts and their bit + bookkeeping (`Terms`, `PhaseChecks`, `predicate_bits`, `first_seen`). Their only reader is the log, but + `engine.json` names them as the pending live attribution of the CPU refusal predicate, so they have a + consumer until that run is done. +- Kept, `fallout4/render_hooks/*`: the `Leaves` and `NativeRecoveryLeaves` tables. Their other half is + `render_hooks.c` in the same archive, so they are C-to-Rust seams; dropping them means rewriting that leaf + and every render-seam fixture, which belongs to a tested change. +- Kept, `fallout4/lib.rs` `enable_hook`/`disable_hook`: `rsf_windows::minhook` + would replace them, but it needs a new `rsf-windows` dependency and public strict `enable`/`remove`, which + is an integrations/windows change (S1.8 + S3.3 + S4). **Corrected (item 3):** that reason never covered the + MinHook status constants, which `rsf-minhook-sys` (already a dependency) exports; `lib.rs` imports them now. +- Kept, Skyrim `session.rs` `subsystems` module: it is the narrow `cfg(test)` seam the lifecycle tests use. +- Kept, Skyrim `sources_*` functions: they scope the store lock, whose guard must drop before the host + callback that receives the result; calling the methods inline would hold it across the callback. + +### Round 2: ui/overlay and tests + +- `ui/overlay/src/abi.rs`: the 150-line hand-written field-offset test is replaced by the eight struct sizes; bindgen already emits per-field offset assertions into `rsf-game-sys` (checked in the generated `sys.rs`), and any append moves a size. +- `ui/overlay/src/overlay.rs`: dropped the egui texture-patch size/emptiness guard and the u32 vertex-overflow guard (egui's own tessellation, not untrusted input), the `sr_change_id` zero-wrap branch (4 billion UI changes) and the id masking of managed textures. Kept the `User` id high bit. +- `ui/overlay/src/model.rs`, `ffi.rs`: removed `GenerationStats::effective_mode` (written, never read) and `Stats::set_quality` (a field assignment). +- `ui/overlay/src/panel.rs`: nine copies of the `Segment { label, enabled, mark }` construction are one `choice()`; `Selection::quality()/enabled()` forwarders are fields. Kept the PCL receipt rows (Fallout 4 research notes read them), the refusal and pending state (`requested_*`, `sr_change_id`: a fix for the snap-back bug), `Controls` (the only way the unit tests tap widgets) and the FFI boundary (`ffi.rs`, decision D4). +- `ui/overlay/src/ffi.rs` tests: the `RsfOverlayStats` literal naming a hundred fields is the twelve the assertions read plus zeroed. +- `tests/presentation`: `lib.rs` and `fixture_device.rs` each wrote the hardware-then-WARP `D3D11CreateDevice`; one `create11` now serves both. Three `d3d11_host_device_*` modules defined the same `require`; one in the parent. +- `tests/vulkan_gpu.rs` (new, shared by `native_sr_vulkan.rs` and `sharpening_vulkan.rs`): loader `Library`/`entry`, physical-device choice with feature chain and device creation, memory-type allocation. Not shared: the FSR4 interop device (different error codes and extensions) and the fake-Vulkan CPU fixture. +- `tests/overlay/src/hotkey.rs`: the five hand-declared `MH_*` externs now come from `rsf-minhook-sys`. +- `tools/exposure_probe/src/ngx.rs`: the five hand-declared `MH_*` externs come from `rsf-minhook-sys`. +- `tests/generation` (`check!` in `leases.rs` and `session.rs`) and `tests/godot_graph_handoff.rs` (the same local `check!` in both entry points): one macro each. Header comments narrating the deleted C++ file a fixture replaced are removed (`ac7_native_graph.rs`, `streamline_dispatch.rs`, `dlss/sdk.rs`). +- Reviewed and kept (second pass, `tests/**` is 52k lines of Rust): the fixtures assert distinct contracts (scope and present lifetimes in `tests/game-sdk`, retirement order in `tests/presentation`, vendor ABI facts in `tests/vulkan-fg` and `tests/loader`), and the only exact duplicate functions of 8 lines or more left are the empty `barrier` fake (`capture`, `ffx_gpu.rs`, `dlss/vulkan.rs`, three crates) and `window_proc` (`overlay`, `presentation`). The near-copies were not merged because they differ in a value a test may depend on and nothing here can run them: the ~18 `rsf_frame_record` builders (resolution, near plane, which of the five matrices are identity, flags), the fake Vulkan entry tables in `ffx_gpu.rs`, `dlss/vulkan.rs` and `xess_input_range.rs` (each records different counters and uses typed against `c_void` pointers), the CPU-event `fact()` helpers in `tests/game-sdk` (real against fixed QPC frequency, `render_expected`), and the window-class and WARP-device copies (`windows` against `windows-sys` handles, custom window procedures, swap-chain use). +- Bare-rustc fixtures (third pass): `anomaly_bootstrap`, `engine_sharpening`, `native_vulkan_exports` and `unity_mono_runtime` are binaries of the new `tests/process` crate, and load their DLL through `rsf_test_support::Library` (windows crate) instead of hand-declared `LoadLibrary*`/`GetProcAddress`/`FreeLibrary`. `overlay_panel_fixture` is the cdylib `rsf-overlay-panel-fixture`, `ac7_render_scope` the staticlib `rsf-ac7-render-scope-fixture`, and `ac7_view_probe`/`ac7_session`/`ac7_view_fixture` are mounted in `rsf-ac7` (`view-fixtures`, `warp-fixture`) like the velocity shader fixture. `cmake/rust_static.cmake` lost `rsf_rust_fixture_externs` and its rlib target, the per-file rustc lookups and five target-triple copies in `tests/`; `rsf_add_rust_artifacts` builds package executables and DLLs (also used for the Anomaly tessellation example). Kept: the Godot graph fixture still compiles `integrations/godot/modules/rescaleframe/viewport.rs` with bare rustc, because the engine's SCsub builds that module the same way and the fixture exists to test that object; so do `runtime/vulkan/xess-fg/build.ps1` and the committed bindings those files use. The Unity Mono fixture now builds into the tests binary directory (nothing read its old place). Unverified: nothing was built or linked, so the first CMake run has to confirm the new archive and DLL paths, and that the rsf-ac7 `view-fixtures` archive links in place of `ReScaleFrame::AC7View`. + +### Round 2: games/rdr2, project-wingman, minecraft + +Logic-level pass over the three crates (`cargo check` only; the verification run follows integration). `drag-n-wash` has no Rust. The other game adapters belong to the other round-2 workers. + +- **rdr2 `platform.rs`, `native_platform.rs`.** The `Platform` unit struct and `get()` (a test-only `None`) are gone; reads, matches, `qpc`, hook create/enable/disable/remove are free functions, and the MinHook calls are made once against `rsf_minhook_sys` (its `MH_*` constants) instead of through `extern "C"` forwarders in `native_platform.rs`. `Retained` is a one-field guard. `image_header` lost its read-function parameter. +- **rdr2 `asi.rs`, `asi/windows.rs`.** Removed `AsiPlatform` (+ `ATTACHED`, `platform()`), the six `hook_*` forwarders, `profile_int`/`profile_string`, `main_module`, `current_thread`, `executable_path`/`module_path`/`read_path` (the SDK `win32::module_path` does it), the vacuous `PE_SIGNATURE` check and `pe_header`. Startup results are an ordered `Vec` instead of six named `Cow` fields (the "X disabled." filler lines are gone). The ASI hooks were only reachable after install, so the repeated `asi::platform().is_none()` checks went with them. +- **rdr2 `engine_settings.rs`.** Removed the three `rsf_rdr2_*_abi` test exports (no C caller left; tests call `dlss_choice`, `pin`, `storable_refresh`), the `LOGGER`/`LOGGER_USER` pointer pair and its transmute (one `LOGGING` flag, logs through `runtime_worker::log`), and the `no_mangle` on the quality tick and report. `MAX_EXTENT` is the single `layout::d3d::MAX_EXTENT`. +- **rdr2 `runtime_worker.rs`.** `rsf_rdr2_asi_start_runtime` and `rsf_rdr2_runtime_leaves` (a Rust-to-Rust C record) are `asi_start_runtime(module, fingerprint)`. The overlay startup rows for research-only INI keys are registered only in research builds (they were dead controls in release). Kept: `rsf_rdr2_fill_runtime_setup` (called by `tests/game-sdk/src/unity_sr_d3d12.rs`) and `rsf_rdr2_attach_start_runtime` (`attach_entry.c`). +- **rdr2 `renderer.rs`, `scene.rs`, `native_input.rs`.** `no_mangle` off the four naked-detour targets (`sym` operands need no exported symbol); the two input callbacks registered into atomics by `scene` are called directly; the duplicated refusal in `process`; `sr_pass` no longer sets a `resource_generation` its only caller overwrites. Kept: the FSR caller and context-create log lines (`docs/research/rdr2-renderer.md` cites them) and the `Observer` generation bookkeeping (it retires a real queue/swapchain pairing). +- **rdr2 `camera.rs`.** `decode` returns `Option` (the zeroing out-parameter wrapper over `decode_view` is gone); the Rust-only records lost `repr(C)` and size asserts. The plugin status text lived in `lib.rs` and `renderer.rs`; one remains. +- **rdr2 research feature (`diagnostics.rs`, `asi/diagnostic_services.rs`, `camera_probe.rs`, `native_settings.rs`, `d3d12_trace.rs`, `social_club.rs`).** The `DiagnosticsLeaves` table of four C-ABI pointers filled with same-crate functions became direct calls; `install_diagnostic_hooks` takes no platform or enable callback; the probes use `platform::read_value`. Kept against the audit: `capture_state/hooks.rs::Ops` and `capture_state/gpu_leases.rs::Ops` (function-pointer tables whose only production binding is in the same research crate; the `shots.rs` and `hooks.rs` unit tests drive them with counting fakes, so removing them needs those tests re-seamed under `cfg(test)`), and the Social Club frame trace (`TraceD3D12`, research only). +- **project-wingman.** `read` calls `win32::read_process` directly; the `CopyMemory` function pointer that every caller passed (`windows::copy`, itself a forwarder) and `read_jitter` are gone. Kept: `rsf_wingman_copy` (the C texture reader), the two-line C `rsf_get_game_plugin_api` forwarder (moving the export to a Rust `.def` needs a CMake change I cannot verify without a build), the temporal log line and its per-view rate limiter (`PW temporal ...` is the documented run-and-read output), and the `State::enable_hooks(enable)` parameter (the `partial_enable_can_retry_after_rollback` test needs it). +- **minecraft.** History comments dropped; `FLIGHT_SCREEN` is `RSF_SCREEN_FLIGHT`. Kept: every JNI entry (Java declares them, including legacy `status`), `rsf_minecraft_observer_install/close` (the GL interop fixture in `tests/presentation` links them), and the status generator (D30). + +### Round 2: loader, runtime/graphics, runtime/common, sdk/game, integrations/steam + +Logic-level review, largest module first. Forced edits outside the area: `games/ac7/src/motion_capture_records/draws/gpu.rs` (one call), `tests/d3d11_state.rs` and `tests/d3d11_observer.c` (the removed draw-state scope and header alias). + +- **loader/src/census:** the seven per-module `Json` newtypes over the nine `rsf_census_json_*` functions are one writer in `json.rs` (key as a name or `None`, any integer that converts), each module keeping its own helpers as a private trait (not all of them were module-specific: `flag`, `output`, `fields` and `args` were repeated across fsr, misc, ngx, d3d and vulkan and are now `Json` methods, item-3 fixes). The nine functions are plain Rust, not exports (no C, header, `.def` or script names them). `caller!` and `original!` were pasted into four modules and now sit once in `census.rs`; the guarded host-memory readers (`plausible`, `read`, `u16_at`, `u32_at`, `u64_at`) are `memory.rs` instead of three copies. The static scan reports findings through a Rust call rather than an `extern "C"` function pointer to a `no_mangle` export that converted `&str` to `CString` and back. Kept: the `rsf_census_platform` table (the carriers link the archive without the C leaves), the counters and summary fields (RDR2's ASI and the loader tests read them), `Call` in d3d and vulkan and `start` in fsr and misc (different call-site shapes; merging them is churn). +- **loader/src/diagnostics:** the software SHA-256 in `sha256.rs` is gone; section digests use `rsf_windows::sha256_hex` (BCryptHash), and the loader's `Win32_Security_Cryptography` feature with it. A section that cannot be hashed reports an empty digest. Kept: the options/report short-record handling and every sidecar field (`tools/dump/apply_*.py` read them), `rsf_patch_code` (AC7 jitter patch), the entropy and RTTI writers. +- **loader/src/windows, loader/proxy:** nothing cut. The thin carrier's file-identity and containment checks are the boundary for an untrusted INI and module path; the shim's lenient reader is D27. The `dlss_bridge.c` route dump (with the `native_identity.json` it writes beside it) is the F10 research workflow in `docs/research/ac7-composed-scene-color.md` and `ac7-motion-depth-20261004.md`. +- **runtime/graphics frame tap:** the 19-entry `Platform` function-pointer table (filled from functions in the same crate, threaded through about 60 functions) is gone; the leaves are called directly. Only the three foreign-exception guards for caller callbacks stay C, as `rsf_frame_tap_call_report/geometry/compute` next to the existing constant-observer guard, and `rsf_frame_tap_platform` leaves `frame_tap_platform.h`. `rsf_frame_tap_set_research_callbacks` was the phase setter with `before = NULL` and had one caller; the phase setter remains. Kept: the admission gate, retirement and re-apply logic (thread-safety fixes for hooks running on other threads and for the runtime rewriting the vtable). +- **runtime/graphics d3d11_state, constant_buffer_read, com_ref, texture_dump.h:** the narrow draw-state scope (`rsf_d3d11_draw_state_save/restore`, the 832-byte `DrawSnapshot`, its two leaves and test) was reached only by `tests/d3d11_state.rs`; `make_dynamic`, `constant_size` and `upload` in `constant_buffer_read.rs`, `rsf_resource_retain` and `rsf_create_render_target_view` had no caller; `RSF_DUMP_VIEW_VELOCITY` was a source-compatibility alias with one test use. Kept: the full-scope `Platform` table in `d3d11_state.rs` (a real test seam: the unit tests drive the nesting and release logic with fake COM objects). +- **runtime/graphics d3d11_output_platform.rs:** the 13 `rsf_d3d11_output_*` leaves were `no_mangle` exports declared in a bindgen-only header and called through `crate::sys` from `rsf-graphics` and about 100 orchestrator call sites, all Rust. They are plain `pub` functions now and every caller imports them from `d3d11_output_platform`; only the six an orchestrator platform table points at (`child_device`, `texture_desc`, `create_texture`, `create_rtv`, `device_ok`, `is_immediate`) keep `extern "C"` as a calling convention, and `srv_format` is a safe function (the `unsafe` around its calls is gone). `d3d11_output_platform.h` keeps only the texture-desc record and format codes; `srv_format.h`, which no C file included, is deleted. `rsf_dump_texture_png` and `rsf_dump_pixels_png` (called from `input_dump/native.rs`) are still exports. +- **runtime/common:** left. The BCrypt file hasher duplicates `rsf_windows::sha256_file`, but this crate is a staticlib that C carriers and the Runtime link, and `rsf-windows` is one too, so depending on it risks duplicate symbols in those links; fold them when a build can show it is safe. +- **runtime/presentation, runtime/shader_patch:** nothing cut. The C bridge is the foreign-exception guard for DXGI and Streamline calls; the compiler crate is the one D3DCompile owner. +- **sdk/game:** every `pub` item and `no_mangle` export has a caller outside the crate (checked by repository-wide name search); nothing cut. The public ABI is untouched. +- **integrations/steam:** `rsf_steam_d3d11_chain_prepare_with_user` served a C++ caller that no longer exists; the second `guarded()` byte check ran on unchanged memory between hook creation and enabling. Kept: the hash plus byte checks (another overlay can hook the same entries after the hash was taken). + +### Round 2: games/anomaly + +Logic-level review, largest production modules first. Most of the adapter is engine-integrity work (guarded +reads, exact-build admission, swap transactions with verified restore and retry, lifetime retirement), which +stays. The cuts are same-DLL version headers, C ABI the crate only calls from Rust, options and record fields +nothing sets or reads, per-frame work only tests consume, and C++ buffer limits carried over. + +- **`sr_stage.rs`.** `wcstod` was a 115-line clone of the CRT's (hex floats, `nan(...)`, exponent clamping); the + SR keys now take the longest decimal prefix through `str::parse` (inf/nan still parse, a hex float converts its + leading `0`). The vendor slot indices are `cfg(test)`. Kept: the 80-entry stage table, `Refused` and `leaf!` + (the stage tests' seam, GM-G1.1), the status report lines (run log), the frame dump and the Stage 3 burst + (the SR jitter measurement workflow). +- **`sr_stage/native.rs`, `sr_stage_platform.{h,c}`.** `rsf_anomaly_sr_native.struct_size`, checked against the + same DLL's static, is gone and `bind` returns nothing. `TwinLog` no longer truncates to the former 260-byte + `snprintf` buffer. The swap host is a plain Rust `sr_swap::Platform`; `SyncSwapPlatform` and the `Option` + wrapping are gone. Kept: the `Native` table (C SEH leaves and Runtime functions the cargo tests cannot link). +- **`sr_swap.rs`, `sr_swap_platform.h`.** No C file calls an `rsf_anomaly_swap_*` function, so the owner's entry + points are Rust functions over a Rust `Platform` of plain function pointers (no `admit`). Removed: the second + creation entry and the native seam path (`round_trip`/`upscale` callbacks, `NativeSeam`, its refusing + stand-ins), which production never took because the stage lends the pass to `run_seam`; the skip/restore name + exports only tests read; the layout `struct_size`; the header prototypes and platform typedef. The tests run + the fake host's passes through `run_seam`. Kept: every transaction, rollback and verified-restore path, and + `rsf_anomaly_sr_engine_layout` (named by `tests/anomaly_sr_swap.c`). +- **`sr_temporal.rs`.** `Counters`/`Status` lost `repr(C)` and their size and offset asserts (Rust-only state); + the write-only `quality_result` is gone; `ApiStatus`, which the production caller discarded, lives in the + runtime fixture. Kept: the fixed `reason` buffer. (`Startup::Legacy` was kept here for the runtime fixture; + item 3 reworked the fixture to bind `Startup` with fakes and deleted it.) +- **`motion/stage.rs`, `motion/stage/abi.rs`, `motion_stage_platform.{h,c}`.** The table's `struct_size` and + `abi_version` 13, checked in Rust against the same DLL's static, are gone with the define; offsets re-pinned. +- **`motion.rs`.** `Snapshot` and `SnapshotInput` dropped the deformation span, layout and detail value: their + only constructor always left them empty (foliage history has its own route). +- **`fg_stage.rs`, `fg_stage_platform.{h,c}`.** The FG platform table holds only its two C leaves (guarded depth + read, D3D11 state scope); its `struct_size` and the five fields the C table left NULL are gone, and the size + prefix reader moved to the FG fixture, whose C test passes one. `Stage::publish` ran at every frame end (three + locks, the Runtime status query, four bridge calls) to fill `rsf_anomaly_fg_status`, which only the tests and + the device fixture read; they take a snapshot on demand and the C record is gone. Kept: `report()` (run log). +- **`overlay.rs`, `overlay_platform.h`.** The log no longer cuts lines at the C++ service's `char[768]` and goes + through `rsf_game_sys::log_guarded`; `diagnostics_override`/`capture_override` (always None) are gone. Kept: + `StageControls`, `Desktop` and `Platform` (seams `overlay/tests.rs` replaces), panel diagnostics and + `OverlayCapture` (saved options the Runtime panel shows). +- **Reviewed, nothing cut.** `native_observer.rs` (the retirement state machine guards trampolines that stay + reachable after disable), `shader_loader` (the deployed-tree path is already fixture-only), `sr_d3d11` + (`Texture`/`rsf_sr_texture` were kept for the C D3D11 table and its C device tests, GM-G1.2; that getter was + gone by round 5, and item 3 deleted `rsf_sr_texture`). +- Outside the area: `docs/research/rust-anomaly-sr-stage.md` (removed `struct_size` and destroy wording). + + + +### Round 2: integrations/godot + +Logic-level review of `integrations/godot/native` (7,567 lines deleted and 2,071 added across Rust, tests and the generator; 4,323 of the deletions are bi.rs). `cargo check -p rsf-godot --tests` is clean; nothing was built with CMake or run. + +- `native/vulkan/creation/abi.rs` (4,323 lines) and `tools/generate-godot-vulkan-bindings.py`: deleted. The Vulkan structs, constants and `PFN_vk*` types are `ash::vk` (new `ash` dependency, already a workspace crate). The 26 `rsf_*` provider records and ~40 declarations were exact copies of rsf-game-sys; `build.rs` now binds only `api.h`, `native_fg_fsr4_vulkan.h` and the FSR4 bridge header. `typed.rs`, `chain.rs`, `capture.rs` and the typed tests use ash types. Kept: a local `AntiLagFeatures` record, because VK_AMD_anti_lag postdates ash 0.38. +- `native/platform.rs`, `host.rs`, `vulkan/native.rs`, `platform/fake.rs`: the 60-field `Platform` fn table, `register`/`registered`, `PLATFORM_VERSION` and one accessor per field are gone. `Platform` is a unit type; production methods call the Runtime, DXGI and Win32 directly, and the thread-local fake has the same methods under `cfg(test)`. Out-pointer thunks became return values. Kept: the `Option`/`bool` completions that the tests drive with `VK_THROWS` (the real methods never return `None` now; tightening them means rewriting those tests). +- `lib.rs`, `runtime.rs`: the `rsf_godot_*` shims that took the table are inlined into their single callers, which already did the same null, size and booted checks (D3D12 render, shutdown, execution, present marker, accept window, Vulkan boot). Removed the uncalled exports `rsf_godot_booted`, `rsf_godot_vk_booted`, `rsf_godot_vk_primary_window` and the five `rsf_godot_effect_*` C entries that only one test used. +- `control.rs`, `d3d12.rs`, `vulkan.rs`, `vulkan/sr.rs`, `window.rs` and their tests: the always-empty `&Platform` parameter is no longer passed through about a hundred methods. +- `effect.rs`, `gdextension/effect.rs`: `EffectLeaves` and `EffectStatus` lose their `struct_size`/`version` headers and `effect_leaves()` its validation (the table is a Rust static in the same crate). +- Rust-only records (`WindowFacts`, `FgFacts`, `SrContext`, `VkAdapter`, `VkInstanceCall`, `EffectFrame`, ...) lose their `reserved` padding fields; `VkFacts.reserved_creation` had no writer. History comments on removed C++ records are trimmed. +- Forced caller change outside the area: `runtime/orchestrator/src/vulkan_sr_session/linked.rs` (compiled only by `rsf-godot` through `#[path]`) now imports `crate::sys::*` instead of a sibling `abi` module. +- Kept against the audit: `VkCreationLeaves`, `Requirements` and `platform/vulkan_negotiation.rs` (a 15-entry and a 5-entry Rust-only table with their own tests; removing them means rewriting the negotiation and its 1,400 lines of tests). `modules/rescaleframe/packet_abi.rs` and the other engine-module Rust files stay as generated mirrors because SCons compiles them with a bare `rustc` and they could only change with a Godot build. The GDExtension interface binder (`gdextension/api.rs`) is a real boundary. + +### Round 2: runtime/orchestrator SR, FG and latency + +Logic review of `dlss_pipeline*`, `dlss_*`, `native_fg*`, `native_sr*`, `sr_session*`, `auxiliary_sr*`, `latency_*`, `reflex_*`, `mfg_*`, `streamline_*`, `fg_*`, `frame_limit`, `frame_sequencer` and `present_rates` (branch `NightHammer1000/r2-orch-sr-fg`). Checked by `cargo check -p rsf-orchestrator --all-targets` and `--features test-fixtures`; nothing run. + +- `streamline_policy`, `streamline_sdk`, `streamline_host`: the two weaker absolute-path checks use `rsf_game_sys::windows_path` (X12). The hand-written `#[repr(C)] Setup` mirror and its five offset asserts are replaced by the generated `rsf_streamline_host_setup`. The 28 Rust-only `rsf_core_slhost_*` lost `#[no_mangle]`. Kept: the `Platform`/`Startup` tables (the tests substitute them) and the token ring, slow-sleep and latency-ring logging (the Reflex run-and-read-log workflow reads them). +- `streamline_log`: `set`/`clear`/`emit` are plain Rust; the `emit` trampoline both callers implemented identically is gone and the sink is called directly. +- `fg_dispatch`, `native_fg/platform`: 33 `extern "C"` redeclarations of crate functions became `use` imports (X11); callees gained `pub(crate)` only. `input_dump::NamedRequest`/`NamedReport` became `pub(crate)` for the one cast; they still mirror the bindgen `rsf_named_frame_dump` records (input_dump owner). **Item-3 fix:** the mirror and the cast are gone; `rsf_input_dump_named_texture` takes the bindgen `rsf_named_frame_dump` records. +- `native_fg_cpu`, `native_fg_cpu/diagnostics`: the ignored `_p: &Platform` parameter of `complete`, `audit`, `report_timing` and `stage` is gone with its nine pass-throughs. Kept: the `Platform` table (the `test-fixtures` fg-cpu fixture builds it from C), and every `FG ownership`/`FG source timing`/`Latency window`/`FG stage` line (FGDebug workflow, `docs/research/anomaly-fg.md`). +- `native_fg`: kept the admission eligibility bitmask and its debug line (FGDebug documents it), the completed-status gate (`fg_status`) and the vendor read-state recovery after a failed retirement (a real retirement path). +- `dlss_pipeline`: `Needs`/`needs_of` (three booleans each `backend == DLSS`) is one flag; three copies of the render-size out-parameter writer share `write_render_size`; `say` and `emit` are one function. Kept: the `rsf_dlssp_platform` leaf table (the tests fake it), the two failure give-up counters (NGX leaks per failed evaluate) and the per-frame dump tables. +- `mfg_state`, `reflex_audit`, `fg_leases`: `rsf_core_mfg_*`, `rsf_reflex_audit_start`/`_stop`, `rsf_reflex_driver_sleep` and `rsf_d3d12_fence_completed` are no longer exported; no C, `.def` or GetProcAddress name exists. Kept: the NVAPI audit (the Reflex ordering workflow reads its log) and the bindgen NVAPI records. +- `sr_session`: kept `create(setup, out, fsr, xess)`; `sr_session/fixture.rs` passes its own providers through it. Kept the frame validation in both the session and the provider: each is an entry games call directly. +- Reviewed without cuts: `fg_status`, `fg_choice`, `latency_lease`, `frame_sequencer`, `native_sr_state`, `auxiliary_sr` (leaf table faked by tests), `mfg_midpoint`/`mfg_gate`/`mfg_provider` (MFG-Unlocker port with pinned hashes). Not reached in depth this round: `dlss_streamline` beyond its log calls, `streamline_generation_records`, `streamline_host/generation` beyond exports. +- `native_sr`: `native_sr/platform.rs` (an `extern` block redeclaring four crate-own exports plus eight one-line forwarders) is folded into `native_sr.rs`, which imports `rsf_dlss_pipeline_*`, `rsf_native_fg_capture`, `rsf_native_regions_*`, `rsf_native_reinsert` and `rsf_motion_*` directly (X11); `rsf_dlss_pipeline_on_frame` and `rsf_native_fg_capture` gained `pub(crate)`. Kept: the `ordered` receipt of `rsf_native_sr_evaluate_ordered` (always 1 in production, but `d3d11_host` tests vary it through their fake), `prepare_regions` taking the preparer (the unit test substitutes it), `OwnedHandle` (releases the decode pass if the resolve pass fails to create), and the `DomainLayout`/`DepthLayout` mirrors in `native_sr_state` (the bindgen depth records hold floats whose bit patterns, not values, decide a history reset). The C files `native_sr_vulkan.c`, `native_sr_fsr4_vulkan*` and `native_sr_split_vulkan.c` belong to the Vulkan worker. +- `dlss_native12`: `rsf_core_dlss_native12_create` and `_register` only moved the result of `DeviceRegistration::open` into an out parameter; the exports do that directly. The `pub(crate) use rsf_game_sys::xm` re-export is gone (`vulkan_streamline_camera` imports `rsf_game_sys::xm`; touched outside the area for that one line). Kept: `rsf_dlss_native12_create` next to `_create_shared` (`sr12/native.rs` and its test fakes bind both names), `has_core` (vendor entry points are untrusted), the single setup validation in `validate_setup`. **Correction (item 3):** that binding is by Rust path, not a C ABI consumer. No C, `.def`, `RSF_EXPORT` or `GetProcAddress` caller names any `rsf_dlss_native12_*`, so all 13 lost `no_mangle` and `dlss_native12.h` is deleted; both create entries stay because `sr12` calls both. +- `dlss_vulkan_capture`, `leaves`: the hand-written `Packet`, `Registration`, `Target` and the ABI version constant (each with offset asserts) were copies of records bindgen already emits in `rsf-streamline-vk` and this crate's `sys`; the owner imports them. Kept: the 24-entry `Platform` table (`tests/vulkan-fg` copies and overrides entries, and `owner_tests` fakes it), the `rsf_core_dlss_capture_*` exports (that fixture crate calls them), and the `dlss-present-boundaries.jsonl`/`dlss-present-capture.jsonl` traces (`tools/analyze-godot-capture.py` and `docs/research/godot-vulkan-dlss-fg.md` read them). **Correction (item 3):** that fixture is now `vulkan_dlss_fg/fixture/sdk.rs` in this crate (it copies the capture `LEAVES` with overrides, which still justifies the table), and `rsf_core_dlss_capture_*` carry no `no_mangle`; the fixture calls them by path. +- `latency_antilag`, `latency_antilag_sdk`: no cuts. The `rsf_core_antilag_*` exports, `latency_antilag.h`, the callback `Binding` and `end_markers` serve only the `tests/game-sdk` antilag fixture and go when it becomes a unit test; the SDK file is a layout- and failure-path-faithful port of AMD's MIT headers with tests. +- `fg_session`: `Context::retired` took the fence-completed function as a parameter that its one caller always filled with `rsf_d3d12_fence_completed`; it calls it directly. Kept: the checked `Provider` and `Host` copies (one null check of the host's tables at `create`/`select`, then no `Option` unwraps), the probe's option validation (host input) and the quiesce/take-state protocol of `select`. +- Touched outside the area, visibility only, for the imports: `input_dump.rs`, `input_dump/abi.rs`, `input_dump/legacy.rs`, `native_scene.rs`, `dlss_streamline/exports.rs`. + + +### Round 2: Unity (integrations/unity, games/unity-mono) + +Source-level review and edits only; `cargo check -p rsf-unity -p rsf-unity-mono` (also `--tests`) is clean, nothing else was built or run. `package.c`, `vulkan_bridge.c` and `render_bridge.c` need the untracked Unity SDK headers and were edited without compiling. + +- `package_state.rs` and `native.rs`: the 53-entry platform table (C struct in `package_state.h`, table and eight bool-to-u32 wrappers in `package.c`, `Leaves::adopt`, the table-adoption tests, the Rust functions declared in C only to be passed back) is replaced by one `static PRODUCTION: Leaves` in `native.rs`. The `Leaves` struct stays: it is the package tests' seam (fake leaves, call recording) and `package.c`, `vulkan_bridge.c` and the Unity SDK cannot link into the unit tests. `end_session`, `present_has_owner`, `preview_owns` and `vulkan_owns` take the Runtime's and bridges' own return types. +- `package_state/routing.rs`, `presentation.rs`, `windows.rs`, `services.rs`: `plugin_load` takes only the Unity registry and binds `PRODUCTION`; `REGISTRATION` is a flag, not a stored function pointer; plugin load/unload and `presentation::load` are not built for the Mono plugin or the unit tests. `rsfu_*` exports (configure, settings, status, frame_counters, temporal_ready, initialize, input, preview_region, shutdown, surface) are Rust, named as the managed code imports them and listed in `bridge.def`; the ten `package.c` forwarders are gone. `rsf_unity_package_editor` is `editor()`. +- `package.c`, `package_state.h`, `bridge.h`, `bridge_state.h`, `vulkan_state.h`: function declarations for functions only Rust calls are removed (`vulkan_bridge.h` and `preview.h` deleted); the headers keep records, constants and the few functions C defines or calls (`rsf_unity_frames_activate` from `render_bridge.c`). C layout asserts on bindgen- and ash-backed records are removed; asserts on Rust-restated cast macros and on the managed layouts stay. +- `vulkan_state.rs`, `vulkan_bridge.rs`, `vulkan_bridge/*`: the `rsf_unity_vulkan_*` extern "C" API (about 25 functions, null checks, out parameters, `DEVICE_*` codes) is plain Rust (`Device`, `Target` enums, `Option` returns, a bool lease); `admit_event`, `start_event` and `finish_event` exports had no caller but their own test and are deleted with it. Kept: `DeviceOps` and `SurfaceOps` tables, because the resize test binds fake GPU leaves and the Vulkan platform leaves cannot link into unit tests. +- `bridge_state.rs`, `bridge_native.rs`, `bridge_native/package.rs`, `bridge_d3d12.rs`, `d3d11_pass.rs`: about 35 `rsf_unity_frames_*` extern "C" functions with pointer arguments are Rust functions taking references and returning `bool`/`Option`; `rsf_unity_build_scalar_pass`, `rsf_uvk_bridge_{render,create_window,graphics}`, `rsf_unity_preview_*` and the `rsf_unity_package_*` helpers are called by path instead of through extern blocks. Kept `extern "C"` only where C or the managed adapter calls: `rsf_unity_frames_activate`, `rsf_unity_set_engine_spatial` (`bridge.def`), the `rsf_unity_mono_*` host-table callbacks and the managed API pointers. +- `d3d11_state.rs`, `bridge_d3d11.rs`: `rsf_unity_d3d11_initialize`, `command_slot` and `prepare_surface` return `Device`, `Option` and `Option`; the test of their null checks is deleted. Kept: the `DeviceOps` table (same reason as Vulkan) and `d3d11_pass.rs`' closure-injected `apply_change` and `u32` route codes (tests drive them; not restructured). +- `vulkan_resolver.rs`, `vulkan_wsi.rs`, `vulkan_bridge.c`: `ExtensionProperties`, `DeviceCreateInfo`, `SwapchainCreateInfo`, `SurfaceCreateInfo` and `SemaphoreCreateInfo` mirrors, with their Rust and C layout asserts, are `ash::vk` records. The loader hook table and its function-pointer aliases stay (they mirror a C struct, not a Vulkan record). +- `lib.rs`: package state, views, Vulkan state, resolver, device-creation and bridge-interop modules are built only for the package DLL and tests; the Mono plugin carried them (and about 30 `no_mangle` exports) with no caller. The test build allows `dead_code` because it omits the native bridges. +- `games/unity-mono`: `rsf_unity_mono_prepare/try_close/release/drained_generation` and `rsf_unity_set_engine_spatial` are imported from `rsf-unity` instead of declared in extern blocks; the Runtime exports (`rsf_fg12_install`, `rsf_fg_choice_*`, `rsf_callback_host_*`, `rsf_overlay_saved_options_unregister`, `rsf_fg12_capture_outputs`) come from `rsf_game_sys` instead of hand-written declarations. +- Comments that narrate the replaced C++ ("as the C++ did", "in the original order") and test names ending in `_cpp` are removed across the package state, `d3d11_state.rs`, `bridge_state.rs` and `runtime_config.rs`. +- Follow-up review: `vulkan_platform/commands.rs`: the eight GPU entry points that only `vulkan_bridge` calls (begin, upload, submit, barriers, copies, blit) are `unsafe fn` taking `&DeviceHandles`/`&CommandSlot` instead of `extern "C"` pointer functions; the `extern "C"` ones left are the `DeviceOps`/`SurfaceOps` entries. `preview.rs`: `rsf_unity_preview_hide` was a forwarder to `hide`, which is now the export. `bridge_d3d11.rs` and `bridge_d3d12.rs` shared one identical host-log helper, now `bridge_state::log`. Reviewed and kept: `vulkan_platform.rs` (the dispatch table, the shared-handle imports and the drain are the Vulkan/D3D12 interop itself), `package_state/windows.rs` (the subclass receipt, in-flight count and module reference fix a real teardown hazard; the Win32 leaves are the package tests' fakes), `preview.rs` window ownership and generation guards, `bridge_d3d12.rs` (slot ownership, fence reads and the capped refusal logs the run-and-read workflow uses), `mono.rs` (the Mono embedding table has no workspace crate to replace it). +- GO-B8 follow-up: both adapters and the layout fixture now use the same definitions in UnityBridgeAbi.cs. The original reference requirement still applies to managed compilation and fixture execution. + +### Round 2: orchestrator hosts and presentation + +Logic review of `runtime/orchestrator/src` D3D11/D3D12 hosts and presentation, largest modules first. Forced caller edits outside the area: `streamline_host.rs` and `streamline_host/native.rs` (re-exports, visibility, the duplicate `Graphics` record), `native_fg_cpu/platform.rs`, `native_fg/platform.rs`, `fsr4_fg_bridge/commands.rs`, `dlss_native12.rs` and `dlss_native12/exports.rs` (visibility), `sampler_bias.rs`, `d3d11_d3d12.rs`, `d3d11_observer_present.rs`, `lib.rs`. + +- `overlay_host_native`: the D3D11 leaves called `IDXGISwapChain`, `ID3D11Device`, `ID3D11DeviceContext` and `ID3D11Texture2D` by vtable slot number with hand-written `DXGI_SWAP_CHAIN_DESC`/`D3D11_TEXTURE2D_DESC` mirrors; they use the `windows` types. The renderer's versioned setup record and its five Rust-only `rsf_overlay_renderer_*` exports are gone; the host table binds `overlay_renderer11::{create, upload_texture, free_texture, draw, destroy}`. +- `fg12`: the 43-entry `Platform` table had one binding and a test variant that only panicked. `native!` names functions in `fg12::native`, which imports its leaves instead of redeclaring 28 of them `extern "C"`. Unit tests no longer build the owner (they reach only `fg12/retirement.rs`, compiled alone). +- `d3d12_fence`: one `wait_fence(fence, value, event, timeout)` calls `GetCompletedValue`/`SetEventOnCompletion` itself; six callers passed identical copies of those two leaves and `d3d12_host::rsf_core_d3d12_wait_native_fence` only forwarded. `wait_for_value` keeps its closures for the tests and the XeSS and window presenter waits. +- `d3d12_generation/admission`, `disabled`: `rsf_core_fg12_generation_checks` and `rsf_core_fg12_disabled_provider` had no caller; `rsf_core_fg12_chain_description` only wrapped `chain_description`; the Streamline host imports the three remaining admission checks. Deleted the orphan `runtime/backends/common/{d3d12_helpers,fg_helpers,frame_capture_vk,generation12_checks,sr12_platform}.h` (no includer, not a bindgen input). The 511-byte cap on the library-load log only mimicked a C++ buffer. +- `d3d11_present*`, `d3d12_host`, `frame_capture12/native`, `frame_capture_vk`, `d3d12_sr/legacy`, `settings_store`: `no_mangle` dropped from 39 exports only Rust in this crate calls by path. The `rsf_core_capture12_*` and `rsf_core_capture_vk_discard_all` exports stay (Godot declares them). +- X11 in this area: `d3d11_present` (Streamline host leaves, observer, the three `rsf_generation_*` getters), `d3d11_present_native`, `gl_pipeline/linked`, `sr12/native` (DLSS native12, SR session, input dump), `sr_bridge/platform`, `overlay_wrapped12/native`, `overlay_service` and `d3d11_host` (sampler bias) import the functions instead of redeclaring them; the Streamline host's private `Graphics` copy of `rsf_streamline_graphics` is gone. +- `d3d12_observer/diagnostics`: the `DiagnosticSetup` table had one constant binding and no fake; `Removal` stays (the DRED walk test fakes it). +- `plugin_session`: `Partial` and `Quiescing` were handled identically everywhere; one `Closed` phase. `d3d11_host_abi`: the explicit re-export lists repeated the glob. +- Comments that narrated the C++ owners (release orders, wrappers, members) now state the order or lease itself. +- Kept after review: the `d3d11_present` post-switch receipts and debug timing (`debug_timing` is set by the loader and Anomaly; the receipts are the evidence in the switch-crash research notes), the D3D11 host's rate-limited SR, CPU and capture logs, `overlay_service` apply accounting (read into `rsf_render_status`), the settings store's CRT number formatting (INI spellings), the test-seam tables (`overlay_host`, `overlay_wrapped12`, `d3d12_window_presenter`, `d3d12_observer` attachment and DRED, `render_host`/`callback_host` `impl_host_methods!`), and the D3D12 GPU leaves that call `windows` vtables with raw handles. `render_host` and `callback_host` still duplicate their forwarding leaf lists; merging them is a restructure, not a cut. (Round 5 merged them into `render_host_native.rs`.) + +### Round 2: games/ac7 + +Logic review of `games/ac7` (`rsf-ac7`, `rsf-ac7-plugin`), C-shaped interfaces between Rust modules first. Forced edits outside the area: `tests/ac7_native_graph.rs` (renderer options without `struct_size`, `guards::held`). + +- `velocity_history`, `velocity_commit`, `velocity_stream`, `velocity_renderer`: 17 `#[no_mangle] extern "C"` entries with out-pointers and null checks, all called only by the D3D11 replay, are Rust functions returning their decisions. The pass size check sits once at the public `rsf_ac7_velocity_commit`. Rust-only records lose `repr(C)`, padding and size asserts (the b0/b13 cbuffers keep theirs); the u32 report kind is the two budgets it chose; the test-only `RendererLeaves` table and its admit wrapper are gone. +- F9 capture (`motion_capture_session`, `_records`, `_observations`, `root_hooks`): 43 Rust-only exports are plain functions on references. The session effects take Rust fn types and a prefix slice, the artifact writer a `CStr` and slice, constant uploads copy into the caller's `Vec`, colour dumps are a closure, roles are `&'static str`, plans are return values (`GeometryAdmission` became `Result>`). `rsf_ac7_velocity_reason` and `rsf_ac7_velocity_facts` leave `ac7_motion_capture.h` (only a Rust unit test called it). The trampolines' records (engine, root, scope, interval) keep `repr(C)`. `no_mangle` had hidden that unit tests compile the capture without its D3D11 leaves; the three modules allow dead code under `cfg(test)`. +- `renderer`, `lifecycle`: `rsf_ac7_native_renderer_options` loses `struct_size`, `pending_capacity` (always 256) and `diagnostics` (always 0; `RSF_AC7_DIAG_PIXEL_BINDINGS` gone). The pixel diagnostics stay on `RSF_AC7_PIXEL_DIAGNOSTICS`/AC7.ini. `rsf_ac7_renderer_prepare` no longer repeats the GameSDK entry's null, size and session checks. +- `guards`, `scope_facts`: `rsf_ac7_guard_enter/leave`, `rsf_ac7_guards_held` and `rsf_ac7_scope_primary_*` are Rust functions; the guard kind is a bool (no unknown-kind branch); the scope facts call the guarded read instead of taking it as an optional reader. Their `ac7_sites.h`/`ac7_scope_owner.h` prototypes and `rsf_ac7_scope_read` are gone. +- `patches`: `rsf_ac7_velocity_patch/apply/restore` serve only the native graph fixture (`tests/ac7_view_fixture.rs`); they compile with `warp-fixture` and leave the shipping DLL. +- `cloud_depth`: `cloud_depth_platform.h` (S5) is gone; the resources are a Rust struct of `Option` interfaces instead of raw COM pointers with manual retain/release, and the shader, write and release entries take typed interfaces. +- `contact_shadow`: `contact_shadow.h` (S5) is gone; `contact_shadow::correct` takes a slice and a closure and returns `Correction` instead of a C callback, user pointer and status integers. +- Kept after review: the evidence hooks (`RSF_AC7_PIXEL_DIAGNOSTICS`, the null PS uniform crash workflow in `engine.json`), the F9 capture and its JSONL fields (`tools/analyze-ac7-motion-capture.py`), the bounded log budgets, the `Leaves`, `Native` and `Plugin` test seams, the capture `CaptureEffects` and `RootHookEffects` seams (now Rust fn types), the capture MinHook batch (`ac7_hooks.c`, kept by GM-G8.1), `ac7_sites.h` records the fixtures share, and the fixture C entry `rsf_ac7_translucency_scale`. (`rsf_ac7_view_remove_jitter` and `rsf_ac7_velocity_shader_seen` were kept here as a public view entry and a fixture C entry; nothing consumed the first and no C fixture called the second, so item 3 removed the one and gated the other to `warp-fixture`.) Not done: the variant builder's `BUILT`/`REFUSED`/retry codes and slot out-parameter in `velocity_pass_cache` (an enum would fit), and the `rsf_ac7_code_leaves`/`truesky_patches` records shared with the fixtures. + +### Round 5: tests and fixture modules + +Scope: `tests/**` and the `*fixture*` modules that borrow from it. Everything moved into `tests/support` (`rsf-test-support`, never linked into a shipped binary), which now depends on `rsf-game-sys` and `ash`. Closes the remaining halves of T9 and the "hard duplicates" left by round 2. + +Moved into `tests/support`: + +- `frame_record(session, frame, view, render, output)` and `sr_camera(&mut record, near, far)` replace 16 hand-written `rsf_frame_record` builders (`tests/capture` x6, `generation/session.rs`, `game-sdk/contract.rs`, `vulkan-fg` `xess_sr`, `xess_present`, `xess_input_range`, `presentation/fg_bridge.rs`, `native_sr_vulkan.rs`, `native_sr_fsr4_vulkan.rs`, and the orchestrator `vulkan_ffx_fg/fixture.rs` and `vulkan_dx12_fg/fsr4_state_fixture.rs`). Each caller keeps only the values that differ (flags, generation, frame time) through struct update. The identity-matrix SR camera is shared by `xess_sr`, `native_sr_vulkan` and the FFX fixture; the other fixtures set a different camera subset on purpose (no far plane, no inverted depth, camera sizes left zero) and keep their own lines. Not folded: `native_sr_vulkan_capture.rs` and `sharpening_vulkan*.rs` (a zeroed record with no header is what they test), the `cfg(test)` builders inside the orchestrator and the production builders in `fg12.rs` and `sr_legacy.rs`. +- `cpu_event(session, source, stage, qpc, frequency)` replaces nine `rsf_game_cpu_event` builders (`game-sdk` `cpu_events::fact`, `vk_latency::event` and the RDR2 input event; `presentation` loop, marker, host-device and `fg_fixture_loop`; `generation/dll.rs`; the orchestrator `native_fg_cpu` fixture). The Reservation fixture's `fact` already wrapped `cpu_events::fact`. `qpc()` and `qpc_frequency()` replace four hand-written counter readers; the RDR2 `timestamps()` keeps its own because it asserts that both queries succeed. +- `ignore_pipeline_barrier` is the one empty ten-argument `vkCmdPipelineBarrier` fake (was `capture` CPU queue, `xess_input_range`, orchestrator DLSS-G fixture and FFX FG fake GPU). `vk_entry` is the single `PFN_vk*`-to-`rsf_vk_function` cast behind seven fake resolver tables (`sharpening_vulkan_cpu`, `native_sr_vulkan_capture`, `capture` queue, `xess_input_range`, `vk_amd`, DLSS-G fixture, FFX fake GPU); the FFX fake GPU's two identical macros are one. `Library::vulkan` and `vulkan_instance_proc` replace four copies of `LoadLibrary("vulkan-1.dll")` plus `GetProcAddress` plus transmute (`vulkan_gpu.rs`, `xess_sr_gpu.rs`, `xess_interop.rs`, `capture/vulkan.rs`); `vulkan_gpu.rs`'s own `Library` wrapper is gone. The fixtures that pin the loader for the process forget the `Library` explicitly. +- `wide_os` replaces two `wide(&OsStr)` definitions and ten inline `encode_wide().chain([0]).collect()`. (`rsf_game_sys::ffi_util::wide` takes `&str`; this takes paths.) +- `d3d11_device_on(adapter, driver, flags, levels)` and `d3d12_device(adapter)` are the chosen-adapter forms the round 4 note said the helpers lacked. They replace the hand-written creation in `presentation` (`lib.rs`, `fixture_device.rs` x2), `generation/device.rs`, `sr_backend_switch_device.rs`, the orchestrator `dlss_pipeline/exports/fixture.rs` and `sr_bridge/fixture.rs`, and the Anomaly `motion/device_fixture.rs` and `sr_fixture_device.rs` (which read the level back with `GetFeatureLevel`; `motion-device-fixture` and `sr-fixtures` now take `rsf-test-support`). +- Windows: the `game-sdk` unity fixture `Window` and its `window_procedure`, the `overlay-service` `Window` and class registration, the presentation `register_window`/`window` pair and the hidden GL window with its own `DefWindowProcW` forwarder all use `rsf_test_support::Window` (the second overlay-service window gets its own class name, because `Window` registers and unregisters per instance). + +Kept, with the binding or reason: + +- `tests/ac7_native_graph.rs` `Calls`, `tests/native_sr_vulkan.rs` `Calls`, `tests/exposure_normalization.rs` `Services` and `tests/sharpening_settings.rs` `Services` are `#[repr(C)]` tables of function pointers that a C launcher fills (`ac7_native_graph.c`, `native_sr_vulkan_main.c`, `exposure_normalization_main.c`, `sharpening_settings_native.c`) with the DLL's own exports; a Rust `extern` block would resolve to link thunks (see S7.2 constraint 1). Second binding: C. `games/anomaly/src/sr_stage/hook_fixture.rs` `NearCalls` is the same kind (`anomaly_sr_hook_bridge.c` passes the invoke and counter leaves). +- `presentation/d3d11_fixture_startup.rs` keeps its `DefWindowProcA` procedure and ANSI `_XRAY_FIXTURE` class: it reproduces X-Ray's ANSI class, topmost style and off-origin position. `tests/loader/census_warp.rs` keeps its own device code because it reaches D3D12 through `GetProcAddress` on purpose. The earlier reason for keeping `census_present.rs` and `vulkan-fg/xess_present.rs` on their own window code (moving them would add the `windows` crate to two more fixture crates) was false: `tests/loader` already built `windows`, so both now use `rsf_test_support::Window` and `wide_os` (item-3 fixes below). +- `game-sdk/unity_sr_d3d12/gpu.rs` creates its D3D12 device on a vendor-selected adapter at feature level 12.0 with an optional adapter, which `d3d12_device` (11.0, required adapter) does not express. +- The local `check!`/`expect!`/`ensure!` macros are unchanged: they count failures in different places (a `&mut` counter, a C++ runner, a `Checks` value, a thread-local that survives case resets, an `Err` return), so one macro would change call sites and semantics. `xess_sr::require` and `d3d11_host_device::require` are the same four lines but sit in crates with different error types around them. +- Not mine (other round 5 areas): Anomaly `fg_stage/fixture_device.rs`, `overlay/fixture.rs` window code and `examples/anomaly_motion_tess_device.rs`, `tools/exposure_probe`, the RDR2 fixture driver's window, and the `cfg(test)` fakes inside the orchestrator (`vulkan_sr/owner_tests.rs`, `vulkan_dlss_fg/owner_tests.rs`, `vulkan_sr/fallback.rs`), which cannot reach `rsf-test-support` without a dev-dependency. + +Checked off: nothing new. T9 stays open for the entries above that belong to other areas or are kept deliberately; its round 4 "not folded" list shrinks to those. + +### Round 5: runtime, loader, sdk/game and ui/overlay + +Search: `rg 'struct \w*(Platform|Leaves|Ops|Calls|Services)\b'` over `runtime/`, `loader/`, `sdk/` and `ui/`, plus the static tables that fill them. A table was removed when it had one production binding. Where a unit test needed a seam, production now calls a leaf module of the real functions and the test module supplies same-named fakes under `cfg(test)` (the OC-C2 and RS-A1 pattern). Production leaves that still compile under test, because their module also holds exports, carry `cfg_attr(test, allow(dead_code))`, as `d3d11_present_native.rs` already did. + +- [x] **Merged leaf list: `render_host` and `callback_host`.** Both carried an `impl_host_methods!` list forwarding the same leaves to the same functions, plus a `cfg(test)` table per test module. `render_host_native.rs` is now the one production leaf list and both hosts call `leaf::*`. `render_host_methods.rs`, both test tables and the `&'static Platform` fields and parameters are gone; `Adapter` and `ResourceDesc` moved to `render_host.rs`. +- [x] **Removed by cfg module swap (one production and one test binding).** `runtime/graphics` `d3d11_state` `Platform` (7 entries); `frame_capture_vk` `Platform` (11); `runtime/vulkan/fsr3` `Platform` (9) and `FgPlatform` (25); `d3d11_observer_hooks` (4) and its probe (5); `d3d12_observer` attachment `Platform` (7) and DRED `Removal` (7); `d3d12_window_presenter` `Leaves` (15); `reflex_audit` MinHook `Platform` (6); `shader_patch` `Platform` (13, with its cfg'd `platform()` selector); `sr_legacy` `Services` (14); `auxiliary_sr` `AuxPlatform` (13) with its publisher `rsf_auxiliary_sr_platform`; `overlay_host` `Platform` (26); the Streamline lifecycle `Platform` (6; its six entries survived as the one-impl `System` trait until the item-3 fixes moved them into `lifecycle_leaf`). +- [x] **Removed outright (one binding, no test filled them).** Streamline lifecycle `frame_generation::Platform` (3); `overlay_input_route` `MessageOps` (8); `overlay_window` `Platform` (3); `d3d12_generation/fsr.rs` `Ops` (20; the XeLL fixture fills the XeSS `Ops`, not this one). +- **Kept: C fills or calls the table.** `d3d11_observer_present.rs:22` (`rsf_observer11_present_platform`, a C static read through an extern block); `loader/src/census.rs:53` (`rsf_census_platform`, published by the C census leaves at install; the loader's per-family `Services` are entry-ID arrays, not function tables); `runtime/vulkan/xess-fg/session.rs:90` (`rsf_xess_bridge_platform`, filled by `bridge.c:1188`). +- **Kept: several production bindings chosen at run time.** `vulkan_fg.rs:36` `Provider` (DLSS, FFX, FSR4 or XeSS, chosen per backend); `overlay_wrapped12.rs:34` (`native.rs` `PLATFORM` and `PRESENT`); `vulkan_ffx_fg/startup.rs:28` (built per call from the loaded SDK host's `symbol` entry). +- **Kept: different fakes in one test binary, which one cfg swap cannot give.** `vulkan_fg.rs:66` (the provider set: `NATIVE` by feature, and `BASE`, `WITH_FSR4` and `WITH_XESS` in `dispatch_tests`); `overlay_cursor_hooks.rs:25` (the `overlay_input.rs` test `minhook::PLATFORM` refuses every hook while the cursor test counts removals); `shared_surface.rs:52` (its own test `PLATFORM` and `d3d11_present_tests.rs` `SHARED`); `overlay_native12.rs:81` (`PLATFORM`, `FRAME_PLATFORM` and two per-test tables in one module); `streamline_host.rs:132` (`tests.rs` `PLATFORM`, `platform` and `unavailable`, and `generation/tests.rs` `reject`); `vulkan_xess_fg.rs:36` (`operations()` builds a table per test). +- **Kept: a separate crate fills it beside production.** `vulkan_latency.rs:49,63` (`tests/game-sdk/src/vk_latency.rs` calls the `pub` `rsf_core_latencyvk_*` entries with its own `Platform`). +- **Kept: the test-fixtures archive uses a variant next to production.** `dlss_vulkan_capture.rs:52` (24 entries; `vulkan_dlss_fg/fixture/sdk.rs` `CAPTURE_TABLE` overrides seven of them, while the same executable also opens captures through the production `LEAVES` via the DLSS-G owner's `start_capture`); `vulkan_dlss_fg_abi.rs:66` (the fixture's `Normal`, `CaptureRequired` and `CaptureRefused` tables, chosen per scenario). +- [x] **Fixture-backed tables: a third archive, not tables.** The cargo feature `fixture-leaves` (implies `test-fixtures`) swaps an owner's leaf module for its state fixture's named fakes. CMake builds it as a third orchestrator archive (`rsf_orchestrator_fixture_leaves_rust`, `runtime/orchestrator/CMakeLists.txt`), selected by the target property `RSF_ORCHESTRATOR_FIXTURE_LEAVES`. Only four executables link it (`tests/CMakeLists.txt`, the second fixture loop): `rsf_native_fsr4_fg_state_test`, `rsf_native_sr_fsr4_state_test`, `rsf_native_fg_cpu_test` and `rsf_xell_sleep_concurrency`. The test-fixtures archive keeps the real leaves for the 27 other fixture executables, among them `rsf_native_sr_fsr4_vulkan_test`, which drives the real FSR4 SR bridge. Removed this way: `fsr4_fg_bridge` `Platform` (36); `vulkan_fsr4_fg` `Ops` (11, with its `ProductionOps` `LazyLock`); `vulkan_fsr4_sr` `Platform` (26 `Option` slots, always `Some`); `dx12_vulkan_interop` `Platform` (16; unit tests keep the real `dx12_vulkan_platform` leaves, so its fixture module is used only outside `cfg(test)`); `native_fg_cpu` `Platform` (25; the fixture overrides the presentation-bridge leaves and re-exports the production Streamline host and Anti-Lag ones, and the two fixture-only slots are `FIXTURE_*` constants that are `None` in production); `d3d12_generation/xess` `Ops` (24). The FSR4 SR public-ABI refusal fixture moved into `vulkan_fsr4_sr.rs` under `test-fixtures`, because the device ctest calls it with the real bridge entry. The shared `GraphicsOps` and `InteropOps` stay as types, because the XeSS vendor and the shared presenter take them by reference; their two importer statics are now one `IMPORTER` in `vulkan_dx12_fg.rs`. +- [x] **Removed by cfg(test) swap: `vulkan_ffx_fg` `Ops` (24) and `vulkan_sharpening` `Platform` (14).** The FFX `Host` stays a run-time choice, because the test-fixtures fake SDK passes its own host through `rsf_core_ffxgvk_create_sdk`. +- [x] **X11, intra-crate `extern "C"` re-declarations:** the blocks in `vulkan_fsr4_fg.rs`, `vulkan_xess_fg.rs` and `native_fg_cpu/platform.rs` are gone, and all three call the crate's functions by path. The `rsf_dx12vk_interop_*` exports take untyped handles, as `native_dx12_vulkan_interop.h` declares them. +- **Kept: the Vulkan SR composition.** `vulkan_sr.rs:370` `Platform` composes the DLSS (`vulkan_dlss_sr.rs:66`), XeSS (`vulkan_sr/xess.rs:73` `XessOps`) and FFX (`vulkan_sr.rs:379` `FfxOps`) tables, at `vulkan_sr.rs:439` (`NATIVE`, by feature) and `vulkan_sr/owner_tests.rs:392`. One test passes the composite per call, as `None` and as `Some(&PLATFORM)` (`owner_tests.rs:861,865`), and the DLSS owner is created over two fakes in that same test (`DLSS` at `owner_tests.rs:193`, and `REFUSING`, its struct update at `:842`). The XeSS fakes (`vulkan_sr/xess/tests.rs:155`) are shared by the XeSS tests and this composite. The shared image table `vulkan_fg_resources.rs:36` has three production implementations chosen per owner: `vulkan_fg_resources/device.rs` `DEVICE_PLATFORM`, `vulkan_dx12_fg/platform.rs` `IMAGES` and `vulkan_sharpening/native.rs` `IMAGES`. +- **Kept: RS-A1 present fakes.** `d3d11_present_tests.rs` provides 72 leaf fakes, and every one is named by a `leaf::` call in the owner files the tests compile (checked by listing both sets). Removing a fake therefore means moving that call out of the leaf boundary, which changes what production calls. No fake is dead. + +### Round 5: games and integrations + +Scope: `games/**` and `integrations/**` function-pointer tables and the fixture scaffolding the tests round left to this area. The pattern is the OC-C2 one: production calls the real function by name; under `cfg(test)` the owner imports a module of fakes with the same names (`#[cfg(not(test))] use as leaves; #[cfg(test)] use tests as leaves;`). Per-test fake behaviour moved into thread-local knobs where a test varied it. Nothing was built or run beyond `cargo check` (lib, `--tests`, `--all-features`, `native-entry`/fixture features) on the touched crates. + +Converted (table, its production binding, what replaced it): + +- RDR2 `capture_state/hooks.rs::Ops` (four MinHook leaves, bound only by `detours.rs::HOOK_OPS`) and `gpu_leases.rs::Ops` (five COM leaves, bound only by `d3d12.rs::GPU_OPS`): `hooks` calls `detours::{vtable_target, create_hook, enable_hook, hook_report}`, `gpu_leases` calls `d3d12::{retain, release, create_fence, signal_fence, get_buffer}`; the tests import fakes with those names. `ReadbackLeases` lost its `ops` pointer (an adopted buffer is the same fact) and its size assert. +- Skyrim `observers::Leaves` (`NATIVE_LEAVES` plus two test tables): `Control` calls the MinHook leaves by name; `observers::fake` has thread-local `ENABLE_REFUSES`, `DISABLE_REFUSES` and the `DISABLED` count the session tests read. The session `subsystems` module was already a cfg swap and stays. +- Anomaly `bootstrap::Leaves` (`LEAVES` in `bootstrap/native.rs`) and the options-registration callback `orchestrate` took: `leaves::*` is `bootstrap/native.rs` or `bootstrap/tests.rs`. In a check-only test build with `native-entry` the entry is compiled beside the fakes, so `lib.rs` allows its dead code for that combination. +- Anomaly `fg_inputs::Bindings` (`d3d::BINDINGS`, already cfg-chosen at `Owner::new` and then copied into every owner): `leaves::*` is `fg_inputs/d3d.rs` or the test module. +- Anomaly `motion_device::Platform` (nine D3D11 leaves behind `rsf_anomaly_motion_device_platform_get`) and `motion_device/replay.rs::Platform` (seven context leaves, production binding only): the owner calls `d3d11::device::*` (the counting fakes under test), replay calls `d3d11`'s context leaves, and the motion stage uses `motion_device::{retain, release}`. `rsf_anomaly_motion_device_new` and `rsf_anomaly_motion_replay_begin` lost their table parameters; both typedefs left `motion_device_platform.h` (no C file calls those prototypes). +- Anomaly `sr_reconstruction::Platform` (user pointer plus read, write, buffer; production `POSITION_PLATFORM` with a null user in a `Sync` newtype): the correction calls `engine::*`, `sr_stage::native::position` in production, a fake over a thread-local engine under test. The C mirrors `rsf_anomaly_position_layout`/`_platform` and the export's prototype left `sr_stage_platform.h`; the export is a plain Rust function. +- Anomaly observer table (`native_observer_platform.c:59`): its eleven Rust-export entries (`quiesce_sr`, `quiesce_motion`, `input_idle`, `render_begin`, `sr_frame_end`, `end_before`, `end_after`, `camera`, `ui_boundary`, `scope_frame`, `device_reset`) left the C struct and initializer; `native_observer.rs` calls them through `stages`, the stage modules or the tests' recording fakes (the stop-drain order test keeps its `TEARDOWN` record). `rsf_anomaly_observer_before` no longer takes the table, and the prototypes no C file calls any more left `stage_entries.h`, `sr_stage.h`, `input_hooks.h` and `fg_stage_platform.h`. The Rust functions kept `no_mangle` here so the test builds would not see them unused; calling by name needs no export, so item 3 made them plain functions with `cfg_attr(test, allow(dead_code))`. +- Godot `EffectLeaves` (`gdextension/effect.rs::LEAVES`): `effect.rs` keeps the three typed adapters as private functions over `leaf_frame`, `leaf_resources`, `leaf_read_motion`, the recording fakes under test. `typed::Requirements` (a sized, versioned table of the linked Runtime's XeSS and latency exports, built by `vulkan/native.rs`, checked and stored by `bind_requirements`): the typed leaves call `rsf_xessvk_*`/`rsf_latencyvk_*` directly, `typed/tests.rs` mocks them under those names, and `rsf_godot_vk_creation_resolver` lost its `requirements` parameter. +- Unity `package_state::Leaves` (50 entries, `native.rs::PRODUCTION` published through a `OnceLock` at plugin load): `Leaves` is a unit type whose typed methods call `raw::*`, `native::raw` (re-exports of the Runtime, bridge, preview and Win32 functions and package.c's two leaves) or the test module's fakes; the `OnceLock` is the `LOADED` flag every entry already checked. Fakes of functions that are safe in production are safe too. `vulkan_state` `DeviceOps`/`SurfaceOps` (bridge statics; `SurfaceOps` had no test binding at all) and `d3d11_state::DeviceOps` (`bridge_d3d11.rs::OPS`): `ops::*` is the bridge module or the test fakes, so `SharedDevice`, `Surface` and the fence proofs carry no table copy. The GPU leaves and the SR ring calls lost the C ABI they had only for the tables. +- Anomaly SR stage cluster. The 80-entry `rsf_anomaly_sr_stage_platform` (built by `sr_stage/native.rs`, partial tables per `Stage` in `sr_stage/tests.rs`) and the C-filled 128-byte `rsf_anomaly_sr_native` are gone. The stage calls `sr_stage::leaves::*`: `sr_stage/native.rs::leaves` in production (the C leaves exported as `rsf_anomaly_sr_native_{copy,set_projection,set_mip_bias,constant_buffer,install_hooks,hooks_created,enable_hooks,disable_hooks}`, the INI and persist functions, the D3D11 context calls and the `stage_bridge` driver functions), and `sr_stage/tests.rs::leaves` under test, with thread-local knobs for stale-close, timers and the production INI, and the staging fakes. The run-time availability the `Option` entries encoded is now one `Platform { bound }` flag: `bind()` (from `rsf_anomaly_sr_stage_configure_native`/`_install_build`) replaces `register()`, and `leaf!` answers with the refusal value while unbound. `stage_bridge::PLATFORM`/`production()`, the `sr_stage_platform.h` typedefs and the guard-unavailable test (`missing_native_guard`, which only a missing table entry could reach) are removed. `sr_d3d11::Platform` went the same way: `sr_d3d11::d3d` is `native::calls` (the exported `rsf_anomaly_sr_save_state`/`_restore_state`, `rsf_d3d11_create_shader_view`) or the test calls, and `sr_d3d11_platform.{c,h}` lost the table typedef, the foreign record and the register/platform exports. `sr_swap::Platform` became `sr_stage::native::swap_host` (`tests::swap_host` under test); the swap keeps only its host context pointer, since the tests run several live hosts per case. The C fixtures `anomaly_sr_roundtrip.c`, `anomaly_sr_temporal_device.c` and `anomaly_sr_hook_bridge.c` no longer pass tables. +- Anomaly observer and motion stage C tables. `native_observer.rs` declares `rsf_anomaly_observer_native_{identify,enable_hooks,disable_hooks,install_geometry,install_sr,install_motion,enable_input,disable_input,read_frame,copy}` and `rsf_anomaly_geometry_disable_native` and calls them by name; the tests' `leaves` module re-exports the recording fakes (`sample_copy`, `read_frame`, the disables) and stubs the rest unreachable. `rsf_anomaly_observer_native()` is removed, and the lifecycle exports and `rsf_anomaly_observer_after` take no table. `motion_stage_platform.c` exports its leaves as `rsf_anomaly_motion_native_*`; `motion_platform()` and its typedef are removed; `motion/stage/native.rs::leaf` declares them (unit-test stubs beside), and configure/install take `(ini, log, user)` and `(image, build)`. +- Anomaly engine includer (`rsf_anomaly_engine_include_ops`, bound only by the motion stage and empty under test): `shader_loader/runtime_pack.rs::engine` declares the guarded `rsf_anomaly_motion_native_include_{open,copy,close}` leaves, which the Runtime's include callback (`resolve_include`) and the includer probe call directly. The pack keeps only the engine's includer table pointer. The typedef left `engine_shader_includes.h`. +- Anomaly `overlay` `Platform`/`Leaves`, `StageControls` and `Desktop` (production `NATIVE`, `STAGES`, `DESKTOP`, carried in `Overlay`, `Service` and every `start`): `overlay::leaves` is the `native` module (`overlay_native`, `overlay_hooks`, the SR stage, `fg_stage`, `win32`) or `overlay/tests.rs::leaves`, with a thread-local `PRESENT_REFUSED` for the refused-hook case. The fixed test desktop (any window, the `INSERT` atomic) replaced the per-instance ones, which only the Present test read. +- Fixture-archive CMake wiring. The C leaves (`native_observer_platform.c`, `native_hooks_platform.c`, `native_geometry_platform.c`, `engine_slots.c`, `sr_d3d11_platform.c`, `sr_stage_platform.c`, `motion_stage_platform.c`, `fg_stage_platform.c`) are the INTERFACE library `rsf_anomaly_native_leaves` (`games/anomaly/CMakeLists.txt`). The plugin links it, and `rsf_anomaly_fixtures_rust` carries it (`tests/CMakeLists.txt:75`), so the sources compile with each consumer's definitions. The per-executable copies of those sources are gone. Every executable that links the fixture archive now gets the leaves it names. In `tests/anomaly_support.cmake`: `rsf_anomaly_temporal_test`, `_geometry_test`, `_geometry_hooks_test`, `_overlay_hooks_test`, `_sr_profile_test`, `_sr_hooks_test`, `_sr_roundtrip_test`, `_motion_contract_test`, `_motion_device_test`, `_motion_hooks_test`, `_motion_tess_chain_device_test`, `_motion_far_device_test`, `_sr_jitter_test`, `_sr_jitter_device_test`, `_sr_runtime_api_test`, `_sr_temporal_device_test`, `_input_hooks_test`. Elsewhere: `rsf_anomaly_fg_device_test` (`tests/anomaly_fg.cmake`), `rsf_anomaly_overlay_visibility_test` (`tests/overlay_dll_api.cmake`) and `rsf_anomaly_native_hooks_test` (`tests/CMakeLists.txt`). No CMake build was run; the final verification builds them. +- Fixture scaffolding (T9 entries the tests round assigned here): the Anomaly FG device fixture window, the overlay device fixture `Window` and the RDR2 capture driver window and `wide` use `rsf_test_support::{Window, wide_os}` (the overlay fixture's own `wide(path)` remained until item 3); `examples/anomaly_motion_tess_device.rs` creates its chosen-adapter device through `d3d11_device_on`. `fg-fixture` now takes `rsf-test-support`. The FG fixture's chosen-adapter swap chain stays local (the support helper takes no adapter). + +Kept, with the binding and reason: + +- Fallout 4 `render_hooks/{recovery,publication,scope,imagespace,producer}.rs` `Leaves`: `render_hooks.c` fills all five with C static leaves (`:296`, `:449`, `:518`, `:536`, `:587`; the SEH-guarded engine reads, scope and output leases) and passes them on every hook entry, and the five render-hook test modules bind different fakes for the same leaves (`read_world`, `report`, the recovery `IDLE` overrides) in one test binary. A few entries are Rust exports routed back through C (`rsf_fallout4_render_diagnostic`, `_read_owner`, `_read_manager`, `_same_object`, the `rsf_fallout4_resolution_*` four); calling those directly would need the same per-module fakes and is left. +- Godot `VkCreationLeaves`: `typed/tests.rs` drives the real typed leaves through the resolver while `creation/tests.rs` binds recording fakes, in one test binary. Its unread `struct_size`/`version` header, `VK_CREATION_VERSION`, `repr(C)` and the C ABI of its entries are gone. `EngineServices`, `CpuService`, the engine module's `Calls` and host callback records and `gdextension/api.rs` are engine-module, Runtime or GDExtension FFI. +- Anomaly `input/gate.rs::DeviceCalls`: per-device MinHook trampolines (ANSI and Unicode DirectInput), filled at run time. `native_hooks` `Platform`/`HookOps`, `native_geometry_abi` `Platform`/`Writer`, `fg_stage::EngineBindings`/`fg_inputs::StateScope`: filled by C (`native_hooks_platform.c:55,59`, `native_geometry_platform.c:109,156`, `fg_stage_platform.c:16`); the C fixture `tests/anomaly_native_hook_leaves.c` hands that C-filled platform to the Rust fixture, and `native_hooks/tests.rs:66` and `overlay_hooks.rs:775` bind other `HookOps`. `motion_target::Platform` has two bindings, the motion stage's (`motion/stage/native.rs:211`, the C bind copies and the motion device's target calls) and the binder fixture's (`motion_target/fixture.rs:86`). `sr_stage::Platform` is now only the bound flag. `fg_stage` `PresentBindings`/`FgBindings`, `sr_temporal::RuntimeApi`, `motion_device::ConstantOps`: the Runtime DLL's API tables resolved at run time. +- AC7: `render_scope::Calls` is `rsf_ac7_scope_calls` from `render_scope_entry.c` (SEH leaves); `sites::Code`/`CodeView` have several production implementations over the C-filled `rsf_ac7_code_leaves`. `lifecycle::Leaves`, `renderer::Native` and `truesky::Plugin` are statically dispatched traits, not pointer tables; their production implementations sit on the C-backed renderer chain that is compiled into every test build, so a cfg swap would leave that chain unreachable under test and need `cfg(not(test))` gates through it. Left for a decision. +- RDR2 `shots.rs` `Completed`/`DeviceRemoved`/`Copy` parameters: the tests pass different functions per call (`device_live` against `device_removed`). + +Production modules that the fakes replace but that still compile under test carry `cfg_attr(test, allow(dead_code))`: `overlay_hooks`, `overlay_native`, the stage methods the overlay calls, `fg_stage::{overlay_options, foreign_chain}` and `Gate::new`. + +Superseded round 2 keeps: the RDR2 `hooks::Ops`/`gpu_leases::Ops`, the Godot `Requirements`, and the Unity `Leaves`, `DeviceOps` and `SurfaceOps` notes above. Checked off: nothing. S3.1 stays open for the AC7 decision above and for the other areas. + +### Item-3 fixes: runtime-rest + +The 18 violations of the item-3 audit of `runtime/**` (orchestrator aside), `loader`, `sdk/game`, `ui/overlay`, `integrations/windows` and `integrations/steam` at `03b1c5ad`. Checked with `cargo check` (lib and `--tests`) on every touched crate; nothing was built or run. + +- [x] 1. `runtime/vulkan/ngx/src/vulkanstory.rs`: the 29 `VulkanStoryNgx_*` aliases are gone. `NgxShim.cs` binds `rsf_vk_ngx_*`, so the Round 5 kept reason ("VulkanStory package names") was false and is removed from that list. +- [x] 2. and 3. `frame_tap/platform.rs`, `frame_tap.rs` and `constant_buffer_read.rs` call COM through `com_ref::vtable` and the `windows` records. Gone: `method!`, `constant_buffer_read::slot`, `SamplerDesc`, `BufferDesc`, `MappedResource`, the `Map`/`Unmap` types, the RTV `[u32; 5]`, the `IID_ID3D11DeviceContext1` literal, the map/usage/bind/keep-targets constants and the `rsf_frame_tap_viewport` C mirror of `D3D11_VIEWPORT`. The hooked originals keep their `transmute`. +- [x] 4. `capture_pixels::Pixels` is the generated `rsf_dump_pixels`; the hand struct and its asserts are gone. +- [x] 5. `d3d11_state::native::immediate` calls `rsf_d3d11_output_is_immediate`; `rsf_d3d11_copy_resource` and its `d3d11_state.h` line are gone, and `auxiliary_sr` uses `rsf_d3d11_output_copy_resource`. +- [x] 6. `rsf_xinput_facts_idle` export and header line removed; `remove` reads the reader count itself. +- [x] 7. Streamline lifecycle `System` trait, `Win32` and the test `Fake` removed: `load`, `free`, `close`, `symbol`, `loaded` and `verbose` are `lifecycle_leaf` functions with same-named fakes. The leaves are plain `unsafe fn` inside `lifecycle_leaf`. One `cfg_attr(test, allow(dead_code))` stays, on `admission::open_by_digest`: only the production leaf calls it. +- [x] 8. The eight core `Entry` statics and the hand `resolve` are one `sdk_api::Entries` behind an `RwLock` that `clear()` empties. `Entry` stays for the feature functions bound through `bind`. +- [x] 9. The hand kernel32 blocks and `LOAD_LIBRARY_SEARCH_*` constants are `windows-sys` imports (the crate gains `Win32_System_Threading`). `sdk_api::proc_address` is the one `GetProcAddress` wrapper, and `admission` uses `sdk_api::export`. +- [x] 10. `lifecycle/tests.rs` uses `rsf_game_sys::ffi_util::wide`. +- [x] 11. The nine module-path reads call `rsf_game_sys::win32::{module_path, module_path_in}`. +- [x] 12. The Steam export validates with `call_header::validate` and logs with `host_log`. `prepare_from_abi`, the local `log` and the local `RSF_OK` are gone. +- [x] 13. `dx12::acquire_for_device` is public and re-exported, and the `lib.rs` forwarder is gone. +- [x] 14. Census `flag`, `output`, `fields` and `args` are `Json` methods. A fifth `output` copy in `vulkan.rs` (`VulkanJson`) went the same way. d3d's pointer-read variant is `written`, because it reads through d3d's own `read`. +- [x] 15. `sidecar.rs` imports `sections::wide`. +- [x] 16. The `thin.rs` `note` writes through `CarrierLog` and keeps its `OutputDebugStringA` line. Its log lines now carry the `[tick] ` prefix that the other carriers write. The thin-loader test checks the log with `contains`. +- [x] 17. `integrations/windows/src/minhook.rs` and the compat `native.rs` import the `MH_*` status values from `rsf-minhook-sys`. +- [x] 18. `dxgi_format.rs` derives its values from the `windows` `DXGI_FORMAT_*` constants. `rsf-vk-fsr3` imports `GetModuleHandleW`/`GetProcAddress` from `windows-sys` (a new dependency), and `rsf-game-sys` imports `GetPrivateProfileStringW` (the new `Win32_System_WindowsProgramming` feature). +- [x] Noted item: the stale `allow(unused_imports)` on `sdk_fg_options::Sample` is gone. + +Kept against the audit: none. `capture_pixels` stays as a one-line re-export so that the orchestrator's importers (`capture_test_sink`, `frame_capture12`, `frame_capture_vk`, `input_dump`) keep their path, because that crate belongs to another fix area. The audit's other "noted, not counted" items stay as they are: the three NUL-terminated UTF-16 slice helpers, the bridge header-check code mapping and the fsr3 capsules. + +### Item-3 fixes: integrations-tests + +Fixes for the independent item-3 audit of `integrations/godot`, `integrations/unity`, `integrations/vulkanstory` and `tests/**` (`.local/audit/item3-integrations-tests.md`, 12 findings). VulkanStory had none. Closed: + +- [x] **1 Godot extension callbacks.** `extension_abi.h` (the 5-entry `rsf_godot_motion_calls` table, the `rsf_godot_property_emit` callback with its union, the options `read` callback) is gone with its `build.rs` entry and the `rsf_godot_effect_readback` blocklist. `Readback::record` (gdextension/effect.rs) runs compile, prepare, dispatch, read and free itself; `Properties` writes a typed `Property` enum through a Rust closure that `Sink::put` turns into Dictionary entries; `extension::configure` takes a read closure. `rsf_godot_effect_record_motion`, `_effect_properties`, `_extension_configure` and `_extension_status` are plain Rust. +- [x] **2 Godot Rust-only `extern "C"` wrappers.** `vk_render_begin`, `vk_capture_present` and `vk_creation_resolver` are plain functions taking `bool`; `rsf_godot_extension_capture` is deleted (its one caller calls `rsf_input_dump_request`). +- [x] **3 Backend result codes in Godot and Unity.** `control`, `d3d12`, `vulkan`, `vulkan/sr`, `vulkan/native`, `vulkan/creation/typed`, `platform/vulkan_negotiation` (Godot) and `package_state`, `package_state/services`, `vulkan_bridge` (Unity) use `rsf_game_sys::backend_result`. +- [x] **4 Result codes in the fixtures.** About 30 files under `tests/**` import `RSF_OK`/`RSF_ERROR_*` or `backend_result::*` by the family their API returns (`NOT_READY` is -3 in the first and -8 in the second). `tests/capture/capture_fixture_abi.h` lost its five `RSF_FIXTURE_BACKEND_*` re-exports. Kept: the Streamline `sl::Result` `OK` in `unity_sr_d3d12/streamline.rs`, the fixture-private codes (`SHADER_FAILED`, `OPEN_FAILED`, `DEVICE_FAILED`, `PIPELINE_*`, `SOURCE_MISMATCH`) and the FSR4 FG header's `INVALID`. +- [x] **5 Vulkan result literals.** Godot `vulkan_negotiation.rs` and Unity `vulkan_state.rs`, `vulkan_wsi.rs` and `vulkan_resolver.rs` derive their `VK_*` values from `vk::Result::*.as_raw()`; Godot `creation.rs` imports negotiation's, Unity's Vulkan modules share the resolver's. +- [x] **6 `graphics_fixture_device.rs` compiled three times.** `Device`, `TestResult` and `half_to_f32` are `rsf_test_support::device`; the three `#[path]` mounts, the `clippy::duplicate_mod` allow and the file are gone. +- [x] **7 D3D12 fixture scaffolding.** `rsf_test_support::d3d12` owns `committed`, `buffer`, `footprint`, `copy_location`, `borrowed`, `transition_barrier` and `transition`; `capture/d3d12`, `exposure_normalization`, `game-sdk/unity_sr_d3d12/gpu` (and its `rdr2`), `sharpening_d3d12`, `presentation/{fg_bridge,gl_fixture}` and `generation/latency` use them, as does `tests/loader/census_present`. The audit's `presentation/fg_fixture_callbacks.rs:128` is a record builder (`rsf_backend_resource`), not a committed resource, and its `transition` forwards to the C fixture's barrier, so it stays. `sharpening_d3d12.rs` keeps calling the orchestrator's production `d3d12_sharpening::transition`, which it exercises. +- [x] **8 False kept reason for the census and XeSS window code.** Corrected above. `census_present.rs` and `xess_present.rs` use `rsf_test_support::Window`; `tests/loader` uses `wide_os` instead of its own `wide`. `tests/vulkan-fg` took the `windows` crate directly under `xess-device`, because `Window::new` takes `PCWSTR` and `WINDOW_STYLE`, so the audit's "no new direct dependency" did not hold for the arguments (it did for `Window.handle.0`). +- [x] **9 Cross-crate `#[path]` mounts.** `tests/game-sdk` takes `half_to_f32` from `rsf-graphics`, `tests/vulkan-fg` takes `bridge_abi` from `rsf-vk-xess-fg` and the XeSS SDK records from the orchestrator (`rsf_orchestrator::xess_sdk_abi`, exported under `test-fixtures`). +- [x] **10 Unity `rsf_unity_texture_ops`.** The lease calls `retain_texture`/`release_texture` (COM in production, recording fakes under `cfg(test)`); the struct is gone from `bridge_state.h`. +- [x] **11 Unity Rust-only `extern "C"`.** 37 functions in `package_state`, `bridge_native/package`, `preview`, `vulkan_platform` and their test fakes are plain Rust. Kept `extern "C"`: `render_callback`, `accept_window`, `observe_preview`, `backend_log`, `host_cpu_event`, `render_config`, `rsf_unity_frames_report_managed`, the three `rsf_unity_mono_*` policy callbacks (stored in C structs lent to the Runtime) and `rsf_uvk_bridge_owns_window` (declared in `vulkan_foreign.h`). +- [x] **12 Duplicate COM borrow helpers.** Unity `bridge_interop::borrowed` replaces `bridge_d3d11::borrowed` and `vulkan_platform::borrow`; `rsf_test_support::borrow` replaces the two in `tests/presentation`. + +Also corrected: the `platform.rs` module comment about the removed `Platform` table. Not changed: the `#[repr(C)]` doc names of Rust-only Godot records (documentation only). + +### Item-3 fixes: runtime/orchestrator + +Fixes for the item-3 conformance audit of `runtime/orchestrator` at `03b1c5ad` (20 findings). Each line names the commit's mechanism. + +- [x] **1 DLSS pipeline platform.** The 40-entry `rsf_dlssp_platform` (one production and one test binding) is gone: `dlss_pipeline.rs` calls a `leaf` module (`dlss_pipeline/platform.rs`) that `cfg(test)` swaps for same-named fakes; the one test override (`native_sr_release`) is a flag in the test world. The `extern "C"` block that redeclared 22 crate functions and two `rsf-graphics` ones is gone (X11 missed it); the leaves import them by path, so their signatures are checked. Only `rsf_sharpening_requested` (C) stays declared. The remaining adaptors only cast the pass owners' typed pointers to the pipeline's raw handles. +- [x] **2 Rust-only exports.** 77 `#[no_mangle]` items with no C, C++, `.def`, `RSF_EXPORT`, script, `GetProcAddress` or other-crate `extern` caller lost `no_mangle` (and `extern "C"` unless a table stores them), and their prototypes left the headers (coordinator ruling): the 13 `rsf_dlssgvk_*`, 14 `rsf_fsr4gvk_*`, 5 `rsf_xessgvk_*` and `rsf_xessvk_interop_timeline`, 4 `rsf_dx12vk_interop_*`, `rsf_fgvk_create_for_backend` (now inlined into `rsf_fgvk_create`), `rsf_core_vk_timing_*`, 13 `rsf_dlss_native12_*`, `rsf_dlss_evaluate_shared/_native_present/_plan_render_size/_release_viewport`, 6 `rsf_overlay_host_*`, 4 `rsf_d3d11_present_*`, `rsf_overlay_native12_toggle/_visible`, `rsf_overlay_d3d12_frame_for_window/_present`, `rsf_sharpening_core_sanitize/_vendor_sharpness`, `rsf_settings_store_write_layout`, `rsf_core_dlss_pipeline_apply_sharpening`, `rsf_native_regions_depth_valid`, `rsf_native_scalar_exposure`. Ten of them then had no caller at all and are deleted (`rsf_d3d11_present_pace/_dispatch_owned`, `rsf_dlss_native12_registration_destroy`, `rsf_overlay_host_toggle` with its core, `_draw_target`, `rsf_overlay_d3d12_present`, the two sharpening wrappers with their unused C++ inline wrappers, `rsf_fsr4gvk_enable`, `rsf_xessvk_interop_timeline`). `dlss_native12.h` is deleted; `native_fg_dlss_vulkan.h` keeps only `rsf_dlssgvk_status` (bound by `crate::sys`). Kept exported: `rsf_xessgvk_images/acquire/...` and `rsf_xessvk_interop_image/_destroy` (`tests/vulkan-fg/src/xess_present.rs`, `xess_interop.rs` declare them), `rsf_fsr4gvk_probe` (Godot C), and every name with a C, `.def` or other-crate caller. Modules whose production leaves unit tests replace now carry `cfg_attr(test, allow(dead_code))` in `lib.rs`, which the exports used to hide; the XeSS FG module also allows it without `xess-fg-vk`. +- [x] **3 Vulkan timing.** `vulkan_timing_abi.h` (no includer, no bindgen listing) and the two forwarders are deleted; the FidelityFX owner keeps its stages as `&'static str` and calls `timing_begin`/`timing_end`. +- [x] **4 fg12 records.** `rsf_fg12_calls` (45 fn pointers, no user) and the five includes it needed are gone; `rsf_fg12_texture_desc` and the readback layout are Rust structs (`fg12::TextureDesc`, `frame_capture12::Layout`), `fg12_platform.h` keeps the two lifetime declarations, `build.rs` no longer binds it, and `d3d12_readback_layout.h` is deleted. +- [x] **5 Transition barriers.** One `d3d11_d3d12::transition_barrier`; the five copies and two inline ones call it. +- [x] **6 Raw-handle D3D12 leaves.** `create_fence`, `fence_completed`, `query_context4` joined `d3d11_d3d12`; `sr_bridge`, `render_host_native`, `xess_native`, `gl_shared_surface` and `native_fg` re-export them, `queue_execute` is the shared `execute`, and `d3d12_sharpening` uses `d3d12_host::device_of`. **Audit claim corrected:** `gl_shared_surface/native_dx.rs` `slot_reset/list_close/queue_wait/queue_signal` and the XeSS `rsf_core_xess_dx12_reset/_close` (called by `runtime/vulkan/xess-fg/bridge.c`) return the failing HRESULT, while the shared leaves return a 1/0 flag, so they are not copies and stay. +- [x] **7 Vulkan entry typing.** `dx12_vulkan_platform::typed` (the one sized transmute of a resolved entry) and `entry` (lookup plus typed) replace the hand-written transmutes in about ten owners. **Kept against the audit:** no shared table macro; the owners' tables carry different non-entry fields and mix instance and device scopes, so one macro would need a nested table and new field paths at every call site. +- [x] **8** `rsf_streamline_graphics` is the bindgen record; the hand mirror, `EMPTY` and its assert are gone. +- [x] **9** `rsf_input_dump_named_texture` takes the bindgen `rsf_named_frame_dump` records; `NamedRequest`/`NamedReport` and the cast are gone. +- [x] **10** `d3d11_present_facade` `NativeState` is gone: the facade calls `native::state_describe/parent/device/destroy`, which its unit test fakes, and `rsf_d3d11p_facade_create` is a plain fn. +- [x] **11** `overlay_cursor_capture` `Effects` is gone; it calls `overlay_input`'s genuine cursor functions. +- [x] **12** `d3d12_generation` `Checks` is gone: the XeSS leaf modules export the five checks (admission's, or the XeLL fixture's fakes), FSR calls admission directly, and `preflight`/`sdk_module`/`read_frame` take the one check they use. +- [x] **13 `Products` trait (nit), kept.** The trait is the bool-contract adapter over `AuxiliarySr`'s private methods of the same names (`reserve` returns `Option`, `refine`/`reserve` add the surface limits, `seal`/`temporal_prepare`/`spatial_prepare` wrap `render`). Dropping it means renaming one of the two method sets and exporting `d3d11_host`'s test fake into `d3d11_host_reduced`; the dispatch it does is already fixed at compile time by the leaf swap. **Done (final verification):** the trait is gone. `d3d11_host_reduced::Products` is a type alias, `auxiliary_sr::AuxiliarySr` in builds and `d3d11_host::tests::FakeProducts` under `cfg(test)`, so the host calls inherent methods. The bool contract is a second inherent `impl AuxiliarySr` block (`pending`, `matches`, `reserve` with the surface limits, `seal`, `temporal_prepare`, `spatial_prepare`, `prepare`); the owner's `Option`-returning reservation is renamed `reserve_frame`, `refine` takes the surface limit itself, and `cancel`, `original_colour`, `commit` and `restore` are the owner's own methods. `FakeProducts` implements the same methods inherently. +- [x] **14** `dlss_pipeline_tests`, `gl_pipeline/tests`, `gl_shared_surface/tests` and `render_host/tests` compose `com_ref::test::Fake`. +- [x] **15** `tests/graphics_fixture_device.rs` is `rsf_test_support::graphics`; the DLSS pipeline fixture loads the DLL through `rsf_test_support::Library`. +- [x] **16 Host test fakes (nit), kept.** The five text-identical fakes in `callback_host/tests.rs` and `render_host/tests.rs` each read their own module's thread-local `World` (different fields and event logs); sharing them means one merged test world. **Done (final verification):** the shared fakes (`sr12_destroy`, `fg_submitted`, `fg_hudless`, `fg_window`, `present_request`, and the also identical `tick` and `dlss_preset_valid`) and the `with`/`event`/`events` helpers come from one `host_test_fakes!` macro (`runtime/orchestrator/src/host_test_fakes.rs`), expanded in both test modules against their own `World` and `thread_local!` `WORLD`. The two worlds stay separate: their fields, defaults and event logs differ. +- [x] **17** The crate root has `now_qpc`, `copy_c_string` and `retain_object`; the four QPC readers, three C-string copies and two nullable retains call them. +- [x] **18** The FFX fixture imports `sdk.rs`'s `WsiDispatch`. +- [x] **19 (partly)** The `timeout_epoch` forwarder is gone, and the declaration of `rsf_vk_sl_initialize_features` names its flags as the definition does (the call already passed them in that order). **Kept:** the 19 `rsf_vk_sl_*` declarations in `vulkan_latency.rs`/`vulkan_dlss_fg/leaves.rs`. They bind the bridge's exported C ABI (`sl.def`, `wsi_exports.def`). The Rust definitions use `ash` types and other names (`instance_proc`, `synchronized_present`, `vk::Result`, `vk::PFN_vkVoidFunction`), while the latency `Streamline` table, which `tests/game-sdk` also builds, uses the C types. Binding them by path would retype that shared table and its external fixture tables. +- [x] **20** `d3d11_host_platform` calls `native_fg_cpu::bind_window`; `bind_latency_window` is gone. +- Stale keep-reasons corrected in OV-A1, OV-A5, the round-2 `input_dump`, `dlss_native12` and `dlss_vulkan_capture` entries. S1.1 and S1 mechanism 2 stay open for the other areas; this area has no Rust-only export left that the audit found. + +### Item-3 fixes: games + +Source: the read-only audit of `03b1c5ad` for `games/**` (22 violations). Nothing was built or run beyond `cargo check` of the touched crates (lib, `--tests`, `native-entry`, `--all-features`, the single fixture features, examples); the C changes are unchecked until the CMake verification. + +- [x] **1, 7, 6 Rust-only C exports.** The ~40 SR D3D11 leaves (`sr_d3d11/native.rs`, `sr_d3d11.rs`, `passes.rs`, `targets.rs`), the thirteen exports with no C, header or `.def` reference (FG stage entries, `input_idle`, motion bind draw/close, SR quiesce/frame end, motion quiesce) and the rest of the list (guard first-person, slot install, FG installed/overlay sink/input received/report, input install/received, overlay start/present/input observer, motion device and replay calls, motion report, geometry binding, SR report) are plain Rust functions. `extern "C"` stays where Rust hands the pointer on: `twin_refs` (retire), the overlay present/resize sinks, the motion bind/clear targets (`motion_target::Platform`, which C also fills), `input_begin` (passed by `bootstrap_platform.c`), and `crate::com` retain/release (the `Lease` release type). Test builds use `cfg_attr(test, allow(dead_code))` where the fakes replace the callers. `rsf_anomaly_overlay_install_default_input` (a forwarder) is gone. Every dead prototype left `engine_guards.h`, `engine_slots.h`, `fg_stage_platform.h`, `input_hooks.h`, `motion_device_platform.h`, `motion_stage.h` (now design notes only), `native_geometry_platform.h`, `overlay_platform.h`, `sr_d3d11_platform.h`, `sr_stage.h` and `sr_stage_platform.h`. +- [x] **2 SR D3D11 C records.** `rsf_sr_texture`, `_view`, `_draw`, `_twin_input`, `_target_view`, `_temporal_view`, `_twin_batch_info`, `_draw_views` and their asserts are gone; the header keeps the two state-snapshot leaves. The Rust records drop `repr(C)` and their size asserts. **Kept, with constraint:** `Texture` instead of `D3D11_TEXTURE2D_DESC`. `sr_d3d11.rs`, `targets.rs` and `sr_stage/staging.rs` compile on every target, but `windows` is a Windows-only dependency of the crate, and `TargetView::fields` copies the record's bytes into the engine's `CTexture::desc` cache, so the layout is load-bearing; `sr_d3d11/native.rs` now checks it field by field against the SDK type (the C offset asserts are gone). The colour and motion SRVs only the C view exposed are no longer created. +- [x] **3 Jitter forwarders.** Deleted; the fixture calls the math functions and methods. Also deleted: the `rsf_anomaly_sr_build_pass` fixture export (zero-on-refusal behaviour only its own test read). +- [x] **4** `rsf_anomaly_motion_stage_frame_target` deleted. **5** `Owner::target`, `view`, `upload` return values; the test-only `_new`/`_create` exports are gone. **16** foliage calls are `History` methods and `live_count`/`poisoned`; the scale forwarder is gone. +- [x] **8 `sr_profile.rs` allow.** Partly false: `tools/anomaly_profiles.py` lower-cases every const and profile scalar, and `tools/anomaly_sr_evidence.py` reads eleven of the twenty constants and five Profile fields by those names (the audit searched the upper-case names). Those carry a narrow allow naming the reader; the file-level allow, ten constants and the SR `label` nothing reads are gone (checked by diffing the reader's keys before and after). `function_rva` and `render_options_word0_rva` are read only by the contract fixture and carry `cfg_attr(not(feature = "sr-fixtures"), allow(dead_code))`, as does `TargetView::dsv` (round-trip fixture). +- [x] **9-12 AC7.** `rsf_ac7_velocity_shader_seen` is `observe_velocity_shader` under `warp-fixture`; the view probe imports `rsf_ac7_view_read`; `rsf_ac7_view_remove_jitter`, its math and test are gone; `open_leased` and `scopes_idle` are plain Rust functions. Their prototypes left the three AC7 headers. +- [x] **13, 20 Fallout 4.** The MinHook constants come from `rsf-minhook-sys`; `lib.rs` `create_hook(target, detour, &AtomicPtr)` replaces the two create-and-publish copies. **21 RDR2.** `asi.rs` uses `platform::{enable, disable}`, `hook_report` uses `asi::status_text`. +- [x] **14 COM helpers.** `games/anomaly/src/com.rs` is the one retain/release (sr_d3d11, motion device, FG inputs, and the overlay's vtable Release, a fourth copy). **15 D3DCompile.** `rsf_shader_compiler::compile_system_checked` returns the bytecode or the reason; all eight sites use it (three production shaders, two fixtures, three examples). +- [x] **17 Geometry and hook mirrors.** `native_geometry_abi.rs` and `native_hooks.rs` use the `crate::sys` records (already generated through `motion_stage_platform.h`; `build.rs` now lists the three headers). C fills every function entry, so Rust unwraps them and the fakes wrap theirs in `Some`. The layout asserts that only guarded the mirrors are gone on both sides; the matrix, hook-set and guard-image ones stay (the matrices are read as arrays, the set as one pointer, and `engine_guards::Image` is still a Rust record). +- [x] **18** `Startup::Legacy` is gone; the runtime fixture binds `Startup` with a fake `start_backend` and an admission stub. **19** the unread `Targets` fields are gone. **22** the overlay fixture uses `wide_os`. + +Kept-reason corrections: round 2 Fallout 4 (the MinHook constants), round 2 Anomaly (`Startup::Legacy`, `rsf_sr_texture`), round 2 AC7 (`rsf_ac7_view_remove_jitter`, `rsf_ac7_velocity_shader_seen`), round 5 (`no_mangle` kept for test builds; the overlay fixture's `wide`), GM-G1.2, GM-G2, GM-G6, GM-G8.4. Seen and left: `motion-device-fixture` alone does not compile (`motion/device_fixture/draw.rs` imports the `sr-fixtures`-only `sr_fixture_readback`); CMake enables both. + +### Simplify pass: simp-tests-a + +Area: `tests/{presentation,game-sdk,generation,capture,ac7-capture,support}`. Checked with `cargo clippy` (and `fmt --check`) of `rsf-presentation-fixtures` (`ac7-render-scope`, `d3d11-host-device-fixtures`, `gl-device-fixture`), `rsf-presentation-api-fixtures`, `rsf-game-sdk-fixtures` (every fixture feature), `rsf-generation-fixtures`, `rsf-capture-fixtures` (every feature), `rsf-ac7-capture-fixture` and `rsf-test-support`; no fixture ran. The header edits (`device_fixture_bridge.h` deleted, the FG half of `present_fixture_loops.h` removed) are unchecked until the CMake verification, though no C or C++ file named the removed declarations. + +- **tests/support.** Owns the four helpers the fixtures kept re-writing: `d3d12::wait_for_signal` (signal, event, wait), `d3d12::debug_messages`/`validation_errors` (the info queue read), `hardware_adapter` (first hardware adapter of a vendor) and `d3d12::device_and_queue`. **Left:** the D3D11 info-queue reads (`finish_device`, capture `debug_messages`) read a different interface; a second shared copy would have two users. +- **tests/presentation.** The FG and D3D11 presentation fixtures called each other's helpers through `no_mangle extern "C"` functions with out-parameters, `i32` status codes and `void*` round trips (`rsf_fg_fixture_inputs`, `State`, the focus lease, a CreateEvent per drain). They are typed Rust now: `Inputs`, `Submission`, `Loop`, `Flip` and an owned `Focus` replace the C structs, `Option`/`bool` replace the codes, `wait_for_signal` replaces the event, `adapter` goes through `hardware_adapter`, the debug layer and validation reads through support. `fixture_device.rs` and `device_fixture_bridge.h` are gone; only the entry points the C launchers call stay in `present_fixture_loops.h`. The GL fixture's readback and debug layer use support. **Left:** the callbacks the provider receives as C pointers (`prepare_callback`, `latency_callback`, `retire_callback` still take `user` as `void*`), the `PROCESS_STATE`/`atexit` release (the provider can hold the state past a failed GPU retirement), the ANSI window class with its own `DefWindowProcA` procedure in `d3d11_fixture_startup.rs` (support's is the wide one), and the D3D11 loop and marker/scope fixtures, whose records are filled by the C launcher through `rsf_ac7_loop` and `rsf_d3d11_marker_fixture_calls`. +- **tests/game-sdk.** `d3d11_host.rs` tables ten repeated "short struct, then newer ABI" refusals into `refuses_malformed!`; the plugin entry handshake the contract and Anomaly tests both spelled out is `plugin_api()`; `vk_streamline`, `render_host_fixtures/window` and `unity_sr_d3d12/rdr2` read the clock through `qpc()`; `unity_sr_d3d12/gpu.rs` uses support for the debug layer, vendor adapter, validation read and fence wait. The windows-sys `Performance` feature the fixtures no longer use is dropped. **Left:** `reservation_cases.rs`, `cpu_events.rs` and `vk_streamline_cases.rs` (each line is one step of a stateful scenario whose later steps depend on the earlier ones), `vk_amd.rs` and the `Gate` it shares, `session.rs`. `input_receipts.rs` carries an `SPDX-License-Identifier: GPL-3.0-only` header in an MIT tree; not changed here, needs a ruling. +- **tests/generation.** `device.rs` loses its own adapter lookup, `drain` and `device_and_queue` (support has them); `provider.rs` reads the info queue and enables the debug layer through support. **Left:** `dll.rs`'s `RawTable` and the presentation API fixture's are the same refusal shape over two table sizes; one generic type in support would have two users, so both stay. +- **tests/capture, tests/ac7-capture.** The texture dump fixture builds its 11_0 device and textures through `device::Device` (it had both helpers); the D3D12 dump uses `wait_for_signal` and `validation_errors`; the D3D11 dump reads the clock through `qpc()`; the windows-sys `Performance` feature is dropped. **Left:** `warp.rs`, whose swap chain and WIC readers differ from the capture crate's. The Vulkan fixtures were not read (see the last bullet). +- **Zeroed C records.** About eighty `unsafe { std::mem::zeroed() }` in the presentation, game-sdk, generation and AC7 capture fixtures are `Default::default()` (the bindings derive it); records filled field by field are built in one literal, and `struct_size: size_of_val(&x)` reads of the record being built became `size_of::()`. The line count grows by about fifty because the literals are formatted one field per line; the `unsafe` and its comments are gone. `SYSTEM_INFO` and const contexts keep `zeroed()`. +- **Second read (the files skipped above).** `reservation_cases`/`reservation` take `accept()` and `aborted()` helpers for the 41 plain keyed sends and the abort-reason checks; `vk_streamline_cases` and `vk_amd` share one `present()`; the Vulkan CPU fixture queue derives `Default` (`invalid`/`stalled` replace the `valid`/`ready` flags that needed a hand-written default); `domains` asks one `exports()`; `d3d11_scope_fixture` copies passes with `*source`; a doc comment in `unity_sr_d3d12/math.rs` that held a literal `\n` is two lines. **Left:** `cpu_events` and `vk_streamline_cases` (each step reads the previous one's state, and `delivered.stage()` already carries the repetition), `vulkan.rs`/`vulkan_cpu.rs` (one scenario each over distinct call-contract counters), `metadata.rs` and `d3d11/record.rs` (not opened), `plugin_session_fixture` (`valid_args` demands an exact size and ABI version, unlike `ffi_util::has_capacity`), `unity_sr_d3d12/streamline.rs` and `d3d11_marker` (layout evidence and the C launcher's callback table). + +### Simplify pass: simp-tests-b + +Area: `tests/{vulkan-fg,loader,overlay*,process,translucency}`, the top-level `tests/*.rs`, `*.c`, `*.cmake` and `CMakeLists.txt`. Checked with `cargo check` (`rsf-orchestrator --features test-fixtures`, `rsf-ac7-plugin --features warp-fixture`, `rsf-loader-fixtures`, `rsf-vulkan-fg-fixtures` with its features, `rsf-process-fixtures`); the CMake and C edits are unchecked until the CMake verification. + +- **tests/loader.** `windows.rs` owns one typed `cast`/`export` resolver; `forwarding` and `thin` used it in place of ten hand transmutes. The vulkan and ffx census modes call `payload_mode` directly instead of through two wrappers; the functional poll uses `Checks::counters`; `dllmain` uses `exe_name`. **Left:** the per-vendor record assertions in `census_modes`/`functional` (each is a distinct captured field), the vendor layout tables (research evidence), the opt-in `census_present` desktop fixture. +- **tests/vulkan-fg.** `lib.rs` loses a `cfg(any(..))` the next line made dead; the validation-layer name uses `ffi_util::wide`. **Left:** the two proc-address trampolines and `memory_index` copies, because the `xess-device`, `xess-sr` and `xess-input-range` features compile separately and sharing them would need a fourth module every feature pulls in; `wsi_abi.rs` (committed bindgen output, its header needs the Vulkan SDK). +- **tests/vulkan_gpu.rs, sharpening_vulkan.rs, native_sr_vulkan.rs.** The two `Gpu` fixtures shared the image allocation, layout barrier, clear and the two 15-line proc-address transmutes; `vulkan_gpu` owns them (`create_image`, `transition`, `fill`, `procs`) and the types keep thin wrappers so no call site changed. **Left:** the two `Gpu` structs themselves (queue, pool, fence and buffer setup differ, and `native_sr_fsr4_vulkan` reaches into the fields). +- **tests/ac7_native_graph.rs, auxiliary_sr.rs.** The hand-rolled staging readbacks use `rsf_test_support::device::Device::read`; the AC7 fixture reads engine memory through one typed `get` beside `put`. **Left:** `ac7_velocity_warp::Warp::read`, which reads one texel of a texture whose row is wider than `T`, not the whole surface `Device::read` returns. +- **tests/CMakeLists.txt, anomaly_support.cmake.** The six plugin-contract tests go through `rsf_add_plugin_contract`, the six census modes through `rsf_census_test`, and ten Anomaly and latency fixtures through `rsf_add_fixture_test`; the SR5 client loop that branched on its own name is two plain blocks. +- **tests/engine_sharpening.rs.** Four size/offset asserts the generated `engine_sharpening_abi.rs` already makes are gone. +- **Read and left unchanged.** `tests/overlay*`, `tests/translucency`, the process binaries, `sharpening.rs`, `ac7_velocity_warp.rs`, `sharpening_vulkan_cpu.rs` (first 560 lines) and `overlay-service/contract.rs`: each case asserts a distinct contract, and the repeated shapes are test-local fakes or generated bindings. +- **Second round (C, Python, remaining Rust).** `anomaly_geometry_hooks.c` states each coverage-cell difference once (`cell_delta`); `anomaly_geometry_tests.c` drops the one-field `scope`, `view_scope` and `identities` wrappers; `vendor_census_native.c`'s fake `ID3D12Resource` stubs lose their per-function unused-parameter casts and its check-then-return pairs become `REQUIRE`; `d3d11_observer.c` finds shaders and layouts through `find_shader`/`find_layout` (the most recent record for an address, so a recycled address names its newest object). `d3d11_host_device_launch.h` now owns the host setup, services, swap-chain descriptor and resource lease the two device launchers spelled out. The foliage shader tests open their local staging folder through one `staged()` helper and the Anomaly package tests build their temp zip through one `bundle()` helper. `census_warp`, `census_creation` and `census_modes` use the loader `cast`; `sr_backend_switch_device` checks each frame result once. C was checked with `cl /Zs /W4` (syntax only) and Python with `unittest` on the two files it touched. **Left:** the `OuterChain` forwarding thunks and manual hardware flow of `d3d11_host_rendered_fg_device.c`, the layout fact tables (research evidence), the ABI offset pins in `sharpening_settings_native.c`, and the WARP fixtures whose helpers read a different slice of the surface than `Device::read` (`ac7_velocity_warp`, `motion_resolve`, `motion_decode`). +- **Read in full this round (before the bullet above).** `anomaly_geometry_hooks.c`, `anomaly_geometry_tests.c`, `vendor_census_native.c`, `d3d11_observer.c`, `d3d11_host_rendered_fg_device.c`, `d3d11_host_shared_sr_device.c`, `d3d11_host_device_launch.h`, `d3d11_present_bridge.c`, `d3d12_observer.c`, `module_dump_self.c`, `module_dump_entropy.c`, `fg12_abi.c`, `sr12_abi.c`, `sharpening_settings_native.c`, `anomaly_{motion,sr}_hook*.c`, `anomaly_{overlay,input}_hooks.c`, `ac7_render_scope.c`, `rdr2_capture_ngx.c`, `vendor_layout_facts.{c,cpp}`, `dlss_sr_layout_facts.cpp`, all Python tests, `sr_backend_switch_device.rs`, `anomaly_sr_jitter_fixture.rs`, `sharpening_d3d12.rs`, `sharpening_settings.rs`, `depth_scale.rs`, `fullscreen_pass.rs`, `exposure_normalization.rs`, `colour_transport.rs`, `sampler_bias.rs`, `motion_decode.rs`, `motion_resolve.rs`, `godot_graph_handoff.rs`, `native_sr_vulkan_capture.rs`, and the loader's `census_*`, `vendor_census_fixture*` and `vendor_census_asi` modules. +- **Also read, no change.** `native_reinsert.rs`, `d3d11_state.rs`, `ac7_view_fixture.rs`, `ac7_view_probe.rs`, `ac7_session.rs`, `ac7_graph_replay.rs`, `ac7_render_scope.rs`, `ac7_velocity_shader_fixture.rs`, `overlay_panel_fixture.rs`, `sharpening_vulkan_cpu.rs`, `overlay-service/src/{lib,device/native}.rs` (`lib.rs` now uses windows-sys for the profile calls instead of two hand-declared kernel32 imports; its crate gains that dependency) and the C and C++ launchers under 60 lines (`vendor_census_ngx_platform.cpp` states its 17 overload-slot checks through one lambda). Repeats left alone on purpose: the foreign-exception raiser in `ac7_render_scope.c` and `plugin_session_fixture_throw.c`, the `Command`/`List` queue records in `ac7_render_scope.rs` and `ac7_native_graph.rs` (separate crates), the three `RSF_NOINLINE` macros. + +### Simplify pass: simp-integrations + +Source: a /simplify pass over `integrations/**`. Checked with `cargo check -p rsf-unity -p rsf-godot -p rsf-steam -p rsf-windows` (lib, `--tests`, and `rsf-unity --features mono-plugin`) only; nothing was built or run beyond that. + +- **sdk/game (forced by the integrations).** `ffi_util::lock_or_recover` is the one poison-tolerant `Mutex` lock. Sixty-odd `lock().unwrap_or_else(PoisonError::into_inner)` sites and three private wrappers in the Unity, Godot, Steam and Windows crates call it. **Left:** the same pattern in the other areas (`games/**`, `runtime/**`, `loader/**`), which can switch to it. +- **integrations/unity.** One `bridge_state::build_cpu_event` builds the CPU events the D3D12 message hook, the stage reports and the package's received input each filled field by field. The package's Rust-defined leaves (view creation, sharpening validity and defaults, texture description, Auto's generation provider, bridge load/open/close/retire, Editor preview prepare/present) return `Option`, `bool` and tuples instead of the retired `package.c`'s 0/1 words and result pointers; the test fakes follow. The module-path reads use `win32::module_path(_in)`, the CPU-fact size check uses `ffi_util::checked`, zeroed records use `Default`, and `RSF_SCREEN_FLIGHT` is the generated constant. **Left:** the `Leaves`/`raw` seam (the tests bind fakes through it); `const` zeroed records (`Default` is not const); the `*_state.rs` admission and retirement state, which is the lifetime logic that fixed real bugs. +- **integrations/godot native.** `Platform` leaves no longer return `Option`/`bool` for a refusal the Rust leaves cannot produce (`prepare_capture`, `capture_sr_begin`, `final_scene`, `render_begin`, `d3d12_release`, `sr_evaluate`, the Vulkan SR create/plan/log/dump leaves), `vulkan_sr_record` returns the provider result instead of writing through a pointer, and the `VK_THROWS`, `CAPTURE_SR_BEGIN` and `RENDER_BEGIN` fake switches and the tests that only covered those paths are gone. `empty_pass`, `empty_frame_record` and the local size-prefix read are `Default` and `ffi_util::checked`. Comments that named `runtime.cpp` and `vulkan.cpp` as the former owners were rewritten. The `SR_*`, `FG_*`, `REFLEX_*`, `UI_MODE_*` and `FG_STAT_*` copies in `control.rs`, `d3d12.rs`, `vulkan.rs` and `vulkan/sr.rs` are the `RSF_*` constants rsf-game-sys already binds from `sr_session.h`, `frame_generation.h` and `backend.h`, and the effect leaves (`leaf_frame`, `leaf_resources`, `leaf_read_motion`) and the Vulkan `adapter` leaf return their value instead of writing through a pointer. **Left:** the rest of `VkCreationLeaves` (`platform/vulkan_negotiation.rs`) and `creation/typed.rs`: the table is a test seam with its own fakes, and `xess_features` and `latency_requirements` refuse for real when a chain copy fails. `DLSS_ENGINE_CUSTOM` and the quality and generated-frame caps stay hand-written: the first is a cast macro bindgen does not emit, the others are this integration's policy limits. +- **integrations/godot modules.** Not changed. The module is built by SCons without Cargo, so it cannot call `rsf-game-sys`; `frame_abi.rs`, `frame_event_abi.rs` and `packet_abi.rs` are committed bindgen output and keep their layout asserts. +- **integrations/steam.** The relay-site and Present-entry hook creation is one loop with the targets filled once, and the saved-method read is `win32::read`. **Left:** the six near-identical forwarders; a macro would not make them shorter than their signatures. +- **Tests.** Read every test module of the area (`unity/src/**` `mod tests`, `godot/native/**/tests.rs`, `platform/fake.rs`). Besides the tests of the removed refusal paths, `zeroed()` fixtures became `Default`. **Left:** the call-transcript tests of `package_state.rs`, `bridge_state.rs` and `vulkan_state.rs` and the 888-line `creation/tests.rs`: each asserts shipped lifetime, admission or negotiation behaviour, and the fakes mirror the production leaf signatures the seams require. +- **integrations/windows.** Only the lock helper. **Left:** `minhook::enable` and `remove` (XInput only) differ from the public idempotent calls on purpose. + +### Simplify pass: simp-shared + +Area: `loader/**` except `loader/proxy`, `runtime/{graphics,presentation,shader_patch,common}`, `sdk/game` internals, `ui/overlay`, `third_party`, `tools`, `eng`, `cmake`. Checked with `cargo check` (lib and `--tests`) of `rsf-loader`, `rescaleframe-overlay`, `rsf-game-sys` and `rsf-graphics`; nothing was built through CMake or run. + +- **loader/src/census.** One `Call` lease, one `Ids` table and one `forward8` forwarder (in `session.rs`/`census.rs`) replace the per-family copies in d3d, vulkan, fsr, misc and ngx; the raw begin/finish are private to the session. vulkan's own `read`/`number`/`word`, fsr's `sdk_desc` and d3d's typed `read` are `memory::{read, read_as, u32_at, u64_at}`; the two GUID formatters are `Json::guid`. The per-module extension traits are inherent impls, record/identity/decode/hooks write through `Json` instead of raw `rsf_census_json_*` calls, and the `*_counts` out-parameters between Rust functions return tuples. **Left:** the per-wrapper bodies in `d3d.rs` and `vulkan.rs` (each differs in its argument JSON and result handling), `vendor.rs` bind tables, the `static_scan.rs` needle table. +- **loader/src/diagnostics.** Module leaf, module base and elapsed time each have one helper. **Left:** `image.rs`/`rtti.rs`/`sections.rs` themselves; they are the dump format, and the `read` here returns the copied count that `rsf_game_sys::win32::read_process` does not. +- **loader/src/windows.** Read in full, nothing to remove: the carriers share `windows.rs` already, and `shim.rs`/`plugin.rs` differ in policy. +- **ui/overlay.** `Mark::of`, `option_stepper`/`option_label`, `name_of` and one `format_rate` replace the repeated chosen/pending nesting, the identical host and saved number steppers, two table lookups and two rate formatters; `Quality::from_abi`, `Tab::index` and `UiPreferences::to_bits` derive from their `ALL` tables or discriminants. `ffi.rs` uses `ffi_util::has_capacity` (now an unaligned read of the size word) instead of its own `fits`. **Left:** `encode_intent`/`borrow_stats` (field-for-field ABI maps), the `Controls` rectangles (tests tap them), the unused header fields kept for older hosts. +- **sdk/game.** `frame_policy`, `call_header` and `Probe::from_raw` use `ffi_util::checked`/`has_capacity`; the `allow(dead_code)` on the public `Pe32Plus` is gone. **Left:** `xm.rs` (a line-by-line SSE transcription, bit-exact on purpose), `shader_hash`, `camera_math::InversePolicy` (both policies have callers). +- **runtime/graphics.** Comments that narrated the C++ the code replaced were rewritten. `frame_tap`: the `views`/`map`/`unmap` forwarders and the install-side export forwarders are gone (the `rsf_core_*` function is the detour or the export), `game_call` is the one admit-and-not-nested test, `record_constants` serves the vertex and pixel recorders, and the platform leaves return `bool`, a tuple or the facts record instead of 0/1 codes and out-pointers. **Left:** the admission gate, retirement and reentry logic (they fix real races described in the file) and the per-slot COM leaves. +- **runtime/common.** **Left:** `hash_file` still has its own BCrypt code instead of `rsf_windows::sha256_file`. It is not CMake wiring alone: the C callers pass a sharing mask (`dinput8_proxy.c` opens `FILE_SHARE_READ` only so the checked file cannot change), `rsf-windows` would have to depend on `rsf-runtime-common` (or the reverse) and carry the C exports in a second archive, and `rsf-runtime-common` is linked by about fifteen targets that do not link `minhook`, which `rsf-windows` needs. That is a link change to verify through CMake. +- **tools.** `tools/dump/rsf_dump_plan.py` is the one planner; `apply_ida.py` and `apply_ghidra.py` keep only their database backends and put their own directory on `sys.path` before importing it (checked with `--self-test` outside IDA and Ghidra; the import path inside them is untested). `tools/anomaly_corpus.py` holds `Refusal`, `digest`, `tree` and `corpus_hash` for the core, foliage and motion-deploy tools, and the three tests that load them put `tools/` on the path (the fixtures need the licensed corpus and skip without it). **Left:** the RDR2, Godot and view-layout analysers (single-purpose evidence readers) and `package-release.py`/`package_common.py`. +- **eng, cmake.** `eng/common.ps1` has `Invoke-Checked` (three copies) and `Get-RsfVendorPayload`, the one Streamline, FidelityFX and XeSS runtime and notice list that `build-godot`, `build-unity-package`, `deploy-unity-sr` and `package-unity-sr` each typed out (`deploy-unity-sr` now also deploys the Anti-Lag notice the package manifest already expected). `Invoke-RsfInteropFixture` in `godot-process-isolation.ps1` is the layer environment, lease and owned process the FSR4 and XeSS FG interop scripts repeated, and `build-godot` checks its FSR receipt from a field-to-file table. `cmake/rust_static.cmake` has one `rsf_serialize_rust_build`. All `eng` scripts parse; none was run. **Left:** `test-godot.ps1`, `test-godot-visual.ps1`, `test-godot-vulkan-matrix.ps1`, `test-godot-sync-isolation.ps1` and `capture-godot.ps1` (each branch guards a recorded fixture, and every `capture-godot` option is read by `visual.gd`), `patch-godot.py` (the `previous_*_plan` chain recognises earlier patched engine trees), `deploy-ac7-*` (different file names and a subset of the payload) and every `RSF_*_INCLUDE`/`RSF_HAVE_*` switch in `vendor.cmake` (all read). + +### Simplify pass: simp-games-b + +Area: `games/{fallout4,skyrim-se,rdr2,project-wingman,minecraft,unity-mono}`. Checked with `cargo check` (lib and `--tests`) of `rsf-fallout4`, `rsf-skyrim-se` (also `--features fixtures`), `rsf-rdr2` (default, `research`, `--all-features`, `--tests`), `rsf-project-wingman`, `rsf-unity-mono` and `rsf-minecraft`; nothing was built through CMake, the Java sources were not compiled and no test ran. A second round read fallout4 `cpu_events.rs`, `render_inputs.rs` and `depth_domains.rs` in full and the larger Minecraft Java files (`NativeRenderer`, `FlywheelShaders`, `MotionProgram`); the Skyrim camera, postprocess and presentation modules and the other Java files were read only in part or searched. + +- **sdk/game (forced by the games).** `windows_path::leaf_is` (the executable-leaf comparison; fallout4, skyrim-se, project-wingman and rdr2 each had a copy), `win32::pin_module` (the `FROM_ADDRESS | PIN` module pin that fallout4, skyrim-se and project-wingman each wrote), `Plain` for `[u16; N]` and `[u32; N]`, and `ffi_util::lock_or_recover` (the same text as the simp-integrations helper). +- **fallout4.** `admit_build` and `Session::create_host` read the module path through `win32::module_path` (no 32k stack buffer) and use `leaf_is`; the creation, DPI and CPU-event logs call `host_log` instead of building a `CString`. Comments that said what camera.cpp, the C++ scope guards or the noexcept boundary used to do state the behaviour. Second round: `cpu_events.rs` returns `reserve_worker_poll` and `exchange_peek` results as tuples instead of writing through `&mut`, `WorkerTicket::refuse_changed` replaces seven compare-then-refuse pairs, `begin_frame` and `pending_changed` replace two identical blocks each; `render_inputs.rs` shares `same_devices`, `swap_matches` and `slot_maps` between `read_inputs` and `read_raster`; `depth_domains.rs` shares `read_renderer` and `read_depth_keys` between `sample` and `raster_owner`; the all-zero `EMPTY` snapshot, failure, domain, camera, raster and receipt records are `zeroed()`/`Default` (about 120 lines of literals). **Left:** the render-hook `Leaves` tables (`render_hooks.c` fills them), the `message()` helper they still need (the leaves take a `CStr`), the `Threw` plumbing around the guarded lifecycle calls, the `&mut` readers that report the failing `Stage` (`sample`, `raster_owner`, `producer_raster`, `state`, `owner`: a refusal receipt prints the fields written before the failing read, so returning a value would change the receipts), `camera::camera_frame` (the refused pass is printed with its partial camera), `camera::store` (about thirty callers), `native_cycle` and `worker_consumer_proof` (their proof and trace are written as they run for the same reason), and the receipt bookkeeping in `cpu_events.rs`, which `engine.json` names as the pending attribution of the CPU refusal. +- **skyrim-se.** The module path, digest and executable name use `win32::module_path`, `rsf_windows::sha256_file_hex` and `leaf_is` (the Platform hex loop and its 32k buffers are gone); `taa.rs` imports `WriteProcessMemory` from `windows-sys` instead of declaring kernel32; `Platform::read_u32/read_usize` are `win32::read`; `cpu_events`, `observers` and `Platform::log_text` log through `host_log` (the observers' log fake nothing read is gone); the Community Shaders probe builds its path with `wide_path`. Second round: `platform::get()` is gone. `Platform` is a unit struct again and the calls that reach the game image or MinHook (`main_module`, `pin_module`, `hook_create/enable/disable`) have inert `cfg(test)` twins, so tests still never touch the game; the roughly thirty `let Some(platform) = get() else` sites use `&Platform`. The 41 Rust-only functions named `rsf_skyrim_*` (no export, no C caller) have plain names; the `extern` ones keep theirs. **Left:** the `sources_*` wrappers that scope the store lock. +- **rdr2.** `platform::read_value`/`read_bytes`, the capture owner's `Native::read` and the NGX camera copy are `win32::read`/`read_bytes`; `append_path` is `ffi_util::wide_path`, as are the ASI deployment and trace paths; `asi::is_game` and `layout::EXECUTABLE` are `leaf_is` over `EXECUTABLE_NAME`; `platform::lock` is the shared lock. **Left:** the MinHook calls in `platform.rs` (they need `rsf-windows`, a new dependency), `native_platform::module_path` (it accepts a truncated 260-unit path, `module_path_in` refuses one), `RESEARCH-HANDOFF.md` and `NATIVE-OPTIONS-RESEARCH.md` (research evidence). +- **project-wingman.** `Command::acquire` allocates through `ffi_util::try_box`, the observation log goes through `host_log`, the executable and pin checks are the shared helpers. **Left:** `camera::read` (its `Copy` bound reads `[i32; 4]` and structs that `Plain` does not cover). +- **unity-mono.** `fingerprint()` and `helper_path()` use `win32::module_path` and `sha256_file_hex`; a test name that cited the C++ mask was renamed. **Left:** everything else; the module is already thin over `rsf-unity`. +- **minecraft.** The unused `NativeBridge.status` JNI entry (only a test called it; `statusCount` writes the same array) is gone from Java, `jni.def`, `jni.rs` and NATIVE.md, and `open`/`openSettings` share `string_units`. `TaaSettings.SharpeningState` (record, `matches`, `sharpeningState()`; only `SodiumConfigTest` read them) is gone and the test compares `sharpening()`; the Java was not compiled. **Left:** the generated `status.rs` (it also emits three unread getters), `TemporalCamera.skyDirection` (read only by `TemporalGpuTest`, whose oracle it is), and the Java renderer and its GPU tests. `MotionProgram.bind` copies every uniform of the replayed program on each bind (a `glGetUniform` and `glUniform` per uniform); caching it would change a runtime path that only a GPU run can check. +- **Mutex locks.** Sixty-odd `lock().unwrap_or_else(PoisonError::into_inner)` sites in these crates call `lock_or_recover` (RDR2's `platform::lock` is an alias). The line saving is small because rustfmt had already kept the one-line forms. + +### Simplify pass: simp-orch-sr-misc + +Code-quality pass over the D3D11 SR pipeline, Streamline, native SR, auxiliary SR, shader patch, colour, depth, motion, fullscreen and sharpening modules and the rest of `runtime/orchestrator/src` outside the other workers' prefixes, plus its C leaves, headers, `build.rs` and `CMakeLists.txt`. Checked with `cargo check -p rsf-orchestrator --tests` and `--features test-fixtures`; nothing was run. About 300 lines net removed. + +- `dlss_pipeline`, `dlss_pipeline_abi`: the private `rsf_dlssp_sharpen_frame` (five fields re-copied by the leaf into `rsf_sharpen11_frame`) and the second log alias `rsf_dlssp_log_fn` are gone; the pipeline builds the bindgen frame. The three decode-pass releases are `Owned::release_decode`; a duplicated motion-scale test and two redundant `dead_code` allows are gone. Kept: the leaf/fake split, the failure give-up counters, the dump tables and the double raw/preview failure lines of `write_dump` (log output). +- `dlss_streamline`: `Features::bits` and the `OPTIMAL`/`OPTIONS` bitmask are `Features::complete`; plan and evaluate read the `Option` once (their `FEATURE_FAILED` branch after the bit filter was unreachable). `rsf_dlss_native_present`, `_plan_render_size` and `_release_viewport` were Rust-only forwarders; the core functions carry those names (`d3d11_host_platform.rs` import touched). Kept: the shared/owned route split and the shutdown-failure latch. +- `streamline_host`, `streamline_host/generation`: `repr(C)` and the size/offset asserts on the Rust-only `Platform`, `Startup`, `CommonPresent`, `InitPreferences`, `Reflex`, `Request` and `Observed` are gone, with Request's stale `dead_code` allow. Kept: the tables themselves (the tests substitute them) and their `extern "C"` leaf signatures (about 80 functions; a Rust-ABI retype is churn with no function). +- `dlss_vulkan_capture`, `leaves`: `BGRA8` and the three `VkResult` literals come from `ash`, so the literal-against-ash asserts are gone except `vk::Image` as `u64`; `Platform`/`Target` lost `repr(C)`; the packet check is `has_capacity`. Kept: the 24-entry table (the DLSS-G fixture copies it) and the JSONL traces. +- `native_regions`, `native_translucency`, `native_reinsert`, `native_sr`: `device_identity` was a raw-QueryInterface copy of `d3d11_device_identity::identity`; translucency's `texture` copied `output_texture`; reinsert's `Rect` and native SR's `extent` copied `Region::new`. The translucency ledger's `generation` counter (read only by a test) is gone and the mask handover is one assignment. Kept: every depth-domain and projection check (game input). +- `native_window`, `native_scene`, `native_composition`, `native_sr_state`, `render_links`, `frame_sequencer`: a private `has_capacity` copy and seven hand-written size-prefix checks use `ffi_util::has_capacity`; `native_window` calls `native_scene::find_window` instead of the out-parameter export. Kept: `rsf_native_scene_for_window`/`_classify_present` (`native_scene.h` and the FG leaf table). +- `graphics_d3d11`, `motion_decode`, `motion_resolve`: `describe_source`, `context_matches`, both `dispatch` helpers and both `make_resources` return `Option`/`bool`/`Result` instead of 1/0 codes, out-parameters and raw arrays readopted by `adopt_all`; `SourceInfo` lost `repr(C)`. The public `rsf_motion_*` entries keep their codes. +- `depth_scale/d3d11`, `fullscreen_pass`: pipelines are built with `IUnknown::from` instead of `into_raw` plus `adopt_all`; `fullscreen_pass::create` is inlined into its export. +- `shader_patch`: SHA-256 uses the `BCRYPT_SHA256_ALG_HANDLE` pseudo-handle instead of opening a provider per hash; reflection `compare` no longer clones bindings. Skipped: `rsf_windows::sha256_hex` (adding rsf-windows to the orchestrator archive risks a second `rsf_win32_input_kind` in binaries that link both), and replacing the reflection callback sink with a returned record (the test fakes drive it). +- `auxiliary_sr`: `new` returns the owner, not an always-`Some` `Option` (`d3d11_host_platform.rs` and `tests/auxiliary_sr.rs` touched). Kept: the `Products` trait (item 13, d3d11_host_reduced owner). +- `shared_surface`: `Platform` lost `repr(C)` and its assert. Kept: the `SurfaceSetup` mirror of `shared_surface.h` (binding that header needs a `build.rs` change that only the CMake run would verify). +- `diagnostic_output`, `streamline_log`, `sampler_bias`: `crate::sync` locks replace hand-written poison handling; a redundant rebinding is gone. +- `CMakeLists.txt`: comments only (a misplaced object-library note, one glued to `endif()`, one port narration). `build.rs`, `rust_exports.c` and the other C leaves: reviewed, no change. +- Reviewed without cuts: `native_cpu`, `cpu_reservations`, `input_receipts`, `colour_d3d11`, `dlss_native12` (the `fetch_update` deprecation stays: `try_update` may postdate the workspace MSRV), `streamline_sdk`, `streamline_sr`, `sdk_module`, `native_exposure`, `frame_assembly`, `frame_limit`, `capture_metadata`, `sharpening_policy`, `present_rates`, `lib.rs`. + +### Simplify pass: simp-orch-d3d11 + +Area: `runtime/orchestrator/src` `d3d11_*`, `render_host*`, `callback_host*`, `plugin_session*`, `overlay_*`, `settings_store`, `input_dump*` and their submodules, plus the `lib.rs` helpers they use. Checked with `cargo check -p rsf-orchestrator` (lib and `--tests`) only; nothing was built, run or tested. Net 32 files, +354/-742. + +- **Cross-cutting.** Size-prefix admission at the untrusted entries (D3D11 host, render host, callback host, overlay service, settings store, input dump, plugin session, SR admission) calls `ffi_util::has_capacity`/`checked`; the local `prefix_size`, `fits` and open-coded `cast::().read()` checks are gone, order unchanged. The overlay stats clock is `now_qpc` plus a new `qpc_frequency`; SR/FG reason text goes through one bounded `write_c_text`. Typed COM references convert to `IUnknown` with `Into` instead of `into_raw` plus `com_ref::owned`. **Left:** the D3D11 host's legacy setup prefix (it accepts two sizes); a nullable `raw(Option<&IUnknown>)` helper, which belongs in `rsf-graphics` `com_ref` (another area), so the per-module copies stay. +- **d3d11_present (owner, gpu, device, native).** `retire_owner`'s two refusal paths share `retain_shared_inputs`; `Lease::host`/`Lease::entry` replace the repeated host-or-OK and provider-entry matches in the latency entries; one `streamline_explicit` flag replaces two read together; `facts()` is zeroed. The gpu/device leaves use `d3d11_d3d12::{borrow, close_event, execute, create_commands}` instead of their copies (`rsf_d3d11p_gpu_create_slot` is gone). **Left:** the HRESULT-returning queue leaves (their codes reach the failure log and the application), `create_render_buffer` (its HRESULT reaches `ResizeBuffers`), `rsf_core_d3d11p_dispatch_owned`'s function parameters and `dispatch_result_slot` (the tests drive them), the post-switch receipts, and `d3d11_present_api.c` (the table mixes the C `create_for_hwnd` with Rust exports; moving it needs a bindgen listing). +- **d3d11_host, d3d11_host_reduced.** Only the shared prefix checks and reason copy. **Left:** the `Products` trait (item 13), `prepare_pipeline`'s four reconfigure steps (each has its own side effects), the rate-limited logs. +- **d3d11_observer_*.** `probe::run` returns `Option`; `Description` and `Tables` lose `repr(C)` and their asserts (only `Attempt` crosses into C); `resolve_context` calls `GetImmediateContext` instead of taking it as a function pointer. **Left:** the `Platform` table read from C, the detour route and trampoline builder. +- **d3d11_output, d3d11_sharpening, d3d11_sr_admission.** `FullscreenBlit` holds its copy mode instead of three function pointers that only ever held the copy pass. **Left:** the layout asserts in `d3d11_host_abi.rs` (public ABI evidence). +- **render_host, callback_host, plugin_session.** Prefix checks, clock and reason copy only. **Left:** the `leaf` lists (both hosts' unit tests fake them) and item 16's per-test `World` fakes. +- **overlay_*.** `overlay_native12`'s present fails once from `record_frame` instead of at eleven exits; `overlay_visibility`'s `Apply`, `overlay_cursor_capture`'s `Show`, `fill_latency_stats`'s two getters and `overlay_window`'s logger `invoke` were parameters every caller filled with the same function and are direct calls (`overlay_input::invoke_log` is gone); the panel exports use `win32::typed_export`; the D3D11On12 transmute names its `CreateOn12` alias; `overlay_native12`'s `completed` is `d3d11_d3d12::fence_completed`. **Left:** the `overlay_native12`, `overlay_wrapped12`, `overlay_cursor_hooks` and `overlay_host` tables (tests bind other fakes), `overlay_pointer`'s `sample_cursor` parameter (its test passes `no_cursor`), the D3D11 state snapshot in `overlay_renderer11/platform.rs`. +- **input_dump, input_dump_vulkan.** `clock()`, `local_time()`, `open_texture` and `encode_texture` return their results; `Clock` keeps only the tick, process and key (the seven copied date fields are gone) and the internal records lose `repr(C)`. The Vulkan dump resolves its entry with `dx12_vulkan_platform::entry`. **Left:** `metadata.rs` (the bundle format) and the no-op `rsf_input_dump_gpu_*` exports (native callers). +- **settings_store.** `sharpening_options` is `checked` plus the version filter. **Left:** the CRT `wcstof`/`_swprintf_c` formatting (INI spellings) and the `fields!` table. +- **Also read, no change.** `overlay_saved`, `overlay_geometry`, `overlay_input_route` (beyond the callback), `overlay_settings` (beyond the getters), `d3d11_device_identity`, `d3d11_observer_module`, `d3d11_observer_capture/dump.rs`, `render_host_native`, `d3d11_host_platform`, the C shims (`d3d11_host_foreign.*`, `render_host_platform.c`, `*_exports.c`) and the test modules (`d3d11_present_tests`, `d3d11_host_tests`, `overlay_host_tests`, `render_host/tests`, `callback_host/tests`), which only changed where a signature did. + +### Simplify pass: simp-ac7 + +Code-quality pass over `games/ac7` (both crates, C leaves, headers) and `loader/proxy`. Checked with `cargo check`/`clippy` of `rsf-ac7` (lib, `--tests`, `warp-fixture`, `view-fixtures`) and `rsf-ac7-plugin` (`--tests`, `warp-fixture`); the C edits are unchecked until the CMake verification. Forced edits outside the area: `tests/ac7_session.rs` (the scale fixture), `docs/research/rust-frame-tap-cutover.md` (the uninstall caller). + +- `carrier.rs`, `dinput8_proxy.c`, `ac7_carrier.h`: the separate translucency scale is computed by the Rust carrier from `RSF_TRANSLUCENCY_TARGET`/`RSF_TRANSLUCENCY_SCALE` and the depth-gate result and written as the immediate of the verified patch. The C slot, `set_separate_translucency_scale`, the `set_depth_conformed`/`register_translucency_scale` leaves (carrier ABI 4) and `rsf_ac7_carrier_translucency_scale` are gone; the render-percent parameter was always 100. Left: the startup option table, the auto-start and override exports the bridge calls. +- `dlss_bridge.c/.h`: `rsf_bridge_request_shutdown` had no caller, so `drain_shutdown` is gone; so is the unread `jitter_open` action. One native window match per Present; the Unreal motion decode constants are defined once for both proxy files. Left: the overlay intent handling and route dumps (evidence workflow). +- `native_renderer` (graph, translucency, views, frame, widgets, shaders, leaves, sky): one indexed-getter call and `input_pool` for graph inputs, `scene_targets()`, `cached_view()` over `rsf_ac7::view::decode`, one `object_is_a` class check, typed guarded reads in the shader factory hook, no saved-mode array in the visibility hook, plain casts in the detour table, and Rust ABI for the 35 leaves only Rust calls. Left: `hooked_engine_pacing`, a pure forwarder, because removing it changes the hook set the fixtures check; `render_screen`'s out-parameters, which the graph replay fixture's C ABI uses. +- `render_scope.rs`: `open_leased`/`scopes_idle` return `Option`/`bool`; the C entries keep their ABI. +- `velocity_pass_cache`, `velocity_device`, `velocity_renderer`: the builder returns `Built::{Slot, Refused, Retry}` (the round 2 "Not done" item) and the vertex hash travels in the variant. The release path is `warp-fixture` only, since its one C caller was the dead bridge drain. Left: the type-erased renderer lifetime, which the lifetime unit tests drive with fakes. +- `velocity_history`, `velocity_stream`, `velocity_commit`: `ViewAction`, `Retired` and `Route` enums and bool flags replace u32 codes. Left: the `allow(dead_code)` on records the D3D11 replay constructs, which non-Windows test hosts need. +- `velocity_tessellation`, `velocity_geometry`: two unused opcode constants. Left: the register out-parameters of the shader transforms, which the shader fixtures call. +- F9 capture (`motion_capture_*`, trampolines, `hook_batch.rs`, `ac7_hooks.c`): read and left; `reset_records` keeps clearing in place so the snapshot's returned capacities are reused, and the MinHook batch stays per GM-G8.1. Stale `scope_abi.rs`/`sites_abi.rs` comments in `ac7_scope_owner.h`/`ac7_sites.h` now name build.rs. +- Plugin unit tests (`tests.rs`, `lifecycle`, `patches`, `renderer`, `render_scope`, `sites`, `truesky`), read line by line: the lifecycle status returns its reason as `&CStr` (no `String` round trip), the patch and TrueSky image checks are one data-driven site list, the renderer fake has one scene-precision check, the render-scope tests share a counted lease builder and table their missing-owner refusals, and the TrueSky divisor refusals run as one loop. Every assertion is kept. Left: the scripted fakes (`Fake`, `Script`, `Image`) and the reason-text pins. + +### Simplify pass: simp-orch-vulkan + +Code-quality pass over the Vulkan orchestrator owners (`vulkan_*`, `dx12_vulkan*`, `fsr4_*`, `frame_capture_vk*`), `runtime/vulkan/**` and `runtime/backends/**`. Behaviour is unchanged; checked with `cargo check` (lib and tests, default and all features, plus `fixture-leaves`), not run. + +- `vulkan_fg_frames`: the frame-slot ledger (`FrameSlot`, `Timeline`, `SubmitPlan`) lost `repr(C)`, its u32 flags became bool and its `extern "C"` 0/1 entries became slot and timeline methods; the test-only `rsf_core_fgvk_submitted` wrapper is gone. Left: `bounded_swapchain_images` and `PresentSource`, which read host records. +- `vulkan_fg_resources`: the u32 `rsf_core_vkfg_ensure_image(_usage)` wrappers are gone (callers use `ensure_image`), the release, fence and submission helpers lost their C names and the u32 consumer flag. Left: `Image.initialized` stays u32 (`vulkan_sharpening::Pass` and the DLSS tag leaves read it through pointers), and the `device::rsf_core_vkfg_*` constructors stay raw pointers because the platform table takes the device as its `user` handle. +- `vulkan_ffx_fg`, `vulkan_dx12_fg`, `vulkan_dlss_fg`, `vulkan_fsr4_fg`, `vulkan_xess_fg`: the zero status fields use `Default`, the duplicate copy-layout asserts and same-signature forwarders (`rsf_core_ffxgvk_create_sdk`, `rsf_fsr4gvk_create` over `create`, the private present wrappers) are gone, and the DLSS FG platform is `Option<&Platform>`. A PowerShell-mangled comment in `vulkan_ffx_fg/sdk.rs` is repaired. Left: the `rsf_fsr4gvk_*`/`rsf_xessgvk_*` entries that `vulkan_fg`'s provider table and its `dispatch_tests` doubles bind by name, and the FFX leaf's `extern "C"` steps the unit tests fake. +- `vulkan_dispatch::succeeded` replaces four identical zero-status helpers (`vulkan_sr::check`, `vulkan_dx12_fg::succeeded`, `dx12_vulkan_interop::checked`, the FFX startup's `checked`); the interop one also shadowed `ffi_util::checked`. +- `vulkan_sr_split`: the FSR4 provider is `Option<&Provider>` instead of a nullable pointer. Left: `vulkan_sr`'s `Dispatch.lookup`, which looked unused but is read by `vulkan_sr/graphics.rs::sdk_device_proc`. +- `vulkan_sharpening`: `Host` owns `Option>` instead of a type-erased pointer behind five `rsf_core_sharpenvk_*` wrappers. Left: the `rsf_sharpenvk_host_*` entries keep `unsafe` and the u32 run result because `tests/sharpening_vulkan*.rs` (another area) call them that way. +- `runtime/vulkan/fsr3`: `exports.rs` is gone; the 17 same-signature forwarders are the owner functions themselves, and only the three create entries and the logging destroy-chain variant stay separate. The platform probes return bool, and the record `dead_code` allowances apply to unit tests only. Left: `sdk_abi.rs` (bindgen output). +- `runtime/backends/fsr/compat`: `own_directory` returns the directory instead of filling a caller buffer, and the caller's path is read with `PCWSTR::as_wide`. Left: `check_header`, which returns the bridge's own codes rather than `call_header`'s GameSDK ones, and the generated `ffx_abi.rs`. +- Read and left as they are: `frame_capture_vk` (its `no_mangle` entries are the Godot integration's and `tests/native_sr_vulkan_capture.rs`'s ABI), `vulkan_latency` and `vulkan_antilag` (Rule 3 pacing ownership; the AMD status fields feed the public latency record as u32), `vulkan_fg` (the provider table is the test seam), `dx12_vulkan_platform` (the leaf layer the FSR4 SR state fixture replaces), `runtime/vulkan/xess-fg` (`bridge.c` is the C platform leaf behind session.rs's table, plus the bridge exports and generated records), the Streamline lifecycle's `admission.rs` and `win32/wsi.rs` (boundary code), the lifecycle's `terminated` scan (the crate has only windows-sys, so `PCWSTR::as_wide` is not available), and `runtime/vulkan/ngx`. +- Second pass: `vulkan_dlss_sr`'s `Platform` entries are plain function pointers (both tables filled every one and every call unwrapped it); `vulkan_dx12_fg/platform.rs` and `vulkan_dlss_sr/commands.rs` record through `vulkan_fg_copy`'s barrier and copy recorders and `COLOR_RANGE`; `vulkan_sr/xess/graphics.rs`'s five `rsf_core_xessvk_graphics_*` wrappers are `Graphics::open` (a `Result`), `images`, `barrier` and `copy`; the XeSS-FG capture's `generated` flag is a bool; the Streamline lifecycle's `resolve`, `shutdown` and `fg_options_bound` leaves return `bool`, `Option` and `bool`. Fixtures: the FSR4 FG state fixture's `describe` calls the production reader, the FG dispatch test names its repeated FFX create with a macro, the FFX fixture defines its state accessors and `routed` probe once, and the DLSS FG fixture builds its record with `rsf_test_support::frame_record`. Left: the three inline-callback macros (`leaf!` twice, `callback!`), which differ in syntax across about 130 call sites; the `require` duplicates in the FFX fake SDK and `sdk.rs`; the unit tests' hand-built records, since `rsf-test-support` is a fixture-only dependency; `vulkan_dlss_sr/leaves.rs`'s per-call `Sdk` entry checks. +- Not read in full in either pass: `vulkan_sharpening/native.rs`, `fsr4_fg_bridge/{sdk,native,commands}.rs`, `vulkan_fsr4_sr.rs` and `graphics.rs`, `vulkan_sr/{graphics,fallback,ffx_descriptors}.rs`, `vulkan_presentation`, `vulkan_pcl`, `vulkan_latency_frames` (and `streamline.rs`), `vulkan_fg_wsi`, `vulkan_capture_commands`, `vulkan_streamline_camera`, `vulkan_sr_session` (and `linked.rs`), `dx12_vulkan_interop.rs`, the compat crate's `native.rs`, `standalone.rs`, `dx12.rs`, `dx12_bridge.rs`, `lib.rs`, `ffx_resource.rs`, `ffx_version.rs` and `fingerprint.rs`, the Streamline lifecycle's `frame_token`, `frame_generation`, `sdk_api`, `sdk_records`, `diagnostics` and `win32.rs`, `runtime/vulkan/ngx/src/{loader,parameters}.rs`, and, among the tests, the scenario bodies of `fsr4_fg_bridge/state_fixture.rs`, `dx12_vulkan_interop/tests.rs`, `vulkan_sr/xess/tests.rs`, `vulkan_sr/owner_tests.rs` (after line 392), `vulkan_fsr4_sr/state_fixture.rs` (after line 510), `frame_capture_vk/tests.rs` (after line 340) and the lifecycle tests. + +### Simplify pass: simp-anomaly + +Code-quality pass over `games/anomaly` (reuse, simplification, efficiency, altitude). Checked with `cargo check -p rsf-anomaly` (default, `native-entry`, `--tests --all-features`, `--all-features --examples`); nothing was built or run. Every `no_mangle` export left in the crate has a C, Python or CMake reference. + +- **`sr_stage.rs`, `sr_stage/native.rs`, `sr_temporal.rs`, `sr_temporal/stage_bridge.rs`.** Leaves and driver entry points that only Rust calls lost `extern "C"`; `frame_facts`, `controller`, `swap_counters`, `host_stats`, `motion_target`, `device_size`, `now`, `loading_registered`, `precache_frame`, the driver plan and `verify_guards` return their values (`Option` where a read can fail) instead of writing through pointers. `rsf_anomaly_sr_plan` lost a `no_mangle` no C file used. The SRMipBias text, capture limit, cut bounds, refusal text and jitter reset are one helper each; the three test-only INI readers are one accessor. The frame facts read the observer's reset count directly instead of a stamped observation copy. Left: the `leaf!`/`Refused` seam, the 13-row overlay option table, the GPU timer's HRESULT-style `timer_clock`/`map_read` leaves (the timer logic keys on the pending/failed codes), and the 511-byte truncation in `compile_with_guarded_log` (it changes log text). +- **`sr_swap.rs`.** Reviewed, nothing cut: every transaction, verified restore and retry stays. Its tests use plain `#[test]`. +- **`overlay.rs`, `overlay_hooks.rs`, `overlay_native.rs`.** The hook installs return `Result<(), &CStr>`; the Present sink is two `fn(chain)` callbacks (its user word was always 0, its resize always present); a DirectInput hook takes the registry lock once for its four originals. `overlay_native` uses the `windows` crate's `IDXGISwapChain`/`IDXGISwapChain1`/`DXGI_SWAP_CHAIN_DESC` (as `fg_stage/d3d.rs` already did) instead of a hand descriptor mirror, three GUIDs and vtable slot numbers; the chain record is the Rust-only `ChainInfo`. The test-only `rsf_anomaly_overlay_bind` shim and the `Api::table` copy it read are gone. Left: the DirectInput probe's raw calls (the HID bindings are not in the shipping feature set). +- **`fg_stage.rs`, `fg_inputs`.** `stage_status` returns the policy `Counters` instead of a six-field copy with `allow(dead_code)`. The FG input leaves return `Description`/`bool` and lost their C ABI. Left: `EngineBindings` (the tests and fixture bind other functions) and the option panel's get/set pairs (stored as C callbacks). +- **`motion.rs`, `motion/stage`.** Rust-only pack and decision helpers lost `extern "C"`; the reason and distance-band names are `&str` tables; the model-element classifier takes a slice. Left: the `MaybeUninit` pack buffers (per-draw, written in place), the C leaf declarations and their unit-test stubs. +- **Crate-wide.** One `crate::lock` replaces four copies and eight inline spellings of the poison-tolerant lock. `engine_slots` and the input gate import `VirtualProtect`, `PAGE_READWRITE` and `GetTickCount` from `windows-sys`. The guard-failure checks return `Option<&'static CStr>`; the input install returns `Result` inside and writes the C caller's reason once. The shader reflection checks, tonemap curve, runtime-module accessors and `rsf_anomaly_sr_drop_target` are plain Rust. +- **Reviewed, left.** `native_observer` (retirement state machine), `native_geometry`, `sr_d3d11`, `shader_loader`, `engine_guards` tables, `sr_profile.rs`/`geometry_profile.rs`/`native_profile.rs` (evidence data the Python verifiers read), the C leaves and headers (every prototype has a definition and a caller), `CMakeLists.txt`, `build.rs`. The Python tools `anomaly_motion_deploy.py` and `anomaly_temporal_shader.py` share `tree`/`digest` copies with different refusal messages; left. +- **Follow-up: device fixtures, examples and a second integrity read.** `rsf_test_support::device` gained `d3d11_errors` (the D3D11 counterpart of `d3d12::validation_errors`); the SR fixture device, the motion harness, the tessellation probe and the temporal example use it instead of four info-queue loops (an unreadable message now counts as an error in all four, as it already did in the SR device). The foliage example wraps `Device` instead of its own device pair, texture creation, descriptors and staging read; the tessellation probe and the temporal example build descriptors and read back through `Device`; four local half decoders are `half_to_f32`. `rsf_anomaly_sr_fixture_readback` is the typed `sr_fixture_readback::readback` over interfaces and a byte slice. `sr_swap` reads single values with `get::() -> Option` instead of zeroed locals and a bool (same read order, every write, rollback and retry unchanged); the observer's status lines go through `log_guarded`. Left: each fixture's adapter selection (NVIDIA-first loops and debug fallbacks differ per fixture and choose the device under test), the sequential scenario steps in `core_device.rs`, `tess_chain_device.rs` and `roundtrip_device.rs` (each step feeds the next), `sr_swap::load`/`store`, and `native_geometry`'s C-called scope and capture entries. + +### Simplify pass: simp-orch-d3d12-fg + +Code-quality pass over the D3D12, FG, SR, GL, capture, latency, Reflex and MFG owners in `runtime/orchestrator/src`. Net about 500 lines removed; behaviour of shipped paths is unchanged. + +- **Log sinks.** `native_fg::Sink`, `d3d12_generation::Log`, `reflex_audit::Listener`, the `d3d12_observer` diagnostics `Sink`, and the hand-rolled callback-plus-CString loggers in `sr12`, `sr_bridge`, `gl_shared_surface`, `mfg_state` and `d3d12_sr/fsr.rs` are `rsf_graphics::dump_options::Log`. Left: `sr_session::Session::log` (its closure skips formatting when no log is set) and `fg12`'s install-time logger switch. +- **native_fg / native_fg_cpu.** Platform leaves return values instead of out-parameters (`present_graphics`, `texture_info`, `host_token`, `wait_fence`); one read-state restore loop; `Admission` lost three fields only the log row read; result codes come from `backend_result`; the reflex-ordering, graphics-API and frame-getter exports lost their private `extern "C"` twins. Left: `rsf_core_native_input_routes_get`, which the overlay passes as a C function pointer, and `latency_window_bind`'s repeated zero check, whose removal would reorder its error codes. +- **D3D12 host leaves.** `d3d12_host::adapter_identity` replaces three copies of the DXGI factory/LUID query (SR planner, Anti-Lag binding, GL pipeline); `create_pipeline`, `describe`, the fg12 texture description, the capture readback allocation, the sr_bridge description and the window presenter's `chain_extent`/`describe` return values; `fg_leases` uses `device_of` and `ffi_util::checked`; the XeSS zero mask and the sharpening scratch use `texture_desc` and `committed_resource`; the presenter and the XeSS settings drain wait through `wait_fence`, so `wait_for_value`/`wait_event` are private to `d3d12_fence`. Left: the presenter's other leaves, whose out-parameters carry partial-transfer cleanup the tests pin. +- **fg12.** The owner functions carry `export_name`; the fourteen forwarding `#[no_mangle]` wrappers in `fg12/native.rs` are gone. +- **frame_capture12.** Result codes from `backend_result`; the `owner()` pointer helper is inlined; the Vulkan loader name is a `w!` literal. `STAGING_FAILED`/`MAP_FAILED` stay: they are the input-dump failure reasons, not `backend_result` meanings. +- **MFG unlock.** `mfg_midpoint` and `mfg_state` read PE headers through `pe32_plus::Mapped`; `mfg_provider::module_path` is `win32::module_path_in`. Left: `mfg_gate::find`, which bounds `e_lfanew` before touching the NT header (Mapped reads it first), and every pinned hash, size and layout. +- **d3d12_generation.** `admission` uses `has_capacity`; one bounded `version_name` copy for FSR and XeSS (it now always keeps the NUL); the FSR create flags and resource-state bits come from the bindgen constants, replacing literals whose comments cited the deleted `fsr_generation.cpp`. +- **Smaller.** `gl_pipeline` reuses `pass_depth_domains` and imports the dxgi state constants; `latency_lease` builds its event name with `ffi_util::wide`; `d3d12_observer` defines its hooked-interface kinds once; three test comments that named deleted C++ and fixture files are gone. +- **Deliberately left.** `sr12::rsf_core_sr12_create_planned` repeats `create`'s setup checks because it reports `requested_result` and resolves Auto before `create` runs; folding them would change its results for invalid setups. + +### Simplify pass: simp-vk-rest-b + +The files simp-orch-vulkan did not read in full: `runtime/vulkan/{ngx,fsr3,fsr4,fsr4-fg,xess-fg}`, `runtime/backends/fsr/compat` and `runtime/vulkan/streamline/lifecycle` (all modules and tests), each read in full. Checked with `cargo clippy --tests` of `rsf-vk-fsr3`, `rsf-vk-xess-fg`, `rsf-fsr4-compat`, `rsf-streamline-vk` and `rsf-vulkanstory-ngx`, `cargo check --tests` of `rsf-orchestrator` (forced callers) and `rustfmt --check`; nothing was built through CMake or run. The generated `sdk_abi.rs`, `ffx_abi.rs`, `bridge_abi.rs` and `session_records_abi.rs` were skimmed, not reviewed. Forced edits outside the area: `runtime/orchestrator/src/streamline_sdk.rs` and `streamline_host/native.rs` (the `pcl_options` signature). + +- **fsr3.** `VK_ERROR_INITIALIZATION_FAILED` and the `oldSwapchain` offset come from the pinned `sdk_abi` (the owner reads the field through `VkSwapchainCreateInfoKHR`). `Sdk`, `Request`, `FgRequest` and `WsiRequest` are Rust-only since `platform.rs` replaced the `rsf_fsr3_*` C leaves: their `repr(C)`, size pins and comments naming deleted C records are gone; the managed `Fsr3Image`/`Fsr3Frame`/`Fsr3FgFrame` keep theirs. The test fakes lose `extern "C"`, `rsf_core_fsr3_sdk` is `sdk()`, `Frame::frame_time_ms` is inlined. **Left:** the 21 exports (the managed `Fsr3Native` and `fsr3.def` bind them), the per-SDK-call leaves (the unit tests substitute them), `sdk-fixes/` and the build scripts. +- **xess-fg.** The capture and timing locks use `ffi_util::lock_or_recover`; `check_bridge_abi` and the capture source check use `has_capacity`/`checked`; the session is allocated with `try_box` (its drop releases the capture and timing owners on refusal); `Modules::default()`. Layout asserts on bindgen records (`Frame`, `IntegratedFrame`, `IntegratedStatus`, `Modules`, `PresentResourceDesc`, `rsf_frame_record`, the capture `Desc`) are gone; the hand mirrors (`Platform`, `Footprint`, the timing records) keep theirs. **Left:** `bridge.c` (the C leaf table behind `Platform`; its only redundancy is a forward-declared `CreateContext`), `Phase`'s distinct not-ready states (read only as "not X", but each names a retirement step), `record_present_inputs` describing the resources `present_resources_match` already described (about four GetDesc calls a frame; sharing them would thread descriptions through the tag loop). +- **fsr4, fsr4-fg.** Headers only; `bridge_api.h` lost nothing (`rsf_fsr4_bridge_check` is the C callers' inline check). +- **backends/fsr/compat.** `check_header` is generic over the record and uses `has_capacity`; the owner lock uses `lock_or_recover`; `Capsule::load` resolves the four FidelityFX exports with `win32::typed_export` (the six-out-parameter `sdk::load_provider` is gone); `Request`, `Context`, `Texture` and `Dispatch` never cross a C boundary and lost `repr(C)` and their pins, as did ash's `PhysicalDeviceIDProperties`. **Left:** the fifteen `no_mangle` forwarders in `vulkan_bridge/native.rs`: the Runtime calls the Rust-ABI functions inside `guarded_or`, and an `extern "C"` owner would abort on an SDK C++ exception instead of unwinding to the guard (`C-unwind` exports would change the standalone DLL's ABI). Also left: `dx12_bridge::module_export` (the orchestrator's FSR4 FG loader), `fingerprint::module_digest`'s fallible path buffer (deliberately not `module_path`, which aborts on OOM), `Session::wait`'s two device-removed reads, `submit`/`finish` (signal order differs). +- **streamline/lifecycle.** `pcl_options`, `legacy_camera` and `legacy_tags` return their record instead of filling out-parameters; the SDK record headers use `sdk_api::header`; the bridge's `with_sdk` forwarder, the `rsf_slvk_sdk_fg_sample` copy of six DLSSGState fields (also gone from `sdk_fg_options.h`), a second `OUT_OF_VRAM`, the zero `Options` literal and the fixed-array feature count are gone; `rsf_vk_sl_tag_frame` reads the tag entry once instead of twice a frame; layout asserts on the bindgen SDK records and `repr(C)` on the Rust-only `Options` are gone. **Left:** `admission.rs` (boundary code), `wsi.rs` (one forwarder per dispatched Vulkan call), `terminated` (windows-sys only, no `PCWSTR::as_wide`), the `RwLock`/`Mutex` poison handling (the crate does not depend on rsf-game-sys outside tests), `bind_pcl`'s unreachable second `PCL_OPTIONS.get()` refusal (the bind result already guarantees it), and the lifecycle tests. +- **ngx.** `loader.rs` re-exports its platform `NAME`/`open`/`symbol` instead of forwarding; the one-field `LoadState` is the `OnceLock`'s `Result`; the Linux `dlerror` text is no longer cut to 511 bytes before the same 511-byte copy (unix path, not compiled here). **Left:** the export macros and `parameters.rs` (the vtable overload order is research evidence), `vulkanstory_ngx.h`. `sr_session::has_capacity` stays a re-export used by about fifty files across areas; moving them to `ffi_util` is a separate cross-area change. `rsf-windows`' `sha256_hex` is not used from the orchestrator: depending on that crate would link its unconditional `no_mangle` export into this archive. Bindgen records (`fsr_abi`, `xess_abi`, `reflex_nvapi_abi`), the Anti-Lag 2 SDK port and the per-SDK entry tables are unchanged. + +### Simplify pass: simp-vk-rest-a + +Code-quality pass over the Vulkan orchestrator files the simp-orch-vulkan passes had not read in full. Behaviour of shipped paths is unchanged; checked with `cargo check` and `cargo clippy` of `rsf-orchestrator` (lib and tests; default, Vulkan features, `fixture-leaves` and all features), nothing built or run. Forced edit outside the area: the bool callers in `vulkan_latency.rs`. + +- `fsr4_fg_bridge` (`native`, `commands`, `sdk`, `state_fixture`): the capsule and command leaves and their CPU doubles lost `extern "C"` (only the owner calls them, by path). `RsfFsr4FgProbe`/`RsfFsr4FgCreate` are the owner functions themselves instead of `native.rs` exports forwarding to same-signature `rsf_core_fsr4fg_*`; the capsule reads the owner's object bits instead of a second copy; `load_provider` resolves through one closure. The fixture builds its record with `rsf_test_support::frame_record`. Left: the `generate` and `describe_resource` callbacks (SDK and descriptor function pointers), `sdk_configure`'s and `sdk_generation`'s argument lists (they write the SDK's retained descriptors in the capsule's storage), and the bridge's per-frame validation, which is the boundary for host frames. +- `vulkan_fsr4_sr` (`graphics`, `state_fixture`): the leaves lost `extern "C"` except `create_fence` and `release_image`, which the importer stores as callbacks; the bridge-info record is built once in `query_info`. The fixture uses `frame_record` and one expected-usage helper. Left: `rsf_fsr4vk_info` (the C contract test's entry), `rsf_fsr4vk_evaluate`'s continuation writes (the split contract pins them), and the importer doubles' C ABI, which mirrors `dx12_vulkan_platform`. +- `dx12_vulkan_interop` (and tests): `device_luid` only called `adapter_luid`; the image output clears with the bindgen `Default`. Left: the `rsf_dx12vk_interop_*` entries, which `vulkan_dx12_fg`'s `InteropOps` table and `native_fg_xess_vulkan.c` bind, and the tests as written. +- `vulkan_pcl`, `vulkan_latency_frames` (and `streamline.rs`): the ledgers lost `extern "C"`; `rsf_core_latencyvk_pcl_bind`, `token_pace_begin`, `token_pacing` and `frame_boundary` take or return `bool` instead of 0/1. Left: the PCL message filtering and epoch cookie (they keep stale pings from an earlier registration out) and the marker order rules. +- `vulkan_sr/fallback`: the three entries are typed with `dx12_vulkan_platform::typed` instead of three transmutes. `vulkan_sr/graphics`: read and left; its leaves fill the `FfxOps` table the owner tests replace. +- Tests: `vulkan_sr/owner_tests` (second half) checks registration through one helper and loses a dead callback; `vulkan_sr/xess/tests` drops the `frame_input` alias and merges consecutive state edits; `frame_capture_vk/tests` builds its legacy dump through one helper. Every assertion is kept. Left: the XeSS requirement calls, which pass their outputs from one call into the next. +- Read and left: `vulkan_presentation` (the borrow and retirement admission is the lifetime fix; `attach`'s outer null check orders its results), `vulkan_fg_wsi` (public entries the game-sdk tests call; `rsf_core_vkfg_device_proc` returns lookup status, so it is not `vulkan_sr::lookup_device_proc`), and `vulkan_sr_session` with `linked.rs` and `routes.rs` (the C ABI the Godot integration links). + +### C++-reference pass: cppref-unity + +Method: `integrations/unity` and `games/unity-mono` compared module by module against the C++ on `main` (`package.cpp`, `bridge.cpp` twice, `vulkan_bridge.cpp`, `preview.cpp`, `plugin.cpp`, `runtime_host.cpp`, `mono_runtime.cpp`, `runtime_config.cpp`). Every addition was sorted into a defect fix from the U01-U05 findings (kept), a real FFI boundary (kept) or port overhead (removed). Checked with `cargo check` of `rsf-unity` (lib and `--tests`) and `rsf-unity-mono` (lib and `--tests`) and `cargo fmt`; nothing was built or run. The C leaves (`package.c`, `vulkan_bridge.c`) need the untracked Unity SDK headers and were edited without compiling. + +Lines (raw, C++ on `main`, Rust plus C leaves and headers before and after this pass, tests included): + +| Module | C++ | Before | After | +| --- | ---: | ---: | ---: | +| Mono plugin (U01) | 491 | 1,537 | 1,516 | +| Package session and routing (U02) | 457 | 4,401 | 4,110 | +| D3D12 bridge (U03) | 458 | 2,626 | 2,610 | +| D3D11 bridge (U03) | 338 | 2,137 | 2,113 | +| Vulkan bridge (U04) | 544 | 4,337 | 4,136 | +| Editor preview (U05) | 148 | 408 | 408 | +| Crate scaffolding | 0 | 83 | 82 | +| Total | 2,436 | 15,529 | 14,975 | + +Removed as port overhead: + +- **Package (U02).** The unit `Leaves` struct whose methods only forwarded to `raw::*`, and the `leaves: &Leaves` parameter threaded through every package method: callers use `raw::*` directly (still the test fakes under `cfg(test)`). The `LOADED` flag and `loaded()` gate, left from the adopted platform table: `package.cpp` had no such gate and its exports worked before plugin load. The Win32 leaves between two pieces of Rust lost their C shapes (timestamp and `%LOCALAPPDATA%` out-parameters, 0/1 subclass word, raw path pointers). The `package.c` leaf that only called the header-only `rsf_dlss_preset_valid`: the package checks `RSF_DLSS_PRESET_MASK` in Rust, as the Mono plugin already did. Tests: the routing test of the removed load gate; the export test now expects the waiting-device `BUSY`, and the configure transcripts lose the fake preset call. +- **D3D12 bridge (U03).** `rsf_unity_frame_admission` and `rsf_unity_source_submission` were C typedefs no C file reads; they are Rust structs, and the receipt compares with `PartialEq` instead of a field-by-field helper. +- **D3D11 bridge (U03).** `repr(C)` and offset asserts on `DeviceHandles`/`CommandSlot`, which never cross C; the `Proof` alias and `waiter()`, which were `view()`; raw-pointer signatures on the graphics leaves only the owner calls. +- **Vulkan bridge (U04).** The resolver's nine-slot interceptor table, its `bind` refusal of incomplete tables (the table is a constant built one line earlier), the route keys and the cached-original test helper: `resolve` matches the name as `vulkan_bridge.cpp`'s `intercept()` did, and the tests of that table go. Shared-device creation went Rust, then `rsf_uvk_foreign_create_device` (C), then `rsf_uvk_bridge_create_device` (Rust), only to hand back two guarded lookups as untyped pointers transmuted three times; the C leaf exports the lookups and Rust calls them. With that, `vulkan_state.h` is gone and the device, command-slot and image records are Rust structs. The GPU leaves take references and return the swap-chain extent instead of out-parameters, and `vulkan_foreign.h` loses five declarations of functions that are no longer C entries. +- **Mono plugin (U01).** The test of `rsf_game_sys::call_header::validate`, which this crate only calls. + +Kept as real fixes (each is a U01-U05 finding): the checked close and drained proof of the Mono bridge, the Auto FG runtime root and the late-Mono attempt (`startup_policy.rs`), the overlay diagnostics rows, the fingerprint reuse and rooted-path resolution; the window subclass receipt and module reference (`windows.rs`), the fallible render plan, the single latency snapshot, Runtime-owned SR fallback and quality admission, the device-keyed Auto FG choice and the retained device, the camera-churn reaping with recording receipts (`package_views.rs`, `ProducerRing`); the leased D3D12 packets, acknowledgement of the pending generation after delivery, the per-view source receipts flushed at the window event, the shared packet-to-pass builder, the copy-compatible source formats, the old D3D11 surface kept until both timelines retire, and the `FenceStatus` removal state; the deferred shared-image replacement, the dispatch owner taken from the supplied device, the window receipt bound to the presenting queue and swapchain, the shared creation transaction (`device_creation.rs`), semaphore retention until a proven wait and the three-state admission; the Editor preview's stale-window check and the Runtime presenter. + +Kept as FFI: `render_bridge.c`, `bridge.c`, `package.c` and `vulkan_bridge.c` call Unity's C++ interface vtables and guard foreign exceptions; `bridge.def` and the `rsfu_*`, `rsf_unity_*` and Vulkan hook exports are what the managed code, Unity and the loader bind; the Mono embedding table; the callback-host and Runtime records. + +Left: the `Leaves`-free `raw` seam itself and the call-transcript tests it carries (about 1,500 lines in `package_state.rs`, each asserting shipped or fixed behaviour); the `rsf_unity_package_view_setup` record in `package_state.h` (a Rust struct would be the same size); the `rsf_unity_frames_*` lock wrappers in `bridge_state.rs`; the restated DXGI and D3D12 constants in `d3d11_pass.rs`, which keep the plan testable without the `windows` crate. + +### C++-reference pass: cppref-fallout4 + +Method: the original C++ on `main` (`games/fallout4/src/*.cpp`, `*.h`, `tests/fallout4_*.cpp`) is the reference; each addition the Rust and C leaves have over it is kept only as a fixed defect (the F01-F03 findings) or a real FFI need. Checked with `cargo check -p rsf-fallout4` and `--tests` (which also compiles the C leaves through `build.rs`) and `cargo fmt`; nothing built through CMake or run. Line counts (all lines, tests included, C++ tests on the C++ side): + +| Module | C++ | Rust and C before | after | +| --- | ---: | ---: | ---: | +| render hooks (`render_hooks*`, `d3d11.rs`) | 910 | 5887 | 2439 | +| render inputs (`render_inputs*`, `render_records.h`) | 694 | 2337 | 2108 | +| depth domains | 680 | 1852 | 1754 | +| resolution | 361 | 1313 | 1237 | +| screen | 159 | 469 | 450 | +| camera | 354 | 739 | 739 | +| CPU events and worker handoff | 1805 | 4975 | 4916 | +| lifecycle, creation, DPI, build | 461 | 1542 | 1530 | +| total | 5424 | 19114 | 15173 | + +- **Render hooks.** Removed as port overhead: the World lived in `render_hooks.c` while Rust reached it through five partial views (`NativeWorld` snapshots) and five leaf tables (`NativeScopeLeaves`, `NativeProducerLeaves`, `NativePublicationLeaves`, `NativeImagespaceLeaves`, `NativeRecoveryLeaves`, 73 function pointers in all) plus `NativeWorldAdmission`, `NativeRenderScopeKey`, `NativeRenderExports`, `NativeRecoveryLease`, `NativeAuxiliaryInputs`, `NativePublicationInputs`, `NativeEffectsCall`, the C `com_assign`/`com_move` ComPtr emulation, the per-step `World::read` copies, the `PresentMatch`/`PresentAdmission` enums and the `render_hooks/{scope,producer,publication,imagespace,recovery}.rs` split. As in the C++, the World is one thread-local record, now in `render_hooks.rs` with `windows` COM references; the Rust steps borrow it only between originals. `render_hooks.c` keeps the eight typed detours, their trampolines, the return addresses, the last-error saves, the nested prepass and ordinary-World counters (restored in termination handlers) and seven guarded Runtime calls (FFI: a Runtime C++ exception must not unwind through Rust). The 1724 lines of fake-leaf tests went with the leaf tables; the C++ had no render-hook tests. Kept as real fixes: Effects admission carried to the matching return with the admitted source; RETIRE and CANCEL report success only once the token is gone; a finished token RETIREs without repeating FINISH (in the C++ a RETIRE refused at the imagespace exit was never retried: `finish_recovery` then returned the cleared `full_output_resolved`, so the token stayed owned and blocked every later World); UI_RESTORED carries a failed output restore; the World admission retries a retired resolution scope; the guarded recovery capture (unguarded in the C++). One simplification of the Rust: the outer Present follows the C++ order again (one source check before the screen revalidation, which itself refuses a changed source) instead of a second source check with its own diagnostic. +- **Render inputs.** Removed: the `NativeInputs` C lease with `rsf_fallout4_native_inputs_release`/`_move`, the `NativeInputReferences` transfer record and `take`, the C reader wrappers and their foreign-exception guard and `exception` receipt stage (the Rust reader calls no foreign code except the already guarded report sink), `rsf_fallout4_input_object` and the exported `rsf_fallout4_inputs_same_resources`; the readers return a Rust `Inputs` with its references and the pass. `render_inputs.h` is gone. Kept: the reader logic, the record recheck at unchanged slots (F02 fix) and its test, the comparator tests (F02), and the C receipt formatters, which print with `%g`/`%p` exactly as the C++ did. +- **Depth domains, resolution, screen, CPU identity.** Removed: the C-callable exports the old `render_hooks.c` used (`rsf_fallout4_depth_capture_raster`, `_raster_current`, `_capture`, `_make`; `rsf_fallout4_resolution_configure`, `_preflight`, `_begin_output`, `_native_dr`, `_end_output`, `_finish_source`, `_report`, `_reconfigure`; `rsf_fallout4_screen_classify`, `rsf_fallout4_ordinary_screen_refusals`; `rsf_fallout4_cpu_current_identity`, `_render_source_is_current`, `_begin/_end_present_phase`, `_finish_render_scope`) with their header declarations, null-pointer wrappers and the `Reserve` C callback (`resolution::configure` takes a closure). Kept: every admission check, the F02 resolution recovery path and its two tests, the guarded render-config query. +- **CPU events, camera, lifecycle.** Read against the C++ and left. The receipts (native-cycle, gate, downstream, poll, source and input) are the C++ set. The C shells with the per-call scope buffer are the FFI need (the engine call runs on a C frame between the Rust entry and exit), the worker-handoff tests port `tests/fallout4_worker_handoff.cpp`, the camera tests port `tests/fallout4_camera.cpp`, and the lifecycle's guarded host calls replace the C++ `noexcept try`. What remains over the C++ there is rustfmt line splitting, explicit `unsafe` around each read and call, and the decomposed functions of the C++ one-line predicates; no further port-only machinery was found. + +### C++-reference pass: cppref-tests + +Method: the C++ tests under `tests/` on `main` are the reference. A Rust test stays when it ports a C++ test or pins a fixed defect; machinery a port added around a test (shims, fixture headers, bindgen, Cargo features, archives) stays only for a real FFI need. Checked with `cargo check` of `rsf-vulkan-fg-fixtures` (default and `xess-sr,xess-input-range,xess-device`) and `rsf-loader-fixtures`, and `rustfmt --check`; the C and C++ files and the CMake edits were not compiled or run. + +Size: `tests/` was 57,201 lines and 2.12 MB against 47,419 lines and 2.87 MB on `main` (1.2x lines, 0.74x bytes); many `main` tests now live as fixture modules and `cfg(test)` modules in the production crates, which their area workers own. After this pass `tests/` is 55,291 lines. + +| Module | C++ on main | Before | After | +| --- | ---: | ---: | ---: | +| FidelityFX WSI dispatch | 54 | 379 | 146 | +| Streamline NGX dispatch (with `sdk-fixes/dispatch-tests.cpp`) | 90 | 251 | 91 | +| Streamline selected device | 79 | 129 | 81 | +| Vendor census layouts | 280 | 612 | 280 | +| `tests/vulkan-fg` scaffolding (`build.rs`, `lib.rs`, `Cargo.toml`) | 0 | 113 | 62 | +| AC7 present-bridge fixture (without the shared `d3d11_device_checks.rs`) | 804 | 2,362 | 1,738 | +| Shared FG present-bridge fixture (without the unchanged focus lease) | 581 | 1,838 | 1,388 | +| Total | 1,888 | 5,684 | 3,786 | + +- **Vendor header tests (removed as port overhead).** The code under test is a C or C++ vendor header, so each test needs a C or C++ unit anyway. The port had added, per test, a shim that re-exported the header through `uintptr_t` entries or a visitor callback, a fixture header (`vulkan-fg/wsi_abi.h`, `streamline_abi.h`), bindgen output (the committed `vulkan-fg/src/wsi_abi.rs` and its generator entry in `tools/generate-rust-bindings.py`), a Rust scenario (`wsi.rs`, `streamline_dispatch.rs`, `streamline_selected.rs`, `loader/src/windows/vendor_layouts.rs`), three Cargo features with their CMake archives and the crate's `build.rs`. Each test is one file again: `tests/ffx_vulkan_wsi_dispatch.c` (C11, as the header section is), `tests/streamline_vulkan_dispatch.cpp`, `tests/streamline_selected_device.cpp` and `tests/loader/vendor_layouts.cpp` (main's `vendor_census_layouts.cpp` with the census file names updated; the expected offsets were already identical). Kept from the port: the WSI test's forwarded return values, swapchain values and queue identity; the Streamline first-use layout cases from the deleted `sdk-fixes/dispatch-tests.cpp`, now with checks that do not compile out in Release; the `sdk_fg_options_checks.h` include that pins the DLSS-G layouts the Rust callers use. +- **Build fix.** `tests/d3d11_host_rendered_fg_device.cmake` linked `rsf_d3d11_host_device_fixtures_rust`, which no longer exists since the presentation archives merged; it links `rsf_presentation_d3d11_host_device_rust`. +- **Read against the C++ and left, with the reason.** `tests/presentation/api` and `tests/generation/dll.rs`: the C mains pass the Runtime DLL's own addresses (S7.2 constraint 1), and the Rust ports the C++ checks. `vulkan-fg/src/xess_input_range.rs` (602 lines against 70): the C++ included `native_xess_vulkan.cpp` and set the service's private fields, which Rust cannot do from another crate, so the test drives the public owner through fake SDK and Vulkan tables; inherent to testing Rust from outside. `tests/game-sdk/src/vk_*.rs` (1,775 lines against 491): `native_latency_vulkan.cpp` and `native_antilag_vulkan.cpp` were dense one-line C++ (several statements per line); the scenarios match, the ratio is formatting. `tests/loader` census fixtures: the fake vendor DLL is Rust with a C++ leaf only for the NGX parameter overloads, whose vtable slots the C++ compiler chooses. +- **AC7 present-bridge fixture (removed as port overhead).** `d3d11_present_bridge.cpp` was one translation unit. The port split it into a C11 launcher (`tests/d3d11_present_bridge.c`: the native command list, the queued Present, evaluate and SimulationEnd commands, the D3D11 draws) and five Rust modules (`d3d11_fixture_startup.rs`, `d3d11_fixture_loop.rs`, `d3d11_marker.rs`, `d3d11_scope_fixture.rs`, `d3d11_bridge_sr.rs`) joined by three call tables (`rsf_ac7_fixture_calls`, the 18-entry `rsf_d3d11_marker_fixture_calls`, `rsf_d3d11_scope_fixture_calls`), the `rsf_ac7_loop` and `rsf_ac7_fixture_commands` packets and three headers (`present_fixture_loops.h`, `d3d11_marker_bridge.h`, `d3d11_scope_fixture.h`). Each table entry was a statically linked Runtime or AC7 scope function, or a Rust export routed back through C. The launcher also wrapped every queued command in a foreign-exception guard the C++ did not have; nothing C++ runs in the fixture now, and the AC7 scope owner guards its own observer calls (`games/ac7/src/render_scope_entry.c`). `tests/presentation/src/d3d11_fixture.rs` owns the list, the commands and the loop and calls the Runtime and the render scopes directly; it is compiled with the `ac7-render-scope` feature that links them, and the executable uses `fixture_main_args.c`. Kept: every check and message, the marker admission sequences, the borderless, proxy-smoke, fallback and retirement paths, and the unhandled-exception report (now Rust). +- **Shared FG present-bridge fixture (removed as port overhead).** `fg_present_bridge.cpp` was one `main()` over file-scope state; the port split it into `fg_bridge.rs`, `fg_fixture_callbacks.rs`, `fg_fixture_loop.rs` and `fg_fixture_startup.rs`, whose functions passed parameter bundles built field by field (`Loop` with 22 fields, `Submission`, the per-frame `FramePlan` schedule table, `Activity`, `Mode`, `Directories`, `legacy_begin`, `legacy_switch`, `hot_switch`). `fg_fixture.rs` keeps the provider callbacks, their `State`, the process-exit release of that state (the provider can retain callback inputs after a failed GPU retirement) and the recording helpers, and runs setup, the frame loop and the summary in one function. The focus lease (`fg_fixture_focus.rs`) is the C++ `FocusTest` and stays. +- **Not run.** Both present-bridge fixtures are device tests: compile-checked (`cargo clippy` of `rsf-presentation-fixtures` with no features, `gl-device-fixture`, and all three features) but not built through CMake or run on a GPU. + +### C++-reference pass: cppref-orch-d3d11 + +Method: `runtime/orchestrator/src` `d3d11_*`, `render_host*`, `callback_host*`, `plugin_session*`, `overlay_*`, `settings_store`, `input_dump*` and `runtime/presentation` compared module by module against the C++ on `main` (`overlay_native12.cpp`, `overlay_d3d12.cpp`, `loader/proxy/src/overlay_host.cpp`, `overlay_input.cpp`, `overlay_renderer.cpp`, `overlay_api.cpp`, `d3d11_present_bridge.cpp`, `d3d11_host.cpp`, `d3d11_observer.cpp`, `render_host.cpp`, `callback_render_host.cpp`, `plugin_session.cpp`, `render_settings_store.h`, `input_dump*.cpp` and their tests). Each addition was sorted into a fixed defect (C02, C03, D01, D02, G01, O01, O02 findings: kept), a real FFI need (kept) or port overhead (removed). Checked with `cargo check -p rsf-orchestrator` (lib and `--tests`) and `rustfmt`; nothing was built through CMake, tested or run. Lines (all lines, tests included, C++ tests on the C++ side): + +| Module | C++ | Before | After | +| --- | ---: | ---: | ---: | +| D3D12 overlay panels (`overlay_native12*`, `overlay_wrapped12*`) | 485 | 3003 | 1695 | +| overlay host | 1008 | 2018 | 1968 | +| overlay input and windows | 1548 | 2291 | 2291 | +| overlay D3D11 renderer | 994 | 1251 | 1251 | +| overlay service, settings, saved rows, panel loader | 1538 | 2536 | 2536 | +| D3D11 presentation (`d3d11_present*`, `runtime/presentation`) | 2844 | 9042 | 9042 | +| D3D11 host | 1598 | 4329 | 4329 | +| D3D11 observer | 2252 | 2911 | 2911 | +| D3D11 SR, output, sharpening, D3D12 helpers | 248 | 866 | 866 | +| render host | 833 | 3132 | 3132 | +| callback host | 436 | 2383 | 2383 | +| plugin session | 181 | 293 | 293 | +| settings store | 424 | 966 | 966 | +| input dump | 1454 | 2658 | 2658 | +| total | 15843 | 37679 | 36321 | + +- **D3D12 overlay panels.** Removed as port overhead: `overlay_native12.rs` reached its own D3D12 calls through a 19-entry `Platform` table of `extern "C"` functions in `overlay_native12/native.rs` with raw-pointer records (`FrameTable`, `Draw`, `DrawCall` as `repr(C)`, `Target`), `Frame::adopt` reference transfer and a renderer handle with its own destroy entry, as `overlay_native12_platform.h` had during the port; `overlay_wrapped12.rs` did the same with a 10-entry table, `Interop` and `WrappedTarget`. As in `overlay_native12.cpp` and `overlay_d3d12.cpp`, each owner now holds `windows` references (`Gpu`, typed `Frame`, `Binding`) and calls D3D12 and D3D11-on-12 directly. `overlay_wrapped12` calls the overlay host's Rust `rsf_core_overlay_host_admit`, `_draw_target`, `_start_device` and `_stop_device`, so the four `extern "C"` wrappers in `overlay_host_native.rs` that only its table used are gone. Tests: the atlas, frame-creation and wrapped-sequence fixtures exercised the tables and went with them; the ring, fence-event and (reduced to its gate) retry tests stay. Kept as real fixes: recovery after a failed owner retires, with the signal on the retained original queue and the per-owner retry delay (O02); empty draws skipped before texture lookup (O02); the shared elapsed-frame policy (O02); the armed fence event kept after a timeout; per-slot retention of what each list reads; the device-and-queue owner check of the wrapped path. Kept as FFI: the `rsf_overlay_native12_present`, `rsf_overlay_d3d12_frame`/`_stop` exports the C fixtures and `tests/presentation` call. +- **D3D11 presentation, D3D11 host, render host, callback host, overlay host.** Read against the C++ and left. Each routes its native calls through a `leaf`/`native` module that the unit tests replace (`d3d11_present_native.rs`/`_gpu`/`_dxgi`/`_device` with the `rsf_d3d11p_*` records, `d3d11_host_platform.rs`, `render_host_native.rs`, `overlay_host_native.rs`). Unlike the overlay tables, those seams carry the tests of the D02, D01, C02 and O02 fixes (partial-initialization rollback, retirement that keeps provider and inputs, physical lease deferral, scoped creation admission, reduced-ticket ordering, recording-slot retirement on one queue, preset drains, the generation-provider save after the switch lands, and so on), so removing them would remove that coverage; they stay, as the Unity pass kept its `raw` seam. The C leaves (`d3d11_present_bridge.c`, `d3d11_host_foreign.c`, `render_host_platform.c`) are the SEH guards for foreign C++ exceptions. +- **D3D11 observer.** The `rsf_observer11_present_platform` table is the SEH-guarded C table in `runtime/graphics/src/observer_exception_guards.c` (FFI). The application-present ledger and reentry handling are G01 fixes. +- **Overlay input, renderer, service, settings store, input dump, plugin session, SR helpers.** Read and left. `overlay_api.cpp` already had the apply log, its cap and the lifecycle the Rust service keeps; `settings_store` holds the C ABI of `render_settings_store.h`, the adapter setting exports and the sharpening-write rollback (C03); the Vulkan dump adds device-loss and capture-group handling over `input_dump_vulkan.cpp`. `overlay_renderer11/platform.rs` still takes raw handles from its typed owner (no test seam); merging it would save little at 1.26x the C++. + +Estimate of what is left: about 20,500 lines over the C++. Roughly 8,500 are the five leaf seams and the unit tests over them (`d3d11_present_tests.rs` 2,831, `callback_host/tests.rs` 1,332, `render_host/tests.rs` 1,040, `overlay_host_tests.rs` 845, `d3d11_host_tests.rs` 831, plus the leaf modules and `rsf_d3d11p_*` records), kept because they test fixed defects. Most of the rest is inherent: rustfmt splitting the C++'s dense `;`-joined lines (the merged `overlay_native12.rs` is still about 3x `overlay_native12.cpp` for the same calls), explicit `unsafe` and COM ownership at each call, and the fixes themselves. This method could remove perhaps another 5 percent: the raw-handle split in `overlay_renderer11`, the Rust-only `repr(C)` records between hosts and their leaves (`Adapter`, `ResourceDesc`), and smaller duplicated helpers. + +### C++-reference pass: cppref-orch-d3d12-fg + +Method: `runtime/orchestrator/src` `d3d12_*`, `fg12*`, `sr12*`, `sr_*`, `gl_*`, `frame_capture12*`, `native_fg*`, `fg_*`, `latency*`, `reflex*` and `mfg*` compared against the C++ on `main` (`native_fg_d3d12.cpp`, `native_sr_d3d12.cpp`, `frame_capture12.h`, `gl_pipeline.cpp`, `gl_shared_surface.cpp`, `sr_bridge.cpp`, `sr_session.cpp`, `sr_legacy_adapter.cpp`, `fsr_generation.cpp`, `xess_generation.cpp`, `generation_state.h`, `fg_helpers.h`, `sr_helpers.h`, `fsr_sr.inl`, `xess_sr.inl`, `d3d12_observer.cpp`, `sharpening/d3d12.cpp`, Unity's `preview.cpp`, `native_fg.cpp`, `fg_*.cpp`, `latency_antilag.cpp`, `reflex_audit.cpp`, `mfg_unlock.cpp` and the MFG-Unlocker sources, with their tests). Checked with `cargo check -p rsf-orchestrator` (lib and `--tests`), `cargo check -p rsf-unity` and `cargo fmt`; nothing was built through CMake, tested or run. Lines (all lines, tests and fixtures included, C++ tests on the C++ side): + +| Module | C++ | Before | After | +| --- | ---: | ---: | ---: | +| D3D12 window presenter (C++: Unity `preview.cpp`, shared with the Unity Editor owner) | 148 | 1083 | 498 | +| D3D12 capture (`frame_capture12*`; includes 711 lines of XeSS-FG D3D12 capture leaves whose C++ is in `runtime/vulkan/xess-fg`) | 333 | 2304 | 2243 | +| D3D12 FG (`fg12*`) | 626 | 1663 | 1647 | +| D3D12 SR (`sr12*`) | 664 | 2842 | 2828 | +| OpenGL pipeline (`gl_pipeline*`, with the shared-settings attachment) | 323 | 2883 | 2883 | +| OpenGL sharing (`gl_shared_surface*`) | 513 | 2108 | 2108 | +| SR bridge, session, legacy adapter, history | 1219 | 3758 | 3758 | +| D3D12 generation providers (`d3d12_generation*`, includes the pinned FidelityFX records) | 1190 | 3941 | 3941 | +| D3D12 SR providers (`d3d12_sr*`, includes the XeSS records) | 747 | 1303 | 1303 | +| D3D12 fence, host leaves, observer, sharpening | 716 | 2084 | 2084 | +| native FG and CPU pacing (`native_fg*`, Vulkan glue excluded) | 1867 | 5206 | 5206 | +| FG choice, leases, scene, session, status, dispatch | 1136 | 1697 | 1697 | +| Anti-Lag 2, latency lease (C++ SDK headers not counted) | 162 | 1187 | 1187 | +| Reflex audit and NVAPI records (`nvapi.h` not counted) | 205 | 1045 | 1045 | +| MFG unlock | 2208 | 2096 | 2096 | +| total | 12057 | 35371 | 34695 | + +Bytes: 704 KB of C++; Rust 1,259 KB before, 1,236 KB after (1.79x to 1.76x). + +- **D3D12 window presenter.** Removed as port overhead: `preview.cpp` held its device, queue, fence, swapchain and slot objects in `ComPtr`. The port kept them as raw `*mut c_void` in Rust-only `repr(C)` records (`Gpu`, `Slot`) with hand-written `unref`/`retain` and a `RECORD_*` result code, behind a `windows.rs` leaf module that the unit tests replaced with integer handles. The presenter owns `windows` COM references again and calls D3D12 and DXGI directly; `windows.rs` and the 370 lines of fake-handle tests are gone. Kept as real fixes (U05): the per-output Runtime presenter itself, the target generation with refusal of a stale target and old-chain retention until the copies drain, the fault flag after a refused signal that bars reuse and release, the drained proof required before destroy, the shared `SubmissionRing`, and the C target record (the Unity crate binds it). Coverage note: the signal-fault and recycled-window behaviour is now checked only by an Editor run (`docs/research/rust-unity-preview-resources.md`). +- **D3D12 capture.** Removed: the C++ SR and FG owners called `FrameCapture12` methods; the port reached the Rust owner through five crate-internal `extern "C"` wrappers (`rsf_core_capture12_enabled`, `_configure`, `_force_reset`, `_submitted`, `_abandon`) with null-pointer checks, which `sr12/native.rs` and `fg12/native.rs` wrapped a second time. Both call the owner's methods; the null-argument test of those wrappers is gone. Kept: the exports Godot's native host binds (`create`, `destroy`, `wants`, `event`, `record`, `flush`), the `rsf_input_dump12_*` entries, the identity-matched submission fence, the device-removal and map-retry paths and the queue-drain batch (D04 and G07 fixes) and their tests. The `fg12_platform.c` constructor stays: it gives the process-wide FG capture owner the static construction and unload destruction the C++ global had. +- **D3D12 FG.** Removed: the `native!` macro, which only expanded to `crate::fg12::native::op(...)`. Read and left: the install rollback, shared option validation, abort eligibility, failure publication, Reflex interval and counter rules are the D04 fixes; `fg12` has no test seam. +- **D3D12 SR, OpenGL pipeline and sharing, SR bridge, SR session.** Read against the C++ and left. Each owner reaches its native calls through a `native`/`platform`/`leaf` module that the unit tests replace, and the owners already hold `windows` references; those seams carry the tests of the D04 and D08 fixes (dump provenance, external exposure, sharpening refusal, the OpenGL resize rollback and published reconfiguration result, presented view identity, the retryable window teardown and cleanup handle, the GL semaphore results and released-batch matching, the SR bridge's signal retries, warm-up retention and device-removal release), so they stay, as the Unity and D3D11 passes kept theirs. `gl_pipeline/settings.rs` is the shared Minecraft settings attachment (Rule 2), not port machinery. +- **D3D12 generation and SR providers, observer, sharpening, fence and host leaves.** Read and left. The validation, prepare ordering (`PrepareOrder`), checked teardown and coexistence preflight follow `fg_helpers.h`, `generation_state.h` and the D04/D06 fixes; `fsr_abi.rs` and `d3d12_sr/xess_abi.rs` are the pinned SDK records the C++ took from headers; the observer's `foreign.rs` guards each COM call against a foreign exception unwinding into Rust; `xell_fixture.rs` ports `tests/xell_sleep_concurrency.cpp`. +- **Native FG and CPU pacing, FG choice/leases/session, latency, Reflex, MFG.** Read and left. `native_fg.cpp`'s dense one-line functions explain most of the line ratio; the attempt states, timing scopes, receipt retention and marker-delivery records are C04/C05 fixes; the `fixture-leaves` seam serves the `native_fg_cpu_contract` ctest. The Anti-Lag 2 and NVAPI modules carry the SDK layouts the C++ included from vendor headers; the audit's `Retained` install state is a C05 fix. The MFG files are the pinned MFG-Unlocker port and are already below the C++. + +Estimate of what is left: about 22,600 lines over the C++. Roughly 7,000 are the test seams and the unit tests and fixtures over them (`sr12/tests.rs` 1,107, `gl_pipeline/tests.rs` 969, `gl_shared_surface/tests.rs` 935, `sr_bridge/tests.rs` 845, `frame_capture12/tests.rs`, the `sr_bridge`, `sr_session`, `native_fg_cpu` and XeLL fixtures, plus the `native`/`platform`/`linked` modules), kept because they test fixed defects. About 3,000 are SDK records and capture leaves whose C++ is not in the count (FidelityFX, XeSS, NVAPI, Anti-Lag 2, the XeSS-FG D3D12 capture). Most of the rest is inherent: rustfmt splitting the C++'s `;`-joined lines, explicit `unsafe` and COM ownership at each call, the foreign-exception guards, and the fixes themselves. This method could remove perhaps another 3 to 5 percent here: the `pub(super) use ... as` alias layers in `native_fg/platform.rs`, `fg12/native.rs` and `gl_pipeline/linked.rs`, the Rust-only C shapes of `sr_legacy` and the `rsf_core_sr12_*` calls between in-crate owners, and the local constant mirrors with their asserts in `sr12/native.rs`. Removing the seams themselves would remove the fixed-defect coverage, which is the coordinator's call, not this method's. + +### C++-reference pass: cppref-orch-vulkan + +Method: the Vulkan orchestrator owners (`runtime/orchestrator/src` `vulkan_*`, `dx12_vulkan*`, `fsr4_*`, `frame_capture_vk*`), `runtime/vulkan/**` and `runtime/backends/**` compared module by module against the C++ on `main` (`native_fg_vulkan.cpp`, `native_fg_vulkan_dispatch.cpp`, `native_fg_dlss_vulkan.cpp`, `native_dlss_vulkan.cpp`, `native_sr_vulkan.cpp`, `native_xess_vulkan.cpp`, `native_sr_split_vulkan.cpp`, `native_sr_fsr4_vulkan.cpp`, `native_fg_fsr4_vulkan.cpp`, `native_fg_xess_vulkan*.cpp`, `native_dx12_vulkan_interop.cpp`, `native_latency_vulkan.cpp`, `latency_amd_vulkan.cpp`, `sharpening_vulkan.h`, `frame_capture_vk.h`, the `runtime/vulkan/*/bridge.cpp` units and their tests). Checked with `cargo check -p rsf-orchestrator` (default, `--tests`, `--all-features`, `--all-features --tests`) and `cargo fmt`; nothing was built through CMake or run, and the FFX fixture scenario added below has not run. + +Lines (all lines; C++ sources with their C++ tests on `main`, Rust with C leaves, headers, tests, generated bindings and fixtures before and after this pass): + +| Module | C++ | Before | After | +| --- | ---: | ---: | ---: | +| FFX FG Vulkan (`vulkan_ffx_fg*`) | 925 | 5,110 | 4,315 | +| Standalone FSR3 (`runtime/vulkan/fsr3`, 1,818 generated) | 1,603 | 5,357 | 5,357 | +| FG dispatch and shared FG (`vulkan_fg*`) | 1,027 | 3,837 | 3,839 | +| DLSS FG Vulkan | 910 | 3,905 | 3,888 | +| DLSS SR Vulkan | 329 | 1,093 | 1,093 | +| Vulkan SR, XeSS SR, split (`vulkan_sr*`) | 2,461 | 6,587 | 6,587 | +| FSR4 SR Vulkan (with `dx12_vulkan_platform`) | 1,351 | 2,435 | 2,435 | +| Vulkan-DX12 FG (`vulkan_dx12_fg*`, interop, FSR4 and XeSS providers) | 2,056 | 5,534 | 5,515 | +| FSR4 FG bridge | 647 | 2,577 | 2,577 | +| XeSS FG bridge (`runtime/vulkan/xess-fg`) | 1,453 | 4,963 | 4,963 | +| Latency and pacing | 1,493 | 2,928 | 2,928 | +| Sharpening | 602 | 1,721 | 1,721 | +| Capture (`frame_capture_vk*`) | 235 | 1,788 | 1,788 | +| Streamline (`runtime/vulkan/streamline`) | 2,167 | 5,378 | 5,378 | +| NGX | 965 | 1,028 | 1,028 | +| Backends (688 generated) | 2,212 | 4,155 | 4,155 | +| README | 29 | 31 | 31 | +| Total | 20,465 | 58,427 | 57,598 | + +Bytes: 1.29 MB of C++, 2.11 MB of Rust before, 2.09 MB after (2.85x to 2.81x lines, 1.64x to 1.62x bytes). Removed as port overhead: + +- **FFX FG Vulkan.** `startup.rs`: a ten-entry `Platform` table between `sdk.rs` and itself that bound the SDK exports, device and WSI entries, and its call-order test; `rsf_ffxgvk_create` in the C++ bound them inline, and the leaf's `Native::bind` does again, with the same order and results. The unit tests' second copy of the SDK leaf (`#[cfg(test)] use tests as leaf`, about 400 lines of fakes) and its six tests: the C++ tests (`native_ffx_vulkan_reset.cpp`, `native_ffx_vulkan_submission.cpp`) drove the real implementation over a fake FidelityFX module, which `vulkan_ffx_fg/fixture` still does. Three of the tests repeated the fixture's submission and WSI route scenarios (the consumer fence after a present error, teardown retry without repeating, the route borrow); the other three move into the fixture's route scenario (`native_ffx_vulkan_wsi_route_contract`) over the production leaf: admission refusals before the module loads and the disabled build's NOT_COMPILED, the owner returned for a refused rollback after a failed provider query, and the route released by a failed open. The dead-code allowance for `vulkan_fg`'s dispatch doubles is now one attribute on the module. +- **DLSS FG Vulkan, Vulkan-DX12 FG.** Size and offset pins on records whose C counterparts the port deleted: the DLSS-G `Sample`, `Tag`, `SdkCall`, `Sdk` and `Platform`, the Vulkan-DX12 `GraphicsOps`, `Swapchain`, `PresentInfo`, `PresentInput` and `PresentSubmit`, and asserts on ash's own Vulkan sizes and constants. Their `repr(C)` stays: the records still cross Rust `extern "C"` signatures and the DLSS fixture writes the SDK entries at the start of `Native`. + +Kept as real fixes (each is a V01-V06 finding or a Rust review fix): the FFX WSI route with borrow counting and closing (hooks without a user pointer could reach a freed owner in the C++), step-by-step retirement that retries without repeating a release, the owner returned for a refused rollback, the stored-source FG veto and submission plan (`vulkan_fg_frames`), bounded swapchain-image enumeration; the FG dispatcher's retained cleanup-only owner and presentation admission (`vulkan_presentation`); DLSS-G recovery from a WSI error, the API-error report and the checked capture detach; capture publication only after the recording command or group retired (`frame_capture_vk`); the FSR4 FG bridge's retention on refused destruction, history reset across a missing source and status on every exit; the FSR3 bridge's retained swapchain on refused rollback, old-link retirement and exclusive pairing; the Streamline lifecycle's checked unload, sticky shutdown and frame-token return; the XeSS FG timing per session and per-setting capture reads. + +Kept as FFI: the C ABI of every public `rsf_*vk_*` entry and its `struct_size`/`abi_version` checks (the C++ had them), `bridge.c` and the XeSS FG `Platform` table (the standalone MinGW DLL links `session.rs` without crates, so the COM calls stay in C), the C glue in `native_fg_xess_vulkan*.c`, `native_xess_vulkan.c`, `native_sr_vulkan.c` and `native_vulkan_exports.c`, the C-unwind guards around SDK and host calls, the generated SDK records, the Streamline and FidelityFX SDK patch payloads and their pinned hashes. + +Left, read against the C++: the provider table in `vulkan_fg.rs` (the C++ `#if` switch is the same length; its unit test ports `tests/native_fg_vulkan_dispatch.cpp`, which faked the providers at link time), the split SR provider table and stub (the C++ test used `RSF_TEST_SPLIT_STUB` the same way), the leaf tables that the fixtures and unit tests substitute (`vulkan_sr::FfxOps`, `XessOps`, `vulkan_dlss_sr::Platform`, `vulkan_dlss_fg_abi::Platform`, `GraphicsOps`, the FSR4 FG and SR state-fixture leaves), because their tests pin fixed defects the C++ tests did not cover and no fixture over a fake SDK covers them instead; latency, sharpening, FSR4 SR and NGX, whose Rust is within 3 percent of the C++ bytes. Moving the XeSS FG C glue tables into Rust would save about 30 lines and needs an unverified CMake link change; not done. + +### C++-reference pass: cppref-ac7 + +Method: `games/ac7` and `loader/proxy` against the C++ on `main` (`native_renderer.cpp`, `plugin.cpp`, `render_scope.cpp`, `truesky_*.cpp`, `velocity_pass.cpp`, `velocity_shader.cpp`, `motion_capture.cpp`, `view_uniforms.cpp`, the proxy sources and `tests/ac7_*.cpp`); each addition is kept only as a fixed defect (A01-A05 findings) or a real FFI need. Checked with `cargo check` of `rsf-ac7` (lib, `--tests`, `warp-fixture`, `view-fixtures`), `rsf-ac7-plugin` (lib, `--tests`, `warp-fixture`), `rsf-ac7-capture-fixture --tests`, `rsf-ac7-render-scope-fixture` and `rsf-presentation-fixtures --features ac7-render-scope`, and `cargo fmt`; nothing built through CMake or run. Forced edits outside the area: `tests/ac7_native_graph.{c,rs}` and `tests/ac7_view_fixture.rs` (the velocity patch entries lost their leaf table). Lines (all lines, tests and AC7 fixtures included, C++ tests on the C++ side; the carrier is counted with the proxy it came from): + +| Module | C++ | Rust and C before | after | +| --- | ---: | ---: | ---: | +| native renderer, plugin, render scopes, TrueSky (A01, A02) | 4523 | 13660 | 11420 | +| F9 motion capture (A03) | 1609 | 5838 | 5838 | +| velocity shader transforms (A04) | 1768 | 3058 | 3058 | +| velocity pass and history (A05) | 623 | 5022 | 3904 | +| view reader | 904 | 663 | 663 | +| UI rules, scene colour (removed by D1) | 1070 | 0 | 0 | +| carrier and `loader/proxy` | 7624 | 2894 | 2894 | +| crate and build files, README, `engine.json` | 989 | 1221 | 1220 | +| total | 19110 | 32356 | 28997 | + +- **Renderer transaction (A01).** Removed as port overhead: `native_renderer.cpp` prepared, started, quiesced and stopped the renderer inline. The port had split that into `renderer.rs` with a 33-method `Native` trait and its forwarding `NativeLeaves`, the renderer-object forwarders of `native_renderer/leaves.rs`, the `CodeView`/`Code` traits with `NativeCode`/`NativeCodeView` over `rsf_ac7_code_leaves` (a C table of two Rust callbacks), the lifecycle's `Leaves` trait, and the fake-leaf tests of all of them (`renderer/tests.rs`, `lifecycle/tests.rs`, `fake_code.rs`, the admission and patch fakes). `native_renderer/transaction.rs` runs the transaction on the `Renderer` again, and sites, patches and TrueSky call `code_matches`/`write_code` directly; `rsf_ac7_code_leaves` is gone from `ac7_sites.h`. Kept as fixes: a failed install keeps its hooks and trampolines while a body runs and pins the module; retirement removes only created hooks and each step forgets only what it retired; the lifecycle's prepared flag separate from a cleanup-only renderer (A01). +- **TrueSky (A02).** Removed: the `Plugin` trait, `NativePlugin`, the `Handler` enum, the `*_native` pointer wrappers and the 500 lines of fake-plugin tests; `truesky.rs` takes the `Renderer` and calls `sky.rs`. Kept as fixes: the composite relay's own retryable outcome, the depth selector kept owned when its rollback write fails, relay memory and cloud resources kept while a relay call runs, the retryable step-by-step restore. Kept as FFI: `rsf_ac7_truesky_patches`/`rsf_ac7_call_relay`, which the graph fixture in `rsf-ac7` reads. +- **Velocity history (A05).** Removed: `velocity_pass.cpp` kept each model's and view's identity, frame, epoch and buffers in one `Renderer` map entry. The port split the logical half into `velocity_history` (a slot table with free list, `Retired` reports, decision records, a reset hook, 300 lines of tests) beside parallel slot vectors in the D3D11 renderer, and owned the renderer through a type-erased `Owned`/`Published` lifetime with seven fake-renderer tests. The renderer holds `HashMap` and `HashMap` with both halves, and the replay lock holds `Option>`; the commit's view identity and target check moved from `velocity_commit` into the commit itself. Kept as fixes: records charged only after the native build ran; a same-frame draw and a commit need the same view, family and native depth; fallible map growth refuses instead of aborting. +- **Velocity variants (A05).** Removed: the source cache kept `VariantKey -> slot` with a generation counter, `Built`, `record` and `reset_variants`, and the device owner the variants in a vector. The device owner holds the variants by identity (`None` for a refusal), dropped with the renderer, which also retires the late-slot defect by construction. Kept as fixes: beam layout in the identity, only deterministic refusals cached, the bytecode lease across a replacement, a replacement forgetting the old source first; their cache tests now call `prepare`. +- **Read and left.** F9 capture: the C trampolines own the typed Unreal calls, `__try`/`__finally` scope restoration and the detour and original arrays, so the engine and root records, the `rsf_ac7_capture_*` entries and the MinHook batch (GM-G8.1) are the FFI boundary; the `CaptureEffects` and `RootHookEffects` seams (about 150 lines with their two tests) are the only port-only parts found. Shader transforms, view reader, render scopes (the A02 enqueue and command-list fixes with their tests), `velocity_stream` (pure functions of the C++ inline expressions, with tests), the detours and `native_renderer/*`: what remains over the C++ is rustfmt splitting of dense one-line C++, explicit `unsafe` and guarded reads, and doc comments. `loader/proxy` is smaller than on `main` (D1 removed the compatibility renderer) and stays C. + +### C++-reference pass: cppref-orch-sr-misc + +Method: the `runtime/orchestrator/src` files outside the D3D11, D3D12-FG and Vulkan areas (DLSS, Streamline, native SR, auxiliary SR, shader patch and the rest), plus `runtime/graphics` and `runtime/shader_patch`, compared with the C++ on `main` (`runtime/shader_patch/src/*`, `runtime/backends/dlss/src/dlss_generation.cpp`, `native_fg_dlss_vulkan_capture.cpp`, `native_scene.cpp`, `sampler_bias.cpp`, `native_sr.cpp`, `dlss_pipeline.cpp` and their tests). Checked with `cargo check -p rsf-orchestrator` (lib, `--tests`, `--features test-fixtures` and `--features streamline-vk,test-fixtures`) and `rustfmt`; nothing built through CMake, tested or run. Non-blank lines, tests included, C++ tests on the C++ side: + +| Module | C++ | Before | After | +| --- | ---: | ---: | ---: | +| Shader patch (`shader_patch*`, `runtime/shader_patch`) | 1,008 | 4,075 | 2,988 | +| D3D12 Streamline host (`streamline_host*`) | 1,281 | 3,579 | 2,244 | +| DLSS-G present capture (`dlss_vulkan_capture*`) | 290 | 1,647 | 887 | +| Native scene identity | 130 | 348 | 220 | +| Sampler bias | 123 | 290 | 149 | +| Native SR | 442 | 629 | 558 | +| DLSS pipeline (read, unchanged) | 1,838 | 4,094 | 4,093 | +| Whole area | | 43,024 | 39,501 | + +- **Shader patch.** Removed: the `leaf.rs` records (`CompileCall` with include, code and error sinks; `ReflectionSink` with five callbacks and `BindingRecord`/`ParameterRecord`) and the `platform.rs` leaves behind them, which existed so `tests.rs` could swap in a fake compiler, reflector, device and MinHook; the owner calls `D3DCompile` (through `rsf-shader-compiler`), `D3DReflect`, `D3DDisassemble`, the D3D11 device and MinHook directly, as `service.cpp` and `d3d11.cpp` did. The fake-leaf session, cache, hook, dump and short-record tests went with them (the C++ had none; the WARP device fixture still drives the real path), and a duplicate JSON-reader test in `pack.rs`. Kept: the single admitted root record, the dump report of incomplete inventories, the hook rollback that keeps live trampolines, the unique cache temporary name (G06 fixes), the `serde_json` reader that replaces yyjson, and the pack, source-rule, reflection-comparison and DXBC tests. +- **D3D12 Streamline host.** `dlss_generation.cpp` kept the interposer, its entry points, the proxy and native graphics objects and the frame tokens in one `rsf_streamline_host`. The port split that into a Rust `Host` and a native `Native` reached through a 25-entry `Startup` table, a 24-entry `Platform` table and a `CommonPresent` table, with an `entries` bitset mirroring which feature functions the native side held, `InitPreferences`/`Opened`/`Request`/`Observed`/`Reflex` hand-over records, a `rsf_core_slhost_*` layer under every `rsf_streamline_host_*` export, a static ring snapshot and fake-table tests (`streamline_host/tests.rs` and the fake half of `generation/tests.rs`). Removed all of that: one `Host` owns the state and calls the SDK directly; `startup.rs` opens it, `generation.rs` is the DLSS-G provider. The DLSS-G feature functions, which a plugin reload replaces, sit under one lock instead of being rewritten through a `&mut` alias. Kept: the token ring with monotonic SDK indices, marker ordering and the controller and ping rules, the Reflex lock split between the sleeper and Present-side markers, the configure retry that reconciles a failed generation request, the abort-wins `Copied` snapshot and its two C++-derived tests, the fallible host allocation and the shutdown order. +- **DLSS-G present capture.** Removed: 17 of the 24 `Platform` entries (pool, command buffer, fence, begin/end, image query, submit, present, registration, readback completion, target and close) and their wrappers in `leaves.rs`; the owner records, submits and presents with ash and the packet's entries as the C++ `observe` did. `owner_tests.rs`, which faked every entry, went with them. Kept: the seven frame-capture and file entries the DLSS-G fixture (`vulkan_dlss_fg/fixture/sdk.rs`) replaces, the ledger's token-range and collision fixes with their tests, the per-family fence proof and the unsubmitted-readback guard. +- **Native scene and sampler bias.** Removed: the resource- and backbuffer-identity callbacks threaded through an `rsf_core_native_scene_*` layer, and the generic `Cache` prepare/commit split with vtable wrappers in `sampler_bias.rs`, both there only for unit tests the C++ did not have. Both now read COM identity and call the context and device directly with the C++ checks and order. +- **Native SR.** Removed: about forty `cfg(not(test))` gates and the region-preparation function argument, which let one unit test inject a refusal; `prepare` is called directly and the module compiles whole in tests (the pipeline's export module now compiles there too). Kept: the overflow-safe extent test. +- **Read and left.** `dlss_pipeline` is 1.27x the C++ outside its tests; its `cfg(test)` leaf alias costs one line and its 17 fake-leaf tests assert C++ behaviour and fixed findings (refused start teardown, the zero-range fallback, reentrant frame calls, resize ordering). `dlss_streamline`, `dlss_native12`, `auxiliary_sr` (its tests port `tests/auxiliary_sr.cpp`), `shared_surface`, `frame_tap`, `texture_dump` and `d3d11_state` are within 1.0-1.9x of the C++ with tests; the remainder is the C API layers, rustfmt and explicit `unsafe`. `native_regions`, `native_translucency` and `native_cpu` were compared in a second round (below). +- **Second round: regions, translucency, CPU facts.** `native_regions` (C++ 409, Rust 1,011 with the HLSL moved to `composition_shaders/`): a direct port; the depth-domain validation is the C++'s, statement for statement, and the typed owners (`RegionShaders`, `RegionOutput`, `TemporalMask`) replace the C++ `Resources` fields one for one. Removed: `native_regions.h` and `native_reinsert.h`, kept only so `native_composition_unload.c` could call two release functions (it now declares them, as it already did the exposure release), and the export marks on the two region entries only Rust calls. `native_translucency` (C++ 304 + 125 test, Rust 951 with nine tests): kept the COM-free `Ledger` (it carries the session-keyed lease fix, the closed-frame rule that keeps a refused frame from holding cloud composites, and the double-buffered cloud slot) and `Exclusive`, which refuses reentry instead of holding the C++ mutex across driver calls; its tests port `tests/native_translucency.cpp`'s cases or pin those fixes. `native_cpu`, `cpu_reservations` and `input_receipts` (C++ 581 + the 37-line header, Rust 1,631 with tests): the C++ functions one for one, with the reservation book split into its own module and the C++'s dense conditions under rustfmt; no port-only machinery found. `native_fg_cpu` is in the D3D12-FG area. + +### C++-reference pass: cppref-games-c + +Method: `games/rdr2`, `games/skyrim-se`, `games/project-wingman` and `games/minecraft` (native) read module by module against the C++ on `main` (`games/*/src/*.cpp`, `*.h`, `games/minecraft/native/jni.cpp`, `tests/rdr2_*.cpp`, `tests/skyrim_*.cpp`, `tests/wingman_camera.cpp`). Additions were kept as an R01-R03, S01-S02, W01 or M01 finding fix or a real FFI need, and removed as port overhead otherwise. Checked with `cargo check` of `rsf-skyrim-se` (lib, `--tests`, `--features fixtures`) and `rsf-rdr2` (lib, `--tests`, `--features research --tests`, `--features capture-fixture`; `build.rs` compiles the C leaves) and `cargo fmt`; nothing was built through CMake, tested or run in a game. Lines (raw, tests included, C++ tests on the C++ side): + +| Module | C++ | Rust and C before | after | +| --- | ---: | ---: | ---: | +| RDR2 startup, settings, input, Social Club | 1373 | 3566 | 3566 | +| RDR2 renderer, camera, scene | 1312 | 3817 | 3768 | +| RDR2 native capture | 1100 | 5223 | 5047 | +| Skyrim CPU events and input ownership | 1226 | 3505 | 3392 | +| Skyrim lifecycle, creation, compatibility | 1255 | 3085 | 3044 | +| Skyrim rendering and presentation | 1042 | 3401 | 3375 | +| Project Wingman | 722 | 1445 | 1445 | +| Minecraft native | 156 | 1049 | 1049 | +| total | 8186 | 25091 | 24686 | + +- **RDR2 native capture.** `native_capture.cpp` kept submissions, draw bindings, pipeline facts, the evaluating `Temporal` and readback paths as plain values in one `State`. The Rust owner kept the shapes of its former C exports between Rust modules. Removed: the submission boxed into a raw pointer with `discard_submission` (now `Option` on the queue-call stack, the census list array read once at its callback); the null-means-unknown `*const Pipeline`, the first-RTV handle pointer, the out-param-plus-bool draw binding, shader hash, `begin_input`, `input_result` and pipeline facts (Options); the null-or-pointer feature flags and camera sample; the `extern "C"` scalar reader with an `f64` out-param (a closure); the `*const Capture` owner identity stored in the evaluation thread-local (the C++ had one `g`); the directory passed as pointer and length and rebuilt on every write (a `PathBuf`); roles as C strings re-validated as ASCII lowercase (`&str` constants); the Map HRESULT out-param (`Result`); `repr(C)` and offset asserts on `Pipeline`, `DrawBinding`, `Draw`, `Image`, `PresentationDesc`, `InputId`, `CameraFacts`. Kept as fixes (R03): the detached bundle, per-target hook identity, pipeline-known flag, wildcard alias invalidation, reset retirement, device-removal retirement, the shared F10 edge, the bounded directory, `try_entry`, the one-pass NGX scalars and the worker-start report, with their tests and the fake D3D12 leaves those tests need (`gpu_leases` and `shots` tests use null-pointer leases, so the hand-counted `Com` references stay). +- **RDR2 renderer, scene.** Removed: `extern "C"` on the 14 Rust-only leaves in `native_platform.rs` (the four naked detours keep it); the out-param `ResourceFacts` with private padding pinned to 24 bytes (the R02 High test-build break came from that padding); the three-out-param swapchain reader; the module path copied into a caller's NUL-terminated buffer (`module_at` returns base and `String`). Kept: every R02 fix (FSR flags from creation, local reset copy, history transition, queue/swapchain revalidation, input observation independent of pacing, resource-free retained pass, WINDOW receipt identity). Native engine records (`Evaluation`, the RSFCAM1 `Snapshot` file record, `SettingsPath`) keep `repr(C)`. +- **RDR2 startup, settings, input.** Read and left: the extra size is the R01 fixes (saved overlay rows for the startup and diagnostic keys, the retained refused session, adapter detection retry, both-collection quality publication) and real FFI (the C `DllMain` shells and the services table, the census and RenderDoc links, engine call adapters). +- **Skyrim CPU events.** Removed: `repr(C)` and size asserts on `JobTicket`, `Stamp`, `PollTicket`, `PollScope`, `PollProvenance`, `Reservation`, `Reserve`, `WorkerCounts`, `RenderState`, `FrameInput`, `RenderReceipt`, `Services`, `StartRefusal` and `repr(u32)` on Rust-only enums; the eight `sources_*` free-function wrappers over the `ProspectiveSources` slots (one `sources()` guard, never held across a host callback); the CPU start refusal stage carried as a C string. Kept: the C detour shells and their scope storage (FFI: SEH `__finally` around engine calls), the nested render-scope receipt and the atomic poll completion (S01 fixes) with their thread tests, and the input fixture that ports `tests/skyrim_input.cpp`. +- **Skyrim lifecycle, creation.** Removed: the `struct_size`/`version` header on the creation detour's stack record (two parts of one DLL), its `valid()` check and the test of it; the C++ guards in the C-only `postprocess_platform.h`, `render_observer_platform.h` and `native_creation_platform.h`. Kept: the S01 session fixes (activation result, rollback visibility, quiesced restart refusal, single CPU preparation), the Community Shaders initializer handoff, the shared owner predicate. +- **Skyrim rendering, Wingman, Minecraft.** Read and left. Skyrim's camera, render inputs, resolution, sampling and auxiliary code are the C++ logic plus the S02 fixes (output-scope dependence, TAA restore receipt, upload flags bound to their frame, missed-publication reset, window-begin outcome) and the guarded host calls. Wingman's excess is the W01 graph-lifetime retirement (two extra hooks), jitter validation, retryable start and the C texture and host guards. Minecraft's is the M01 settings store and status generator, the UTF-16 path handling and the observer exports the GL fixture links. + +Left, and why: RDR2 capture still splits the C++'s one `State` and mutex into `Native` plus a `Capture` of five `UnsafeCell` sub-owners guarded by a separate `Mutex<()>` (about 70 cell accesses; about 450 capture lines carry `unsafe`). Folding them into one `Mutex` would remove most of that `unsafe` but few lines, and needs split borrows inside `draw_shot` and the submission path; it was not done without a capture fixture run. The capture fixture driver (684 lines) ports the 185-line `tests/rdr2_capture.cpp` WARP test with the `windows` crate. The rest of the excess over the C++ is rustfmt splitting of the C++ one-line predicates, explicit `unsafe` and guarded reads, doc comments, the finding fixes and their tests. + +### C++-reference pass: cppref-godot + +Method: `integrations/godot` compared against the C++ on `main` (`native/runtime.cpp`, `vulkan.cpp`, `vulkan_creation.cpp`, `effect.cpp`, `runtime_control.cpp`, `extension.cpp`, `tests/godot_vulkan_creation.cpp`, the engine module). Each addition was kept only as an E01-E03 fix or a real FFI need. Checked with `cargo check -p rsf-godot` and `--tests`, `cargo clippy -p rsf-godot --tests` and `cargo fmt`; nothing built through CMake or SCons, nothing run. `runtime_platform.c` was edited without compiling. Lines (all lines, tests included; C++ tests on the C++ side): + +| Module | C++ | Before | After | +| --- | ---: | ---: | ---: | +| Control, D3D12 and window (`control`, `d3d12`, `window`, `runtime`, `lib`, the former `host`, `platform`, `platform/fake`; `runtime_platform.c`, `api.h`, `exports.def`) | 585 | 4,932 | 2,078 | +| Vulkan session (`vulkan`, `vulkan/capture`, the former `vulkan/native`, `vulkan/sr`; `vulkan_features.h`) | 618 | 3,256 | 1,546 | +| Vulkan creation (`vulkan_creation` with `chain` and its fixture, the former `typed`, `vulkan_negotiation`) | 588 | 3,078 | 1,353 | +| GDExtension classes (`gdextension*`, `effect`, the former `extension`, `properties`) | 413 | 3,197 | 2,538 | +| Engine module (`modules/rescaleframe`, `tests/godot_graph_handoff*`) | 1,146 | 5,324 | 5,324 | +| Build (`Cargo.toml`, `build.rs`, `CMakeLists.txt`) | 27 | 81 | 84 | +| Total | 3,377 | 19,868 | 12,923 | + +Bytes: 196 KB on `main`, 726 KB before, 493 KB after. + +- **Control, D3D12, window.** Removed as port overhead: the `Platform` seam, a unit type whose methods were `host.rs` in the DLL and the 583-line `platform/fake.rs` under `cfg(test)`, with the records it existed to carry (`FgFacts`, `LatencyFacts`, `InputFacts`, `WindowFacts`, `WindowIdentity`, `SrFrame`, `SrCreate`, `SrContext`, `SrEvaluate`, `FgInstall`, `FgOptions`, `Paths`); the binding split between the ledger's addresses and `host.rs`'s COM statics; the `Control` aggregate and its `CONTROL` static; the hand-written `api.h` mirrors (`Settings`, `Status`, `Setup`, `EngineServices`, `CpuService`) with their Rust offset asserts and the `_Static_assert`s in `runtime_platform.c`, which are bindgen output now (`build.rs` adds `native_cpu_service.h`). As in `runtime.cpp`, the session, the ledger (with its device, queue, fence and capture owner) and the window state are statics of their modules and call the Runtime, D3D12, DXGI and Win32 themselves. Kept as fixes: the binding published only with its fence (E02), the Present receipt committed only by a recorded pass (E02), HUD-less admission on the source's SR slot (E02), the per-window subclass forwarding and `WM_NCDESTROY` release (E02), the Runtime CPU service with the explicit Present receipt (E02), the latency owner's availability and mode (E02), the shared vendor paths and presentation result (E02), size-first ABI checks (E02), the leaked boot paths and the reentrant-boot gate. Tests: `control/tests.rs`, `d3d12/tests.rs` and `window/tests.rs` drove the fake; the C++ had no tests of these paths. +- **Vulkan session.** Removed: the state split across `Vulkan` (settings and status), `sr::Contexts` (a second mutex, copied out and back around every pass), `vulkan/native.rs`'s `STATE` and `GUARD` and the `Platform` Vulkan methods; the `VkFacts`, `VkLatencyFacts`, `VkView`, `VkPresentFacts`, `VkSrFrame`, `VkSrPass`, `VkSrCreate`, `VkSrContext` records, the `VK_LOG_*` codes and the `SR_EVALUATED`/`SR_REFUSED` outcome words; the pass record lent back to the leaves as `*mut c_void`. As in `vulkan.cpp`, one lock is the session's guard and holds settings, status, presenter, SR session and capture; `vk_capture_present` still skips it while it is held. Kept as fixes: the Runtime-owned SR session, continuation and spatial fallback (E03), the Runtime Auto policy over the session's capability facts and device receipt (E03), the per-pass FG outcome including a missing presenter (E03), presenter-owned guide recreation (E03), one presenter drain per shutdown (E03), best-effort diagnostics that never change the outcome (E03). `vulkan/capture.rs` (the frame dump, the former `FrameCaptureVk` use) is unchanged. Behaviour note: status and settings reads now wait for the guard, as the C++ did; the port read them under a separate lock. Tests: `vulkan/tests.rs` and `vulkan/sr/tests.rs` drove the fake. +- **Vulkan creation.** Removed: the 14-entry `VkCreationLeaves` table and its recording fakes (`creation/tests.rs`, 880 lines), the route constants and scopes, `VkInstanceCall`, `VkDeviceCall`, `VkDeviceDerive`, `VkChainFacts`, `VkLatencyRequirements`, the `VK_XESS_*` structure flags, the `VK_STAGE_*` slots, the `DeviceNegotiation` generic and the `Creation` object. `vulkan_creation.rs` has the C++ shape again: one resolver, one device proc, and `create_instance`, `create_device` (XeSS, interop, latency stages) and `destroy_device` over the Rust chain copy, whose clone now answers `contains` itself. Kept: the per-device readiness and adapter receipts (E03), the checked extension merge shared with Unity (E03), the Runtime latency negotiation. Tests: the typed fixture, the port of `tests/godot_vulkan_creation.cpp`, stays and drives the real entries. +- **GDExtension classes.** Removed: `extension.rs`'s option schema (`OptionField`, `OptionValue`, 21 index constants, `compose`, the admission bits), `properties.rs` (`Property`, `Properties`), `effect.rs`'s leaf indirection (`leaf_frame`, `leaf_resources`, `leaf_read_motion`) and the `EffectFrame`, `EffectResources`, `EffectStatus`, `EffectReadback` records, with their tests. As in `runtime_control.cpp` and `effect.cpp`, `configure` reads each option from the Dictionary and `get_status` writes the Dictionary directly. Kept: the interface binder (`api.rs`, `sys.rs`), which replaces godot-cpp on the C interface (FFI), and the readback classification with its tests. +- **Engine module.** Read and left. Its C++ halves call Godot's private engine members and the SCons `no_std` object cannot be checked here; the Rust decision owners and their C linkage are the port's FFI form, and the committed bindgen mirrors stay (round 2). The `native.rs` export table with about thirty gated forwarders between `bridge.cpp` and the DLL is the largest port-only layer left in the area (about 650 lines with `native.h`). + +### C++-reference pass: cppref-anomaly + +Method: `games/anomaly` compared against the C++ on `main` (`games/anomaly/src/*.cpp`, `*.h`, `temporal/*.h`, `tests/anomaly_*.cpp`). Each addition was kept only as an N01-N08 fix or a real FFI need. The shape found first was the Fallout 4 one in a smaller form: state the C++ kept in one owner (`HookSet`, `native_observer.cpp`, `motion_stage.cpp`'s engine reads) had been split so that Rust called a C leaf which called straight back into Rust, or C called Rust through a table of C wrappers that called back into C. Checked with `cargo check -p rsf-anomaly` (`--tests`, `--features native-entry`, both together, `--all-features --tests`, `--all-features --examples`), `cargo check -p rsf-game-sdk-fixtures --all-features` and `cargo fmt`; every C leaf and every `tests/anomaly_*.c` launcher was syntax-checked with `cl /Zs /W4 /std:c11` (this crate's `build.rs` does not compile the leaves). Nothing was built through CMake or run. Lines (all lines of `.rs`, `.c`, `.h`, `.cpp` and `.def` under `games/anomaly` and `tests/anomaly_*`, tests included; C++ tests on the C++ side; shader headers excluded): + +| Module | C++ | Rust and C before | after | +| --- | ---: | ---: | ---: | +| Startup, observer, hook set, shared leaves (N01) | 1,093 | 5,968 | 5,591 | +| Input and overlay (N02) | 2,286 | 4,699 | 4,647 | +| Geometry (N03) | 2,297 | 5,086 | 5,087 | +| Motion and foliage (N04) | 7,878 | 14,278 | 14,071 | +| Shader loading (N05) | 1,308 | 4,591 | 4,591 | +| SR stage, D3D11 pass, reconstruction (N06) | 5,171 | 14,838 | 14,785 | +| SR swap, jitter, temporal history (N07) | 5,646 | 8,713 | 8,713 | +| Frame generation (N08) | 1,724 | 4,784 | 4,784 | +| Total | 27,403 | 62,957 | 62,269 | + +Bytes: 1,527 KB on `main` (the C++ is dense: 56 bytes a line), 2,183 KB before, 2,153 KB after. + +- **Hook set (N01).** Removed as port overhead: C detour leaves called `rsf_anomaly_hooks_*` in `native_hooks_platform.c`, which called the Rust `rsf_anomaly_hook_set_*` with `rsf_anomaly_native_hook_platform`, whose entries were C wrappers that called the Rust `rsf_anomaly_hook_read_mapped`/`_read_dos`/`_read_pe` back with the C guarded copy, and the MinHook calls. The `rsf_anomaly_hook_platform`, `rsf_anomaly_image_headers`, `rsf_anomaly_dos_facts` and `rsf_anomaly_pe_facts` records, `native_hook_ops.h`, `rsf_anomaly_minhook_ops` and `rsf_anomaly_guarded_image_headers` are gone. As in `native_hooks.cpp`, the hook set reads the PE headers and calls MinHook itself (`rsf-minhook-sys`, linked unbundled, so the CMake binaries keep their one `minhook` target); the `rsf_anomaly_hooks_*` C entries are the Rust functions; `HookOps` is a Rust struct (`MINHOOK`, or the rollback tests' fakes) and the overlay C launcher no longer projects a MinHook table. `native_hooks_platform.c` keeps only `rsf_anomaly_guarded_copy`, the one export of the SEH copy (`engine_guards::guarded_copy`, a plain copy under unit tests), which also replaces the observer, SR and motion copy leaves. `engine_guards.h` lost its last includer and is gone. Kept as fixes: the transaction lock across sets (`MH_ApplyQueued` drains the whole queue), `disable` clearing `enabled` even when apply fails (the C++ kept `enabled_` and the next `enable()` returned true without enabling), the rollback that keeps originals once a batch could be reachable. Tests: the rollback cases and the native fixture (the port of `tests/anomaly_native_hooks.cpp` plus the mapped-region and profile cases) are kept and drive the new functions; the fakes serve header bytes instead of the removed fact records. +- **Observer (N01).** Removed: Rust called `rsf_anomaly_observer_native_identify`, `_enable_hooks`, `_read_frame`, `_copy`, `_install_geometry`, `_install_sr`, `_install_motion`, `_enable_input` and `_disable_input` in C, and C called `rsf_anomaly_observer_identify`, `_install` and `_read_frame` back in Rust with the C guarded copy and header table; the C installs forwarded to `rsf_anomaly_sr_install_native` and `rsf_anomaly_motion_install_native`, which forwarded to Rust again. The `rsf_anomaly_observer_binding`, `_engine`, `_frame` and `_camera` C records and `stage_entries.h` (with the SR and motion configure forwarders the bootstrap called) are gone. As in `native_observer.cpp`, admission, the frame read and the hook batch are the observer's; `native_observer_platform.c` keeps the eight detours, their unwind scopes and exports the detour and trampoline tables. Kept as fixes: the retirement state machine, the in-flight counting of inactive invocations and the frame-open check before SR teardown (N01). +- **Motion stage (N04).** Removed: the C copy of `rsf_anomaly_motion_engine` and the eleven read leaves over it (device, context, render target, backend, frame, options word, camera, world, render view, position views, draw-method resolution), two of which called Rust back (`rsf_anomaly_motion_position_views`, `rsf_anomaly_motion_resolve_draws`) with the guarded copy; the C flush adapter that copied the geometry draw facts into a second record (`rsf_anomaly_motion_draw_facts`) for Rust; the C hook sets; the copy, include-copy and engine-read leaves; the position-pair and target-info records; and about a hundred lines of unit-test stand-ins. As in `motion_stage.cpp`, the stage reads the engine itself (`motion/stage/native.rs`), owns both batches and registers its flush with the geometry producer directly; `motion_stage_platform.c` keeps the detours, their unwind scopes and the SEH includer. +- **SR stage (N06).** Removed: the C hook set and its `install_hooks`/`hooks_created`/`enable_hooks`/`disable_hooks` forwarders; `sr_stage/native.rs` installs the leaf's exported detours. Kept: the SEH engine calls, the position-binder slot detour. +- **Bootstrap (N01).** Removed: the bootstrap called `rsf_anomaly_bootstrap_input_hook` in C only for C to pass its detour, the slot exchange and the guarded copy back to `rsf_anomaly_bootstrap_install_input`; Rust names the exported detour and exchange. Kept as fixes: the per-hook input installation state and the partial-session retirement (N01). +- **Read and left.** Geometry (N03): its C leaf passes a six-entry platform table and a capture writer to every Rust entry; folding the reads into Rust would remove about 150 lines but changes the C API that `tests/anomaly_geometry_hooks.c`, `anomaly_geometry_tests.c` and `anomaly_motion_hooks_native.c` bind, which cannot be built here. FG (N08): `EngineBindings`/`rsf_anomaly_fg_platform` is the seam the FG device fixture fills. Overlay and input (N02), shader loading (N05), SR swap and temporal (N07): the remaining excess is review-finding fixes and their tests (N02, N05, N07), the fixture ports and rustfmt line splitting of the C++'s dense one-line style. `docs/research/rust-anomaly-startup-n01.md`, `rust-anomaly-motion-stage.md` and `rust-anomaly-sr-d3d11.md` still describe the removed C entries as port history. + +## Scope + +- **375 C++ implementation files**, including 168 under `tests/`. All have the `.cpp` suffix in this revision. +- **418 headers and 2 supporting files** to review with their callers. This includes inline implementations, private callback tables, C ABI declarations and shader data stored in C++. +- **9 additional files** containing C++ patches or a generated C++ test fixture. These entries appear with their owning components. + +Check off a path when its C++ has been ported or removed. For a header containing only C declarations or a file containing only data, record that finding when closing the item. Keep any remaining first-party C++ unchecked and identify the exact caller and technical constraint if the port is blocked. + +Coverage includes tracked fixtures, tools, and the bundled MFG unlocker sources. Upstream provenance and licensing are recorded in [the dependency notes](docs/dependencies.md). The scope excludes standalone C translation units, shader-only files, build outputs, and untracked dependency and reference checkouts. + +## Files by area + +| Area | C++ implementations | Headers | Supporting files | +| --- | ---: | ---: | ---: | +| `apps/` | 1 | 0 | 0 | +| `cmake/` | 0 | 0 | 1 | +| `games/` | 67 | 151 | 0 | +| `integrations/` | 17 | 22 | 0 | +| `loader/` | 18 | 14 | 0 | +| `runtime/` | 103 | 218 | 1 | +| `sdk/` | 0 | 4 | 0 | +| `tests/` | 168 | 7 | 0 | +| `tools/` | 1 | 1 | 0 | +| `ui/` | 0 | 1 | 0 | +| **Total** | **375** | **418** | **2** | + +## Rust code review + +All five reviews covered the 538 tracked Rust files and 244,697 lines at `1605ae07`, including standalone crates, build scripts, tests and generated bindings. Each review ledger contains one file-specific observation for every path in the Git manifest. The source links point to `894a55f9`, which has identical Rust files. Severity reflects source inspection. Build, test and device confirmation remain separate. + +| Focus | Files reviewed | High | Medium | Low | Open findings | +| --- | ---: | ---: | ---: | ---: | ---: | +| Quality | 538 | 5 | 23 | 7 | 35 | +| Level of abstraction (Altitude) | 538 | 6 | 158 | 22 | 186 | +| Simplicity | 538 | 0 | 3 | 53 | 56 | +| Duplication | 538 | 0 | 116 | 78 | 194 | +| Architectural boundaries | 538 | 0 | 30 | 7 | 37 | +| **Total findings** | | **11** | **330** | **167** | **508** | + +The counts refer to finding entries. Related entries across review areas may share a root cause. One withdrawn Altitude finding is annotated in the Vulkan Streamline chunk and excluded from the counts. + +## C++ introduced during the port + +A sweep of `git ls-files '*.cpp'` on 2026-11-22 found first-party C++ that the port itself added and that no chunk lists. Each belongs to the chunk named after it. + +- [x] [games/project-wingman/src/native_platform.c](games/project-wingman/src/native_platform.c) (W01; C++ removed, C11 SEH leaf for MinHook, the RHI texture probe, the execution report and the GameSDK export) +- [x] [games/skyrim-se/src/render_detours.c](games/skyrim-se/src/render_detours.c) (S02; C++ removed, C11 leaf, `__try/__finally` scopes, filter on 0xE06D7363; observer_platform.h and session_platform.h now hold C declarations only) +- [x] [integrations/steam/src/exception_guards.c](integrations/steam/src/exception_guards.c) (I01; C++ removed, C11 SEH leaf that contains only 0xE06D7363) +- [x] [runtime/graphics/src/observer_exception_guards.c](runtime/graphics/src/observer_exception_guards.c) (G01; C++ removed, C11 SEH leaf; the three private observer headers now hold C declarations only) +- [x] [runtime/orchestrator/src/d3d11_host_foreign.c](runtime/orchestrator/src/d3d11_host_foreign.c) (D01; C++ removed; C11 SEH leaf that contains only the MSVC C++ exception code 0xE06D7363, entries that were noexcept without a handler abort on that code) +- [x] [tests/ac7_render_scope_exceptions.cpp](tests/ac7_render_scope_exceptions.cpp) (A02; the throwing callbacks are C in `tests/ac7_render_scope.c` and raise the MSVC C++ exception code) +- [x] [tests/anomaly_motion_contract_main.cpp](tests/anomaly_motion_contract_main.cpp) (N04; now the C11 launcher `tests/anomaly_motion_contract_main.c`, the caller-frame layouts come from `motion_profile.rs`) +- [x] [tests/anomaly_sr_swap_profile.cpp](tests/anomaly_sr_swap_profile.cpp) (N07; removed: the swap launcher takes the Rust engine layout built from sr_profile.rs, `rsf_anomaly_sr_engine_layout`) +- [ ] [tests/dlss_sr_layout_facts.cpp](tests/dlss_sr_layout_facts.cpp) (D05; C++-only vendor header layout check; blocked: `sl.h` declares `sl::` types with constructors and a virtual member, so the layout, GUID and default checks need a C++ compiler. It holds `static_assert`s against the pinned headers and two reporting functions that `dlss_sr_layout_main.c` hands to the Rust comparison in `streamline_sr/sdk/layout_fixture.rs`; test only, no runtime caller) **Kept:** `tests/dlss_sr_layout_facts.cpp` is compiled with `tests/dlss_sr_layout_main.c` as `rsf_dlss_sr_layout` (`tests/CMakeLists.txt:426-429`) and includes `runtime/vulkan/streamline/sdk_records_checks.h` (`:16`); `sl.h` is C++ only, so a C++ translation unit is the only way to run its `static_assert`s. Verified: `sl.h` declares `namespace sl`, and `sl::FrameToken` has `virtual operator uint32_t() const` (`sl_core_types.h:608`). + +## Core, loader and overlay + + + +### C01 · GameSDK, contracts and plugin sessions + +Resolve shared ABI, session, option and provider contract findings at their owner and port the associated interfaces and fixtures. + +**Coordinate shared edits** + +- Versioned GameSDK events, host callbacks and session leases ([C02](#c02), [C04](#c04), [C05](#c05)). + +**Port files (12)** + +- [x] [runtime/contract/include/rescaleframe/backend.h](runtime/contract/include/rescaleframe/backend.h) +- [x] [runtime/contract/include/rescaleframe/backend_registry.h](runtime/contract/include/rescaleframe/backend_registry.h) +- [x] [runtime/contract/include/rescaleframe/frame_generation.h](runtime/contract/include/rescaleframe/frame_generation.h) +- [x] [runtime/contract/src/negotiate.cpp](runtime/contract/src/negotiate.cpp) +- [x] [runtime/orchestrator/include/rescaleframe/plugin_session.h](runtime/orchestrator/include/rescaleframe/plugin_session.h) +- [x] [runtime/orchestrator/include/rescaleframe/runtime.h](runtime/orchestrator/include/rescaleframe/runtime.h) +- [x] [runtime/orchestrator/src/plugin_callbacks.c](runtime/orchestrator/src/plugin_callbacks.c) (C++ removed; C11 SEH leaf that contains only the MSVC C++ exception code 0xE06D7363) +- [x] [runtime/orchestrator/src/rust_export.h](runtime/orchestrator/src/rust_export.h) +- [x] [sdk/game/include/rescaleframe/game_api.h](sdk/game/include/rescaleframe/game_api.h) +- [x] [sdk/game/include/rescaleframe/game_frame.h](sdk/game/include/rescaleframe/game_frame.h) +- [x] [sdk/game/include/rescaleframe/game_plugin_util.h](sdk/game/include/rescaleframe/game_plugin_util.h) +- [x] [sdk/game/include/rescaleframe/game_renderer.h](sdk/game/include/rescaleframe/game_renderer.h) + +**Fixtures (6)** + +- [x] [tests/negotiate.cpp](tests/negotiate.cpp) +- [x] [tests/orchestrator_domains.cpp](tests/orchestrator_domains.cpp) +- [x] [tests/plugin_contract.cpp](tests/plugin_contract.cpp) +- [x] [tests/plugin_session.cpp](tests/plugin_session.cpp) +- [x] [tests/plugin_session_fixture.cpp](tests/plugin_session_fixture.cpp) +- [x] [tests/plugin_session_fixture_throw.c](tests/plugin_session_fixture_throw.c) (deliberate foreign exception fixture; C11, raises the C++ exception code since C cannot throw an object) + +**Rust review findings (3)** + +- [x] **Altitude | Medium | Make the negotiation contract's fallback independent of capability-table order.** backend_registry.h permits callers to order capability records arbitrarily. With no preferred vendor, choose_fg and choose_sr use the first available matching record, so permuting identical capabilities changes the selected provider. The current consumer is tests/negotiate.cpp via the C shim. Apply an explicit deterministic preference among viable candidates (or declare caller-supplied ranking) and test the same request with reordered records. [runtime/contract/src/lib.rs:117](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/contract/src/lib.rs#L117) + +- [x] **Boundaries | Low | Retire or wire up the unused vendor negotiation contract.** rsf_contract_negotiate implements a vendor-neutral SR/FG/UI/latency choice, but its only native caller is the forwarding shim rsf_negotiate in runtime/contract/src/negotiate.cpp:12, and rsf_negotiate is called only by tests/negotiate.cpp. The Runtime actually chooses SR backends through rsf_gpu_select_sr_backend (runtime/orchestrator/src/lib.rs:385, used by callback_host.rs:798, d3d11_host.rs:663 and render_host.rs:529) and FG providers through fg_choice.rs. AGENTS.md Rule 3 asks for one implementation of backend choice; here a second, divergent policy (bridge routing, UI-mode fallback, NEEDS_RESTART) is maintained and tested while production follows another, and the only reason negotiate.cpp remains first-party C++ is to rename one symbol. Either route the orchestrator backend choice through this contract and export rsf_negotiate directly from Rust, or delete the crate, the shim, backend_registry.h negotiation types and tests/negotiate.cpp. [runtime/contract/src/lib.rs:192](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/contract/src/lib.rs#L192) + +- [x] **Duplication | Low | Share Windows absolute-path admission for plugin and FidelityFX loading.** Plugin preparation, FSR4 FG probe/create at runtime/orchestrator/src/fsr4_fg_bridge.rs:711 and the standalone FSR4 SR owner at runtime/vulkan/fsr4/owner.rs:287 all hand-parse the same UTF-16 drive or UNC prefix. Each accepts a colon and separator after any first code unit, so even `1:/vendor` passes this gate and only fails downstream as a loader error. Vulkan timing implements the prefix yet again at runtime/orchestrator/src/vulkan_timing.rs:27 with its own length limit. Use one Windows path-component predicate for a rooted drive or UNC path, retaining caller-specific bounds and the SR owner's optional default-directory route. [runtime/orchestrator/src/plugin_session.rs:110](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/plugin_session.rs#L110) + + + +### C02 · Render host and frontend + +Port control and rendering callbacks, session selection and frontend wiring across linked and DLL consumers. + +**Coordinate shared edits** + +- Versioned GameSDK events, host callbacks and session leases ([C01](#c01), [C04](#c04), [C05](#c05)). +- Shared settings, frontend requests and live overlay state ([C03](#c03), [O02](#o02)). + +**Port files (8)** + +- [x] [runtime/orchestrator/include/rescaleframe/callback_render_host.h](runtime/orchestrator/include/rescaleframe/callback_render_host.h) +- [x] [runtime/orchestrator/include/rescaleframe/native_window.h](runtime/orchestrator/include/rescaleframe/native_window.h) +- [x] [runtime/orchestrator/include/rescaleframe/render_frontend.h](runtime/orchestrator/include/rescaleframe/render_frontend.h) +- [x] [runtime/orchestrator/include/rescaleframe/render_host.h](runtime/orchestrator/include/rescaleframe/render_host.h) +- [x] [runtime/orchestrator/include/rescaleframe/render_links.h](runtime/orchestrator/include/rescaleframe/render_links.h) +- [x] [runtime/orchestrator/src/callback_render_host_platform.cpp](runtime/orchestrator/src/callback_render_host_platform.cpp) +- [x] [runtime/orchestrator/src/native_window_platform.cpp](runtime/orchestrator/src/native_window_platform.cpp) +- [x] [runtime/orchestrator/src/render_host_platform.c](runtime/orchestrator/src/render_host_platform.c) (C++ removed; C11 SEH leaf for the Streamline native-interface call) + +**Fixtures (4)** + +- [x] [tests/callback_host_abi.cpp](tests/callback_host_abi.cpp) +- [x] [tests/native_window.cpp](tests/native_window.cpp) +- [x] [tests/render_frontend.cpp](tests/render_frontend.cpp) +- [x] [tests/render_links.cpp](tests/render_links.cpp) + +**Rust review findings (14)** + +- [x] **Boundaries | Medium | Take the engine spatial upscaler ratios from the adapter, not a Runtime table.** The shared callback render host hard-codes "the engine's spatial upscaler scale by quality index" (SPATIAL_RATIOS = 1.0/1.5/1.7/2.0/3.0/1.3) and, for backend 6, derives the render extent it publishes through render_config from that table (prepare at :812-818), logging "FSR1 selected through the engine's own spatial upscaling path". The only consumer is Unity Mono (games/unity-mono/src/runtime_host.cpp:54), so these are Unity URP spatial-upscaler facts living in the Runtime; the adapter's set_engine_spatial callback (games/unity-mono/src/bridge_state.rs:295) is told only (spatial, quality) and never reports the extent its engine actually renders at. AGENTS.md Rule 1 keeps engine quality conventions in the integration and Rule 3 has the integration report facts. If a second engine adopts this host, or URP changes a preset, the Runtime publishes a render size the engine does not use. Have set_engine_spatial (or a new appended field) return the engine's render extent for the requested quality, and drop the ratio table from callback_host.rs. [runtime/orchestrator/src/callback_host.rs:65](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/callback_host.rs#L65) + +- [x] **Duplication | Medium | Use one callback-render-host setup binding in Unity and the runtime.** games/unity-mono/src/runtime_abi.rs:31 generates the 128-byte rsf_callback_host_setup from the public header, including offsets for each directory and callback. games/unity-mono/src/runtime_setup.rs:318 fills it for the call at :339. runtime/orchestrator/src/callback_host.rs:73 redeclares the same fields manually and consumes them at :949 and :990. Same-sized vendor path pointers are easy to exchange without changing the record size, leaving the Rust constructor and reader independently type-correct. Put the generated public setup in shared bindings and use it at runtime admission, leaving each side's private platform table local. [runtime/orchestrator/src/callback_host.rs:73](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/callback_host.rs#L73) + +- [x] **Duplication | Medium | Bind SR12 command lists to recording slots with one allocator.** runtime/orchestrator/src/callback_host.rs:222 and games/unity-mono/src/package_views.rs:57 have the same search-reuse-or-bind algorithm over three nullable command-list pointers. The callback host calls it for FG input normalization and SR at :711 and :719, while the Unity package calls it per view at games/unity-mono/src/package_state.rs:688. Both must return the original slot for a known list and refuse a fourth distinct list. Share a small three-slot binding type and its exhaustion/reuse tests, with a separate instance for every existing host/view and the same reset boundaries. [runtime/orchestrator/src/callback_host.rs:222](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/callback_host.rs#L222) + +- [x] **Altitude | Medium | Request an adapter drain for a preset-only DLSS change.** The overlay preset path marks the host dirty and disables its plan, but only backend/quality changes call the adapter policy callback. At unchanged output size the host rebuilds only on a RECONFIGURE pass, and Unity bridge.cpp:206 emits that flag only for a pending bridge policy change. A preset-only edit can leave the old context active and the plan disabled indefinitely. Give the host a generation-specific drain request for every context change and acknowledge it before rebuilding. [runtime/orchestrator/src/callback_host.rs:618](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/callback_host.rs#L618) + +- [x] **Duplication | Medium | Apply one backend/quality admission rule at callback-host startup and in the overlay.** runtime/orchestrator/src/callback_host.rs:934 accepts quality 5 for a non-DLSS request, and callback_host/tests.rs:853 explicitly starts the spatial backend at that quality. The live intent path at callback_host.rs:640 requires quality <= 4 even for an enable-only change, where it uses the stored quality. Thus disabling or restarting an admitted quality-5 spatial session through the panel silently does nothing until the user changes quality. Share a predicate for concrete backend and quality, preserve the startup-only Auto handling, and exercise an enable-only change from the existing quality-5 fixture. [runtime/orchestrator/src/callback_host.rs:640](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/callback_host.rs#L640) + +- [x] **Altitude | Medium | Confirm FG submission with the captured source ID instead of the native frame counter.** Host::scene records both pass.native_frame and pass.source_frame_id, and fg_hudless and fg_window receive the latter. On queue completion, submit calls fg_submitted(self.session, slot.native_frame). fg12.rs rejects a receipt unless it matches the stored source ID, so adapters whose engine and input counters differ cannot retire or present those FG inputs correctly. Use the matched scene's source and session for FG and keep the native counter for locating the recording. [runtime/orchestrator/src/render_host.rs:951](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/render_host.rs#L951) + +- [x] **Altitude | Medium | Give Present a published settings snapshot instead of reading the INI every frame.** Host::poll already refreshes saved render settings on a one-second cadence and after a successful write. Host::overlay reads the same INI section again on every Present whenever the state lock is available, before deciding whether the panel or HUD will draw. settings_get and status_get also perform I/O while holding that graphics lock. Publish the validated settings on poll/apply, then let frame and status readers copy that snapshot without putting file access on the presentation path. [runtime/orchestrator/src/render_host.rs:1289](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/render_host.rs#L1289) + +- [x] **Boundaries | Medium | Give the render host's INI-only diagnostic keys live overlay controls.** render_host.rs:1641-1655 reads OverlayProbe and SRCaptureDirectory, and render_host.rs:1708 reads GraphicsDiagnostics, straight from the adapter's INI section once at host creation. They gate the overlay probe (cursor-hide loop and panel open/close), bounded SR capture (sr12_capture at :741, fg_capture_outputs at :1769) and rsf graphics diagnostics, but none of them is surfaced through rsf_overlay_stats/host_options or rsf_render_settings, and they are not re-read by poll() (:539), so they can only be changed by editing the INI and restarting the game. AGENTS.md Rule 2 requires every option, including diagnostics, to have a live overlay control through the generic overlay service; these keys are configuration the Runtime owns but exposes only as restart-time file edits. [runtime/orchestrator/src/render_host.rs:1641](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/render_host.rs#L1641) + +- [x] **Duplication | Low | Use one SR backend display-name lookup for the shared overlay.** runtime/orchestrator/src/callback_host.rs:272 and runtime/orchestrator/src/overlay_service.rs:775 both translate a backend ID into the overlay's backend_name at :432 and :820 respectively. The temporal provider labels match, but ID 6 appears as FSR1 on the callback path and Spatial on the service path, while ID 0 appears as Off or None. Give shared SR backend metadata one canonical display label, and pass an engine-specific spatial algorithm label explicitly only when the adapter can identify it. [runtime/orchestrator/src/callback_host.rs:272](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/callback_host.rs#L272) + +- [x] **Simplicity | Low | Callback host applies sharpening twice when a context is created on a due poll** prepare() calls sr12_set_sharpening with s.sharpening right after a successful sr12_create (callback_host.rs:859). scene() then continues on the same pass to the poll at :722-727, whose deadline is still 0 on the first pass after start (sharpening_poll initialised to 0 at :969), so it re-reads the preferences INI through read_sharpening and calls sr12_set_sharpening again with the same values. The tests pin the duplication: the first pass emits "sharpen 1 0.4" twice before "evaluate" (callback_host/tests.rs:791-793, :1320). Simpler: one apply path, e.g. prepare sets sharpening_poll to now + SHARPENING_POLL_MS after applying, or prepare leaves sharpening to the poll by resetting the deadline to 0 and the scene path applies it once. Tradeoff: none for behavior; removes one file read and one SDK call per context creation and makes the order of sharpening updates single-sourced. [runtime/orchestrator/src/callback_host.rs:859](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/callback_host.rs#L859) + +- [x] **Simplicity | Low | render_host keeps the SR context key as eight loose State fields compared and stored one by one** State (render_host.rs:253-266) holds context_backend, quality, context_preset, context_exposure, width, height, output_width and output_height only to describe the live SR context. process() rebuilds the key implicitly and compares it field by field in a nine-clause condition (:819-827), configure() writes the same eight fields one assignment at a time (:753-760), and State::new zeroes each (:423-430). Simpler: #[derive(Clone, Copy, PartialEq)] struct ContextKey { backend, quality, preset, exposure: bool, render: (u32, u32), output: (u32, u32) }; process builds it once from s and the pass, calls configure when s.context.is_null() || s.key != key, and configure stores s.key = key. status() and the log line read s.key.render / s.key.output. Tradeoff: status() reports width/height and s.quality (overlay quality at :1276) before any context exists as zeros, which a Default key keeps; the comparison stays exact, so behavior is unchanged. [runtime/orchestrator/src/render_host.rs:819](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/render_host.rs#L819) + +- [x] **Duplication | Low | Share the base and output FPS sampler across runtime frontends.** RenderHost::status maintains a tick, two counter baselines, backend identity, FPS values and an output-valid flag, with the same 500 ms sampling window and reset conditions as Rates::sample in runtime/orchestrator/src/overlay_service.rs:362. The D3D12 frontend and its panel call this copy at render_host.rs:1177 and :1292; overlay_service records its copy during accepted Presents. Their application-present deltas already differ in ordinary versus wrapping subtraction. Move the existing Rates object to a shared module, passing each owner's measured counters, backend, validity and tick, and exercise both callers' reset cases with one sampler test. [runtime/orchestrator/src/render_host.rs:1049](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/render_host.rs#L1049) + +- [x] **Simplicity | Low | render_host and overlay_service each map the overlay intent onto rsf_render_settings and back, field by field** render_host.rs:1426-1492 apply_intent and overlay_service.rs:668-716 settings_intent are the same rsf_overlay_intent -> rsf_render_settings mapping (sharpening block, sr_backend, sr_enabled, sr_quality, dlss_preset, fg_backend/fg_enabled, fg_mode/generated_frames, latency, frame_limit_us, status_overlay), written twice; callback_host.rs:581-595 repeats the 12-field intent -> Sharpening copy a third time. The reverse direction is mirrored too: render_host.rs:1323-1334 copies the 12 sharpening_* fields from Settings to rsf_overlay_stats one assignment at a time, and overlay_service.rs:902-914 does the same in a struct literal. Simpler: put two helpers beside sharpening_of/set_sharpening in settings_store.rs (or overlay_abi) - fn apply_intent(&mut Settings, &rsf_overlay_intent) -> bool and fn sharpening_stats(&mut rsf_overlay_stats, &Settings) (or intent_sharpening(&Intent, base) -> Sharpening) - and call them from all three hosts, removing roughly 60 lines of parallel assignments. Tradeoff/behavior to keep: the two copies differ today - overlay_service normalizes enabled and performance_hud to 0/1 while render_host passes them raw and lets settings_apply (render_host.rs:1190-1192) reject values >1; render_host also reports whether anything changed. The shared helper must pick one rule (keeping render_host's raw copy plus validation preserves both callers' accepted inputs only if overlay_service then validates too), so this is a small behavior decision, not a pure move. [runtime/orchestrator/src/render_host.rs:1426](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/render_host.rs#L1426) + +- [x] **Duplication | Low | Stop duplicating conflicting DLSS preset policy in host test fixtures.** The render-host and callback-host fake validators (runtime/orchestrator/src/callback_host/tests.rs:178) admit every preset through 15. OpenGL's fake at runtime/orchestrator/src/gl_pipeline/tests.rs:402 duplicates the actual allowlist in runtime/backends/dlss/include/rescaleframe/dlss_preset.h:7, which rejects 7, for example. The render-host settings test uses 16 as its only invalid preset, so the divergent behavior is invisible. Delegate integration fixtures to one contract implementation or inject explicit accept/refuse results and assert the forwarded preset, with the numeric cases tested once against the production predicate. [runtime/orchestrator/src/render_host/tests.rs:165](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/render_host/tests.rs#L165) + + + +### C03 · Shared settings and utilities + +Port settings storage, formatting, hashes and shared utilities. Consolidate settings interpretation at the owning layer. + +**Coordinate shared edits** + +- Shared settings, frontend requests and live overlay state ([C02](#c02), [O02](#o02)). + +**Port files (6)** + +- [x] [runtime/common/include/rescaleframe/capture_names.h](runtime/common/include/rescaleframe/capture_names.h) +- [x] [runtime/common/include/rescaleframe/log.h](runtime/common/include/rescaleframe/log.h) +- [x] [runtime/common/include/rescaleframe/sha256_file.h](runtime/common/include/rescaleframe/sha256_file.h) +- [x] [runtime/orchestrator/src/render_settings_store.cpp](runtime/orchestrator/src/render_settings_store.cpp) +- [x] [runtime/orchestrator/src/render_settings_store.h](runtime/orchestrator/src/render_settings_store.h) +- [x] [runtime/orchestrator/src/settings_store_format.cpp](runtime/orchestrator/src/settings_store_format.cpp) + +**Rust review findings (4)** + +- [x] **Boundaries | Medium | Move the sharpening range rules into the Rust settings owner.** settings_store.rs:5-6 owns the INI keys but leaves "range checks and sanitization" to the C++ facade, and returns raw stored values. The only definition of rsf_sharpening_defaults, sanitize, valid and vendor_sharpness (including the backend 2..4 vendor-mode rule) is C++ in runtime/orchestrator/include/rescaleframe/sharpening_settings.h. Every Rust owner calls back into C++ for this pure data rule via its platform table: callback_host.rs:149-150/361/597, render_host.rs:164-165/506/1189, overlay_service.rs:345 (overlay_platform.cpp:72), dlss_pipeline.rs:1841, gl_pipeline.rs:149, sr12.rs:1366, vulkan_sr.rs:918, vulkan_fsr4_sr.rs:588 (each with its own *_platform.cpp shim), and the settings store itself needs settings_store_format.cpp for "%.9g". The Rust store and its callers cannot validate or sanitize without first-party C++, so this blocks removing the platform .cpp files and splits one settings policy across two languages. Define the defaults, valid and sanitize in Rust (exported for the C header), and have the Rust owners use them directly. [runtime/orchestrator/src/settings_store.rs:5](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/settings_store.rs#L5) + +- [x] **Altitude | Medium | Preserve the selected FG mode across unrelated settings edits.** read_with_fg_mode returns the saved mode alongside fg_enabled, but every full settings write serializes only the boolean into the FG key. With FG=2 or FG=3, changing sharpening or the performance HUD through render_host::settings_apply rewrites FG=1 and loses Auto or Dynamic. Retain the requested mode in the settings model or preserve the existing mode on updates that leave FG enabled; add a round-trip test with an unrelated field change. [runtime/orchestrator/src/settings_store.rs:78](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/settings_store.rs#L78) + +- [x] **Simplicity | Low | settings_store spells its 22 keys twice and their field order three times** KEYS (settings_store.rs:46-69) lists the 22 owned key names; settings_values (:72-98) lists the same fields in the same order by position; sharpening_values (:100-116) repeats the last 12 positions (tied to KEYS only by SHARPENING_START = 10); and read_with_fg_mode (:283-308) spells all 22 key strings again as literals next to their fields. The write paths depend on KEYS[i] matching settings_values[i], while the read path does not use KEYS at all, so renaming or reordering a key needs three or four coordinated edits. Simpler: derive the read from the same table - build the fallback row as settings_values(&defaults_with_sharpening), map KEYS.zip(row) through file.integer/file.decimal by Value kind, and unpack with one fn from_values([Value; 22]) -> Settings (the inverse of settings_values); define sharpening_values as the tail of settings_values (or as settings_values(&with_sharpening)[SHARPENING_START..]). Behavior to keep: the read normalizes SR and StatusOverlay to 0/1 and returns the raw FG value beside fg_enabled, so those three stay explicit after the table read. Tradeoff: from_values is itself a 22-line positional unpacker, so the line count barely drops; the gain is a single source for key names and order. [runtime/orchestrator/src/settings_store.rs:280](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/settings_store.rs#L280) + +- [x] **Duplication | Low | Use one temporary INI fixture for settings-store and render-host tests.** Settings-store rollback tests and the settings_apply integration fixture at runtime/orchestrator/src/render_host/tests.rs:429 independently create process-and-test named INIs, remove a stale file, encode its path to terminated UTF-16, decode it back for contents and Drop, and silently turn a failed read into an empty string. The render-host version additionally exposes section read/write and runtime_directory. Share a test helper owning the PathBuf and Win32 path, provide a read that distinguishes a missing file from other errors, and keep section-specific helpers on top. This also lets both handle non-Unicode temporary-directory paths without to_str().unwrap(). [runtime/orchestrator/src/settings_store.rs:574](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/settings_store.rs#L574) + + + +### C04 · Generation policy, frame identity and leases + +Port frame assembly, generation selection and leased inputs while preserving frame identity and callback lifetime. + +**Coordinate shared edits** + +- Versioned GameSDK events, host callbacks and session leases ([C01](#c01), [C02](#c02), [C05](#c05)). + +**Port files (19)** + +- [x] [runtime/orchestrator/include/rescaleframe/d3d11_fg_api.h](runtime/orchestrator/include/rescaleframe/d3d11_fg_api.h) +- [x] [runtime/orchestrator/include/rescaleframe/fg_choice.h](runtime/orchestrator/include/rescaleframe/fg_choice.h) +- [x] [runtime/orchestrator/include/rescaleframe/fg_leases.h](runtime/orchestrator/include/rescaleframe/fg_leases.h) +- [x] [runtime/orchestrator/include/rescaleframe/fg_session.h](runtime/orchestrator/include/rescaleframe/fg_session.h) +- [x] [runtime/orchestrator/include/rescaleframe/frame_assembly.h](runtime/orchestrator/include/rescaleframe/frame_assembly.h) +- [x] [runtime/orchestrator/include/rescaleframe/frame_sequencer.h](runtime/orchestrator/include/rescaleframe/frame_sequencer.h) +- [x] [runtime/orchestrator/include/rescaleframe/gpu_policy.h](runtime/orchestrator/include/rescaleframe/gpu_policy.h) +- [x] [runtime/orchestrator/include/rescaleframe/native_fg.h](runtime/orchestrator/include/rescaleframe/native_fg.h) +- [x] [runtime/orchestrator/include/rescaleframe/native_scene.h](runtime/orchestrator/include/rescaleframe/native_scene.h) +- [x] [runtime/orchestrator/src/d3d11_fg_api.cpp](runtime/orchestrator/src/d3d11_fg_api.cpp) +- [x] [runtime/orchestrator/src/fg_auto_choice.h](runtime/orchestrator/src/fg_auto_choice.h) +- [x] [runtime/orchestrator/src/fg_leases_com.cpp](runtime/orchestrator/src/fg_leases_com.cpp) +- [x] [runtime/orchestrator/src/fg_providers.cpp](runtime/orchestrator/src/fg_providers.cpp) +- [x] [runtime/orchestrator/src/fg_session_platform.cpp](runtime/orchestrator/src/fg_session_platform.cpp) +- [x] [runtime/orchestrator/src/native_fg.cpp](runtime/orchestrator/src/native_fg.cpp) +- [x] [runtime/orchestrator/src/native_fg_dispatch.cpp](runtime/orchestrator/src/native_fg_dispatch.cpp) +- [x] [runtime/orchestrator/src/native_fg_platform.cpp](runtime/orchestrator/src/native_fg_platform.cpp) +- [x] [runtime/orchestrator/src/native_fg_platform.h](runtime/orchestrator/src/native_fg_platform.h) +- [x] [runtime/orchestrator/src/native_scene_platform.cpp](runtime/orchestrator/src/native_scene_platform.cpp) + +**Fixtures (9)** + +- [x] [tests/d3d11_fg_api.cpp](tests/d3d11_fg_api.cpp) +- [x] [tests/fg_choice.cpp](tests/fg_choice.cpp) +- [x] [tests/fg_leases.cpp](tests/fg_leases.cpp) +- [x] [tests/fg_leases_faults.cpp](tests/fg_leases_faults.cpp) +- [x] [tests/fg_provider.cpp](tests/fg_provider.cpp) +- [x] [tests/fg_session.cpp](tests/fg_session.cpp) +- [x] [tests/fg_switching.cpp](tests/fg_switching.cpp) +- [x] [tests/frame_assembly.cpp](tests/frame_assembly.cpp) +- [x] [tests/gpu_policy.cpp](tests/gpu_policy.cpp) + +**Rust review findings (8)** + +- [x] **Altitude | Medium | Keep a scoped FG scene capture with its scene owner.** The public D3D11 capture entry in native_fg_dispatch.cpp:40 passes three native function pointers into Rust to swap the thread-local scene out, set the new scene, capture and swap the old scene back. Both scene storage and scoped restoration already live in fg_scene.rs, and native_sr.rs already uses its guard. Let the scene owner bracket one capture callback directly, preserving set_scene's explicit refusal behavior and binding rules. This keeps outer-resource lifetime and restoration in one implementation instead of depending on a matched pair of native swaps. [runtime/orchestrator/src/fg_dispatch.rs:66](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg_dispatch.rs#L66) + +- [x] **Duplication | Medium | Validate the FG provider retirement descriptor identically before polling or sealing.** Session switching inspects the provider retirement fence/value itself, while the lease API validates the same rsf_fg_retirement at runtime/orchestrator/src/fg_leases.rs:221. For a non-null fence targeting UINT64_MAX, sealing rejects the descriptor immediately, but Session::switch waits for a value it can never accept as completed: a smaller counter returns NOT_READY and UINT64_MAX means device removal. These ABI paths are exercised by tests/fg_session.cpp:82 and tests/fg_leases_faults.cpp:98. Parse the descriptor once into immediate or fenced retirement, reject the reserved sentinel up front, and reuse FenceState::check for polling. [runtime/orchestrator/src/fg_session.rs:84](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg_session.rs#L84) + +- [x] **Altitude | Medium | Record provider marker failure in the owning FG frame sequence.** rsf_fg_session_marker commits the marker to Ledger, then returns the provider's result without marking the sequence failed. If the provider refuses an input-source marker, continuing with later markers can make prepare_source approve the frame, while retrying the failed marker poisons the ledger as an out-of-order duplicate. Make the session explicitly invalidate the frame on provider failure and require abort before reuse. Cover a provider refusal in the public session fixture alongside its existing out-of-order-marker case. [runtime/orchestrator/src/fg_session.rs:405](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg_session.rs#L405) + +- [x] **Altitude | Medium | Preserve the resources covered by an explicit FG input lease as well as its metadata.** When a matched explicit FG capture already exists, native FG evaluation sets explicit_inputs and preserves slot.pass at line 1144. It nevertheless copies the SR frame's depth and motion into those same slot surfaces, can reallocate them for different extents, and sets slot.prepared from SR success. Prepare can then tag SR pixels under the explicit producer's provenance, or lose an independently valid FG input on SR failure. Give SR staging its own storage or reuse explicit inputs only after proving their resource identity and conventions match. [runtime/orchestrator/src/native_fg.rs:1028](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_fg.rs#L1028) + +- [x] **Altitude | Medium | Scope measured FG frame time to the source timeline that produced it.** Input-sourced Prepare falls back from engine delta to a process-global previous input timestamp with no session or generation, then substitutes 16.67 ms if there is no usable predecessor. The rendered-source path already declines when neither measurement is available. A first frame or a session transition can therefore send the provider an invented 60 Hz interval or a clamped cross-session gap. Store timing per source timeline, reset it at discontinuities, and make absent timing explicit before interpolation. [runtime/orchestrator/src/native_fg.rs:1587](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_fg.rs#L1587) + +- [x] **Altitude | Low | Give the FG lease owner a terminal device-removal teardown operation.** The public scaffolding retains the handle and COM references if either fence reports DeviceRemoved. Destroy repeats the failing collection, cancel rejects submitted slots, and tests/fg_leases_faults.cpp:119 only recovers by changing a synthetic removed fence back into a completed one. A real caller cannot release the failed owner after verified device teardown. Add an explicit owner-level device-loss teardown distinct from successful retirement, with a test that leaves the fence removed. There is no production consumer yet. [runtime/orchestrator/src/fg_leases.rs:274](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg_leases.rs#L274) + +- [x] **Simplicity | Low | Orchestrator owners keep bindgen Option tables and unwrap a slot on every call** Four orchestrator owners store their raw bindgen Option tables and unwrap a slot on every call. (1) fg_session.rs: valid_provider (:110-121) and rsf_core_fg_session_create (:250-257) reject any missing provider or host slot, but Context and Session keep the raw rsf_generation_provider and rsf_fg_host and call 16 .unwrap()( sites (:55, :70, :80, :101, :170, :175, :198, :221, :324, :327, :345, :405, :460, :486, :509, :539). (2) fg12.rs:32-44: the native! macro expands to PLATFORM.get().unwrap().op.unwrap() at about 60 call sites (plus 6 in fg12/colors.rs), and rsf_core_fg12_bind_platform only asserts struct_size. (3) dx12_vulkan_interop.rs:118-310: rsf_dx12vk_platform is borrowed &static and its 16 slots are unwrapped per call with no up-front check. (4) auxiliary_sr.rs:892 copies *platform into AuxiliarySr unchecked, then unwraps slots at 19 sites. (5) frame_tap.rs: the bindgen rsf_frame_tap_platform is passed as &Platform into about 20 hook and control exports and unwrapped at 51 sites (e.g. :312, :561, :2066, :2578, :2874), with no up-front check. (6) native_fg.rs:64-72: the call! macro does .expect("native FG platform entry ...") on an rsf_nfg_platform Option slot at each of its 81 call sites, and the table pointer itself is re-checked by platform() on each of about 15 exports; native_fg_cpu.rs:51-57 repeats the same call! .expect macro over rsf_nfg_cpu_platform (69 sites across native_fg_cpu.rs and its submodules). overlay_host.rs:48-50 does the same through leaf(entry) = entry.expect(...) over rsf_overlay_host_platform and the loaded panel API (48 sites). overlay_service.rs:58-65 copies rsf_overlay_platform into a OnceLock without checking any slot and unwraps it at 33 sites; overlay_native12.rs does the same with rsf_overlay12_platform. shader_patch.rs:111-127 stores the bindgen rsf_patch_platform in a OnceLock after only a struct_size assert, then unwraps or expects its leaves at 12 sites (shader_patch.rs:477, pack.rs:177, reflection.rs:124 and nine in shader_patch/d3d11.rs:88-215). Simpler: convert each table once at bind or create time into a Rust struct of plain unsafe extern "C" fn pointers, returning INVALID when a slot is missing. This is the pattern callback_host, d3d11_present and dlss_streamline already use with hand-written plain-fn Platform structs. The per-call unwraps then disappear, and a missing slot fails at bind rather than panicking mid-frame inside an extern "C" callback. Tradeoff: one conversion function per table, and for fg12 a bind result instead of a void assert. This is distinct from the Anomaly (fg_stage.rs), Skyrim and Unity entries, which cover game crates. [runtime/orchestrator/src/fg_session.rs:110](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg_session.rs#L110) + +- [x] **Duplication | Low | Classify the presentation path from the scene identity already found.** An eligible FG Prepare first obtains final_scene through scene_for_window and immediately invokes scene_present_path with the same window. Both public paths independently validate the pass and call find_window in runtime/orchestrator/src/native_scene.rs:175 and :195. Native window admission repeats that pair at runtime/orchestrator/src/native_window.rs:207 and :214. On a matched frame the same thread-local registry slot is borrowed and copied twice through native wrappers before direct or sampled classification. Provide one internal lookup returning the scene and path, or pass the copied scene to a path classifier while retaining the public single-purpose ABI wrappers. [runtime/orchestrator/src/native_fg.rs:1276](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_fg.rs#L1276) + + + +### C05 · CPU receipts, latency and pacing + +Port CPU event admission, input receipts, vendor latency and pacing decisions, including Vulkan latency paths. + +**Coordinate shared edits** + +- Versioned GameSDK events, host callbacks and session leases ([C01](#c01), [C02](#c02), [C04](#c04)). + +**Port files (12)** + +- [x] [runtime/orchestrator/include/rescaleframe/native_cpu.h](runtime/orchestrator/include/rescaleframe/native_cpu.h) +- [x] [runtime/orchestrator/include/rescaleframe/native_latency_vulkan.h](runtime/orchestrator/include/rescaleframe/native_latency_vulkan.h) +- [x] [runtime/orchestrator/include/rescaleframe/native_latency_vulkan_requirements.h](runtime/orchestrator/include/rescaleframe/native_latency_vulkan_requirements.h) +- [x] [runtime/orchestrator/src/latency_amd_vulkan.cpp](runtime/orchestrator/src/latency_amd_vulkan.cpp) +- [x] [runtime/orchestrator/src/latency_amd_vulkan_platform.h](runtime/orchestrator/src/latency_amd_vulkan_platform.h) +- [x] [runtime/orchestrator/src/latency_antilag.cpp](runtime/orchestrator/src/latency_antilag.cpp) (removed; the AMD Anti-Lag 2 driver calls are [latency_antilag_sdk.rs](runtime/orchestrator/src/latency_antilag_sdk.rs), see [leaf closure](docs/research/rust-core-leaves-closure.md)) +- [x] [runtime/orchestrator/src/latency_antilag.h](runtime/orchestrator/src/latency_antilag.h) +- [x] [runtime/orchestrator/src/latency_policy.h](runtime/orchestrator/src/latency_policy.h) +- [x] [runtime/orchestrator/src/native_fg_cpu_platform.h](runtime/orchestrator/src/native_fg_cpu_platform.h) +- [x] [runtime/orchestrator/src/native_latency_streamline_exceptions.cpp](runtime/orchestrator/src/native_latency_streamline_exceptions.cpp) (native Streamline callback exceptions; now the C11 leaf [native_latency_streamline_exceptions.c](runtime/orchestrator/src/native_latency_streamline_exceptions.c) with MSVC structured exception handling) +- [x] [runtime/orchestrator/src/native_latency_vulkan.cpp](runtime/orchestrator/src/native_latency_vulkan.cpp) +- [x] [runtime/orchestrator/src/native_latency_vulkan_presentation.h](runtime/orchestrator/src/native_latency_vulkan_presentation.h) + +**Fixtures (8)** + +- [x] [tests/input_receipts.cpp](tests/input_receipts.cpp) +- [x] [tests/latency_antilag.cpp](tests/latency_antilag.cpp) +- [x] [tests/latency_event_contract.cpp](tests/latency_event_contract.cpp) +- [x] [tests/native_antilag_vulkan.cpp](tests/native_antilag_vulkan.cpp) +- [x] [tests/native_cpu_reservation.cpp](tests/native_cpu_reservation.cpp) +- [x] [tests/native_fg_cpu.cpp](tests/native_fg_cpu.cpp) +- [x] [tests/native_latency_vulkan.cpp](tests/native_latency_vulkan.cpp) +- [x] [tests/xell_sleep_concurrency.cpp](tests/xell_sleep_concurrency.cpp) + +**Rust review findings (12)** + +- [x] **Altitude | Medium | Retain unframed input observed after the frame-begin timestamp used for flushing.** fact delivers FRAME_BEGIN to the sink before flush_pending. While that sink runs, another thread can enqueue a valid window or input receipt with a later QPC timestamp. The flush correctly declines to associate it with the earlier frame but then unconditionally clears its slot, so the next eligible frame never sees it. Remove only consumed or demonstrably expired receipts and keep newer matching-session observations for the next frame. [runtime/orchestrator/src/native_cpu.rs:556](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_cpu.rs#L556) + +- [x] **Altitude | Medium | Keep actual SDK marker delivery separate from producer-marker ordering.** frame_marker sets the CPU ledger's marker bit before submitting it to the vendor. dispatch_boundary only traces a refusal for simulation begin/end, so a later render start can see both required bits and forward additional vendor markers even though the SDK missed a prerequisite. Keep the producer observation, but record the delivery outcome per frame and stop vendor-dependent markers and statistics after a rejected prerequisite. [runtime/orchestrator/src/native_fg_cpu.rs:355](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_fg_cpu.rs#L355) + +- [x] **Altitude | Medium | Report missing render-submit timing when Present arrives without its callback.** latency_present calls start_render_marker from Present begin. For ordinary non-prospective frames, start_render_marker checks simulation progress but does not require any observed render submission. It can therefore emit the vendor's submit-start timestamp at Present even though the actual CPU-to-GPU handoff is unknown. Have the submission or explicit render callback own that marker and leave it unavailable when only the Present callback arrives. [runtime/orchestrator/src/native_fg_cpu.rs:1207](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_fg_cpu.rs#L1207) + +- [x] **Duplication | Medium | Classify observed CPU pacing and marker boundaries once for native and Vulkan latency.** Vulkan fact() and runtime/orchestrator/src/native_fg_cpu.rs:963 independently suppress the same three event stages when either substituted-input or derived-boundary flags are present. Both then test the current event version and KEYED bit to interpret input sample versus explicit pacing at vulkan_latency.rs:414 and native_fg_cpu.rs:1020. These gates determine whether a reported CPU fact can cause a vendor marker or sleep. Share the observed-event and pacing-boundary predicates, retaining native reservation-specific suppression and each owner's provider dispatch. [runtime/orchestrator/src/vulkan_latency.rs:398](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_latency.rs#L398) + +- [x] **Altitude | Medium | Report the active XeLL provider's result in Vulkan latency status.** The XeLL option, sleep and marker paths store the native result in the provider snapshot, but get_status copies only mode, availability and counters. Its public last_result and refused_calls still come from Streamline's STATS, while Lease::mark drops the XeLL return code. A refused XeLL operation can consequently appear successful to an overlay or integration. Forward the selected owner's result and track its refusals at the same boundary as its counters. [runtime/orchestrator/src/vulkan_latency.rs:658](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_latency.rs#L658) + +- [x] **Duplication | Medium | Share the Streamline input-to-marker decision across Vulkan and D3D.** Vulkan token_input, reached at runtime/orchestrator/src/vulkan_latency.rs:386, rejects a foreign nonzero window message before emitting a controller sample and rejects empty input. D3D input_for at runtime/orchestrator/src/streamline_host.rs:737 accepts the same input-kind mask, emits controller marker 13 before checking the message, ignores a foreign message and returns success for empty input. Both separately encode registered PCL ping 8 and controller sample 13 for the same SDK. Derive eligible markers and invalid/no-op classification once, then let each owner apply its own token locking, counters and documented public result mapping. [runtime/orchestrator/src/vulkan_latency_frames/streamline.rs:179](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_latency_frames/streamline.rs#L179) + +- [x] **Altitude | Low | Return Anti-Lag binding refusal through the native wrapper.** Context::bind uses try_lock and can leave the old device bound when an update or render-end call is in progress. The production Rust caller in native_fg_cpu.rs:473 checks the boolean, but rsf_core_antilag_bind drops it and the AntiLagOwner wrapper in latency_antilag.h:59 exposes a void bind. Native callers cannot tell whether it is safe to pace the new device. Propagate the binding outcome and exercise the busy-rebind case in the existing native fixture. [runtime/orchestrator/src/latency_antilag.rs:206](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/latency_antilag.rs#L206) + +- [x] **Simplicity | Low | native_cpu repeats one stage-mask predicate and spells CPU stage sets as raw bit numbers** record() (native_cpu.rs:715-726) computes rendered_end = rendered && ((stage == SIMULATION_END && (mask == 1 || mask == 5)) || (stage == FRAME_END && (mask == 9 || mask == 13))). Eleven lines later it computes unbound_end = refused_binding && the identical stage/mask disjunction. The same stage sets appear as unnamed literals across the module and its readers: partial_end masks 1, 3 and 7 (:714), stage_mask & 9 == 9 and == 15 (:393), stage_mask == 3 (:299), stage_mask & 1/2/4 tests (:420-431), stage_mask != 1 (:649), and fg12.rs:812 stage_mask & 15 == 15. Each literal is an OR of 1 << FRAME_BEGIN, INPUT_SAMPLE, SIMULATION_BEGIN and SIMULATION_END. Simpler: one helper, e.g. fn skips_input_or_simulation(stage, mask) -> bool, used by both rendered_end and unbound_end, plus named const masks (BEGUN = bit(FRAME_BEGIN), INPUT = BEGUN | bit(INPUT_SAMPLE), SIMULATED = ..., COMPLETE = 15) built from the stage constants already declared at :32-38. Readers then see the CPU-stage contract instead of decoding 5, 9 and 13. Tradeoff: none in behaviour; a few const definitions. [runtime/orchestrator/src/native_cpu.rs:715](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_cpu.rs#L715) + +- [x] **Simplicity | Low | native_fg_cpu Frame tracks each latency marker as two booleans and repeats the attempt protocol four times** Frame (native_fg_cpu.rs:121-128) holds render_started/render_starting, submit_ended/submit_ending, present_started/present_starting and present_ended/present_ending. Each pair encodes one three-state marker attempt (none, in flight, marked); "both true" never occurs. pacing_started/pacing_finished (:119-120, pacing_in_flight at :155) is the same idea. The attempt protocol is hand-written four times with the same shape: refuse when done or in flight, set the in-flight flag and copy the Frame under the ledger lock, call frame_marker, then re-lock, clear the in-flight flag, set done = marked and OR failed. See start_render_marker (:1071-1089 plus the finish closure), end_render_marker (:1176-1198), latency_present begin (:1217-1250) and end (:1253-1266). Simpler: enum Marker { Idle, Pending, Done } per marker field, plus one helper fn attempt(source, field: fn(&mut Frame) -> &mut Marker, marker_id, precondition) -> (i32, bool) that runs the lock/claim/call/settle sequence once. The four call sites then keep only their own preconditions. Tradeoff: an accessor closure or field selector per call, and Frame stays Copy. Readers such as route_receipt (:887) and frame_acquire (:323-324) test render_started || render_starting, which becomes != Idle. [runtime/orchestrator/src/native_fg_cpu.rs:121](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_fg_cpu.rs#L121) + +- [x] **Altitude | Low | Let the render-hitch monitor sleep or stop with its owning session.** The diagnostic thread wakes every two milliseconds until it takes 36 samples. If debugging is disabled or the session ends before enough hitches occur, end_session removes the current target but leaves the thread polling an empty WATCH forever. Give the worker a session cancellation or condition-variable wakeup, and preserve the total sample budget independently of the worker lifetime. [runtime/orchestrator/src/native_fg_cpu/hitch.rs:147](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_fg_cpu/hitch.rs#L147) + +- [x] **Simplicity | Low | native_fg_cpu calls its own Win32 helpers through the C++ platform table** native_fg_cpu/win32.rs:43-240 defines 11 #[no_mangle] Rust helpers: rsf_core_nfg_signal_completion, wait_completion, owned_window_thread, post_ping, input_idle_ms, tick_millis, qpc_frequency, thread_id, duplicate_render_thread, sample_render_thread and describe_address. native_fg.cpp:65-76 copies those Rust symbols into the rsf_nfg_cpu_platform table, and the same Rust module calls them back through call!(p, ...).expect(...): tick_millis (native_fg_cpu.rs:380, :1332), wait_completion (:392, :587), signal_completion (:289), thread_id (:877; diagnostics.rs:385; hitch.rs:77), qpc_frequency (:1297; diagnostics.rs:60; hitch.rs:103), owned_window_thread (:869, :1465), post_ping (:1556), input_idle_ms (diagnostics.rs:186) and duplicate_render_thread (hitch.rs:83). hitch.rs:105 additionally re-checks the Option slots sample_render_thread and describe_address, which are always these same Rust functions. Simpler: call super::win32::{tick_millis, wait_completion, ...} directly as plain Rust functions, drop the 11 slots from rsf_nfg_cpu_platform and the matching rows in native_fg.cpp, and keep in the table only the leaves that really live in C++ (host, acquire, marker, pace ...). Tradeoff: tests that stub these slots would need a cfg(test) seam. Inference: no test stubs for them were found in this crate. [runtime/orchestrator/src/native_fg_cpu/win32.rs:43](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_fg_cpu/win32.rs#L43) + +- [x] **Altitude | Low | Keep each device's Reflex sync state with the report that names it.** The audit initializes each incoming sync report's enabled flag from the previous process-wide report, even if report.device changes. A failed request or one with neither enable nor disable then logs the old device's setting alongside the new device pointer in reflex_audit.cpp:138. Track the last accepted configuration per device or mark it unknown when switching device identities. [runtime/orchestrator/src/reflex_audit.rs:252](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/reflex_audit.rs#L252) + + + +### L01 · Loader entry and carrier forwarding + +Port process entry, proxy forwarding and module selection for the thin loader and launcher. + +**Coordinate shared edits** + +- Carrier entry, game recognition and existing forwarding exports ([A01](#a01), [W01](#w01)). + +**Port files (14)** + +- [x] [apps/launcher/src/main.cpp](apps/launcher/src/main.cpp) +- [x] [cmake/version.h.in](cmake/version.h.in) (template for the C/C++ version header) +- [x] [loader/proxy/src/dlss_bridge.h](loader/proxy/src/dlss_bridge.h) +- [x] [loader/proxy/src/plugin_carrier.cpp](loader/proxy/src/plugin_carrier.cpp) +- [x] [loader/proxy/src/preferences.h](loader/proxy/src/preferences.h) +- [x] [loader/proxy/src/shim_loader.cpp](loader/proxy/src/shim_loader.cpp) +- [x] [loader/proxy/src/thin_config.cpp](loader/proxy/src/thin_config.cpp) +- [x] [loader/proxy/src/thin_config.h](loader/proxy/src/thin_config.h) +- [x] [loader/proxy/src/thin_library.h](loader/proxy/src/thin_library.h) +- [x] [loader/proxy/src/thin_loader.cpp](loader/proxy/src/thin_loader.cpp) +- [x] [loader/proxy/src/thin_startup.cpp](loader/proxy/src/thin_startup.cpp) +- [x] [loader/proxy/src/thin_startup.h](loader/proxy/src/thin_startup.h) +- [x] [loader/proxy/src/xinput_forwarding.cpp](loader/proxy/src/xinput_forwarding.cpp) +- [x] [loader/src/bootstrap.cpp](loader/src/bootstrap.cpp) + +**Fixtures (4)** + +- [x] [tests/shared_shim_exports.cpp](tests/shared_shim_exports.cpp) +- [x] [tests/thin_loader.cpp](tests/thin_loader.cpp) +- [x] [tests/thin_loader_fixture.cpp](tests/thin_loader_fixture.cpp) +- [x] [tests/xinput_carrier.cpp](tests/xinput_carrier.cpp) + + + +### L02 · Loader census and diagnostics + +Move the API census, static scan and diagnostic capture behind the loader's Rust interfaces. + +**Port files (16)** + +- [x] [loader/census/include/rescaleframe/census_d3d12_observer.h](loader/census/include/rescaleframe/census_d3d12_observer.h) +- [x] [loader/census/include/rescaleframe/vendor_census.h](loader/census/include/rescaleframe/vendor_census.h) +- [x] [loader/census/src/census_internal.h](loader/census/src/census_internal.h) +- [x] [loader/census/src/core.cpp](loader/census/src/core.cpp) +- [x] [loader/census/src/decode.cpp](loader/census/src/decode.cpp) +- [x] [loader/census/src/hooks.cpp](loader/census/src/hooks.cpp) +- [x] [loader/census/src/static_scan.cpp](loader/census/src/static_scan.cpp) +- [x] [loader/census/src/wrap_d3d.cpp](loader/census/src/wrap_d3d.cpp) +- [x] [loader/census/src/wrap_fsr.cpp](loader/census/src/wrap_fsr.cpp) +- [x] [loader/census/src/wrap_generic.h](loader/census/src/wrap_generic.h) +- [x] [loader/census/src/wrap_misc.cpp](loader/census/src/wrap_misc.cpp) +- [x] [loader/census/src/wrap_ngx.cpp](loader/census/src/wrap_ngx.cpp) +- [x] [loader/census/src/wrap_vk.cpp](loader/census/src/wrap_vk.cpp) +- [x] [loader/diagnostics/include/rescaleframe/frame_capture.h](loader/diagnostics/include/rescaleframe/frame_capture.h) +- [x] [loader/diagnostics/include/rescaleframe/module_dump.h](loader/diagnostics/include/rescaleframe/module_dump.h) +- [x] [loader/diagnostics/src/module_dump_internal.h](loader/diagnostics/src/module_dump_internal.h) + +- [x] [loader/census/src/decode_d3d_platform.cpp](loader/census/src/decode_d3d_platform.cpp) (introduced D3D resource query leaf) +- [x] [loader/census/src/census_platform.cpp](loader/census/src/census_platform.cpp) (converted to the C11 leaf `census_platform.c`: native descriptor catalog, vendor tables and guarded NGX and Streamline calls; `census_internal.h` is now a C header) +- [x] [loader/census/src/hook_platform.cpp](loader/census/src/hook_platform.cpp) (converted to the C11 leaf `hook_platform.c`: MinHook calls and the TEB getter) +- [x] [loader/census/src/guarded_platform.cpp](loader/census/src/guarded_platform.cpp) (converted to the C11 leaf `guarded_platform.c`: SEH reads, code-pointer and vtable-slot checks; the `guard` lambda helper is gone, each guarded call owns its `__try`) +- [x] [loader/census/src/d3d_guarded_platform.cpp](loader/census/src/d3d_guarded_platform.cpp) (converted to the C11 leaf `d3d_guarded_platform.c`: guarded QueryInterface, Release and description reads through `lpVtbl`) + +**Fixtures (10)** + +- [x] [tests/loader/vendor_census_native.cpp](tests/loader/vendor_census_native.cpp) (converted to `tests/loader/vendor_census_native.c`: C vtable fake resource and token objects, DXGI and D3D12 slots from SDK `*Vtbl` offsets, `CreateThread`, `PUT` payload writes; the remaining C++ is the next entry) +- [ ] [tests/loader/vendor_census_ngx_platform.cpp](tests/loader/vendor_census_ngx_platform.cpp) (introduced SDK fixture leaf, now the whole of the old fixture driver's C++; blocked: `NVSDK_NGX_Parameter` is a C++ class whose virtual slots follow MSVC overload ordering, so only a C++ compiler can select the Set overload slots; the called probe is `rsf_test_ngx_check_slots` and four typed setters declared in the C header `tests/loader/ngx_param_probe.h`, caller `vendor_census_native.c` run_ngx and check_vtable_slots) **Kept:** compiled into `rsf_vendor_census_test` (`tests/CMakeLists.txt:744`) and called from `tests/loader/vendor_census_native.c:250` (`check_vtable_slots`, `:233`); selecting the `NVSDK_NGX_Parameter` Set overload slots needs the C++ compiler's MSVC overload ordering. Verified: `NVSDK_NGX_Parameter` declares overloaded `virtual void Set(...)` members (`nvsdk_ngx_params.h:55-61` in the Streamline SDK checkout). +- [x] [tests/census_present_coexistence.cpp](tests/census_present_coexistence.cpp) +- [ ] [tests/loader/module_dump_rtti_fixture.cpp](tests/loader/module_dump_rtti_fixture.cpp) (native RTTI specimen; blocked: the `module_dump_v2` test needs a compiler-emitted MSVC RTTI type descriptor, complete object locator and vftable, which only a C++ compiler produces, and the call is `rsf_test_module_dump_v2` with the vftable RVA of a derived class; the file is 25 lines) **Kept:** the only source of `rsf_module_dump_v2` (`tests/CMakeLists.txt:713`); only a C++ compiler emits the MSVC RTTI type descriptor, object locator and vftable the test reads. +- [x] [tests/module_dump_v2.cpp](tests/module_dump_v2.cpp) +- [x] [tests/vendor_census.cpp](tests/vendor_census.cpp) +- [x] [tests/vendor_census_asi.cpp](tests/vendor_census_asi.cpp) +- [x] [tests/vendor_census_fixture.cpp](tests/vendor_census_fixture.cpp) +- [ ] [tests/loader/vendor_layout_facts.cpp](tests/loader/vendor_layout_facts.cpp) (native SDK layout evidence; FidelityFX, XeSS and Vulkan moved to `vendor_layout_facts.c`, which also owns `main`; blocked for the rest: `sl.h` declares the `sl::` namespace types and the FSR 2 header declares `Fsr212::` types, both C++ only, and the Streamline structs need measurement on real storage because they have constructors; the C driver calls `rsf_test_layout_facts_cxx` when `RSF_CENSUS_LAYOUT_CXX` is set for the sl and fsr2 targets) **Kept:** added to the `sl` and `fsr2` census layout targets with `RSF_CENSUS_LAYOUT_CXX` (`tests/CMakeLists.txt:785-786`); the C driver is `tests/loader/vendor_layout_facts.c`; `sl.h` and the FSR 2 header are C++ only. Verified: the FSR 2 header declares `namespace Fsr212` (`references/OptiScaler/OptiScaler/include/fsr2_212/ffx_fsr2.h:29`). +- [x] [tests/vendor_census_layouts.cpp](tests/vendor_census_layouts.cpp) +- [x] [tests/vendor_census_ngx_params.h](tests/vendor_census_ngx_params.h) + + + +### O01 · Shared overlay input and windows + +Port overlay input, cursor, pointer, visibility and host window ownership through the existing service. + +**Coordinate shared edits** + +- Overlay input capture and renderer shutdown ([O02](#o02)). + +**Port files (11)** + +- [x] [loader/proxy/src/overlay_host.cpp](loader/proxy/src/overlay_host.cpp) +- [x] [loader/proxy/src/overlay_host.h](loader/proxy/src/overlay_host.h) +- [x] [loader/proxy/src/overlay_host_platform.h](loader/proxy/src/overlay_host_platform.h) +- [x] [runtime/graphics/include/rescaleframe/overlay_input.h](runtime/graphics/include/rescaleframe/overlay_input.h) +- [x] [runtime/graphics/src/overlay_cursor_capture.h](runtime/graphics/src/overlay_cursor_capture.h) +- [x] [runtime/graphics/src/overlay_cursor_platform.h](runtime/graphics/src/overlay_cursor_platform.h) +- [x] [runtime/graphics/src/overlay_input.cpp](runtime/graphics/src/overlay_input.cpp) +- [x] [runtime/graphics/src/overlay_input_route.h](runtime/graphics/src/overlay_input_route.h) +- [x] [runtime/graphics/src/overlay_pointer_platform.h](runtime/graphics/src/overlay_pointer_platform.h) +- [x] [runtime/graphics/src/overlay_visibility_platform.h](runtime/graphics/src/overlay_visibility_platform.h) +- [x] [runtime/graphics/src/overlay_window_platform.h](runtime/graphics/src/overlay_window_platform.h) + +**Fixtures (2)** + +- [x] [tests/overlay_host.cpp](tests/overlay_host.cpp) +- [x] [tests/overlay_hotkey.cpp](tests/overlay_hotkey.cpp) + +**Rust review findings (4)** + +- [x] **Altitude | Medium | Keep egui textures alive through the draw that retires them.** Host::carry_textures drains both atlas updates and texture frees before renderer_draw in draw_target and present. ui/overlay/src/overlay.rs:407 forwards egui's TexturesDelta.free directly, whose epaint contract schedules those frees after painting. A mesh can therefore lose a texture needed by its last frame. Upload texture changes before drawing and retire the released IDs after the draw attempt, at one shared host-owned frame boundary. [runtime/orchestrator/src/overlay_host.rs:378](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_host.rs#L378) + +- [x] **Duplication | Medium | Handle a poisoned overlay panel once across both D3D11 draw routes.** The supplied-target and swapchain paths independently collect input, call the same panel.frame, process its intent, carry atlas textures and draw. A layout failure returns directly from draw_target, while present at runtime/orchestrator/src/overlay_host.rs:624 closes the panel and latches failure. The panel sets poisoned after a panic and every later frame then refuses (ui/overlay/src/ffi.rs:98 and :112), so wrapped-device drawing keeps invoking an unusable panel. Share layout/failure handling across both entries, preserving their distinct target acquisition and the intentional intent-on-draw-failure contracts documented at runtime/orchestrator/src/overlay_host_tests.rs:585 and :753. [runtime/orchestrator/src/overlay_host.rs:437](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_host.rs#L437) + +- [x] **Altitude | Medium | Apply hotkey debounce to toggle edges, not explicit panel visibility requests.** Visibility::request applies the 250 ms debounce to EXTERNAL requests as well as window and polling edges. A close-button intent or overlay_host::close_after_failure immediately following an open can therefore be discarded, leaving input captured by a panel that just stopped drawing. The test explicitly rejects an external hide after two milliseconds. Make set_visible idempotently honor the requested state and use debounce only to reconcile duplicate physical toggle observations. [runtime/orchestrator/src/overlay_visibility.rs:40](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_visibility.rs#L40) + +- [x] **Altitude | Low | Count observed raw mouse input separately from all WM_INPUT messages.** The route increments raw_mouse_reports for every visible WM_INPUT after calling a void leaf. record_raw_mouse in overlay_input.cpp:69 can return before reading the packet, or ignore a keyboard/HID record, a failed read or absolute motion. The diagnostic therefore cannot establish that a mouse report reached the panel. Return the decoded device kind or count the mouse report at the decoder and expose total WM_INPUT traffic separately if needed. [runtime/orchestrator/src/overlay_input_route.rs:265](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_input_route.rs#L265) + + + +### O02 · Shared overlay rendering and panel + +Port panel and status rendering, overlay device resources and the UI-to-Runtime option mappings. + +**Coordinate shared edits** + +- Shared settings, frontend requests and live overlay state ([C02](#c02), [C03](#c03)). +- Overlay input capture and renderer shutdown ([O01](#o01)). + +**Port files (15)** + +- [x] [runtime/graphics/include/rescaleframe/overlay_renderer.h](runtime/graphics/include/rescaleframe/overlay_renderer.h) +- [x] [runtime/graphics/src/overlay_renderer.cpp](runtime/graphics/src/overlay_renderer.cpp) +- [x] [runtime/graphics/src/overlay_renderer_platform.h](runtime/graphics/src/overlay_renderer_platform.h) +- [x] [runtime/orchestrator/include/rescaleframe/overlay_api.h](runtime/orchestrator/include/rescaleframe/overlay_api.h) +- [x] [runtime/orchestrator/include/rescaleframe/overlay_d3d12.h](runtime/orchestrator/include/rescaleframe/overlay_d3d12.h) +- [x] [runtime/orchestrator/include/rescaleframe/overlay_fg_stats.h](runtime/orchestrator/include/rescaleframe/overlay_fg_stats.h) +- [x] [runtime/orchestrator/src/overlay_d3d12.cpp](runtime/orchestrator/src/overlay_d3d12.cpp) +- [x] [runtime/orchestrator/src/overlay_native12.cpp](runtime/orchestrator/src/overlay_native12.cpp) +- [x] [runtime/orchestrator/src/overlay_native12_platform.h](runtime/orchestrator/src/overlay_native12_platform.h) +- [x] [runtime/orchestrator/src/overlay_panel.h](runtime/orchestrator/src/overlay_panel.h) +- [x] [runtime/orchestrator/src/overlay_platform.cpp](runtime/orchestrator/src/overlay_platform.cpp) +- [x] [runtime/orchestrator/src/overlay_platform.h](runtime/orchestrator/src/overlay_platform.h) +- [x] [runtime/orchestrator/src/overlay_wrapped12_platform.h](runtime/orchestrator/src/overlay_wrapped12_platform.h) +- [x] [runtime/orchestrator/src/sharpening_overlay.h](runtime/orchestrator/src/sharpening_overlay.h) +- [x] [ui/overlay/include/rescaleframe/overlay.h](ui/overlay/include/rescaleframe/overlay.h) + +**Fixtures (5)** + +- [x] [tests/overlay_dll_api.cpp](tests/overlay_dll_api.cpp) +- [x] [tests/overlay_dll_api_device.cpp](tests/overlay_dll_api_device.cpp) +- [x] [tests/overlay_dll_api_no_sr.cpp](tests/overlay_dll_api_no_sr.cpp) +- [x] [tests/overlay_native12.cpp](tests/overlay_native12.cpp) +- [x] [tests/overlay_panel_fixture.cpp](tests/overlay_panel_fixture.cpp) + +**Rust review findings (23)** + +- [x] **Duplication | Medium | Skip empty overlay draw calls before resolving textures on both renderers.** D3D11 builds draw commands at runtime/orchestrator/src/overlay_renderer11.rs:364, skipping zero indices and empty clipped rectangles before texture lookup. D3D12 independently computes the same clip bounds but resolves the descriptor first and propagates a missing texture as an error; overlay_native12.rs:881 then fails the entire panel. In a mixed frame an empty draw referencing an absent texture can therefore disable D3D12 while D3D11 still renders the other draws. Move empty-draw detection and clipped rectangle construction into overlay_geometry, leaving each backend's resource binding and policy for malformed nonempty calls separate. [runtime/orchestrator/src/overlay_native12.rs:380](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_native12.rs#L380) + +- [x] **Altitude | Medium | Allow the native D3D12 panel to recover after its failed owner retires.** A startup failure or slot wait timeout sets the process-global failed flag. retire_failed can subsequently release every panel, renderer and fence reference but never clears failed, and later Present calls return before initialization. Calls on a replacement device cannot even advance old-owner cleanup because retirement is gated on the incoming device and queue. Separate retiring work from readiness, finish it using the retained original owner, then allow a new device or an explicit retry to start the overlay. [runtime/orchestrator/src/overlay_native12.rs:739](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_native12.rs#L739) + +- [x] **Duplication | Medium | Normalize saved FG backends with the same rule used for live settings.** Config::valid at runtime/orchestrator/src/overlay_service.rs:303 requires Auto when an adapter advertises zero FG choices. Config::sanitize tests the same setting independently but skips normalization entirely for zero choices. A concrete FGBackend read at runtime/orchestrator/src/settings_store.rs:290 is therefore published by configure even after it reports that invalid saved values were replaced; subsequent unrelated panel edits reusing this settings snapshot fail validation. Share an FG-backend admission predicate and replace any inadmissible saved value with the validated adapter default. [runtime/orchestrator/src/overlay_service.rs:330](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_service.rs#L330) + +- [x] **Altitude | Medium | Preserve Auto as the requested FG setting when building panel statistics.** State::panel_stats replaces the requested Auto value with the currently selected provider, even though State::status returns the saved Auto request and exposes the effective backend separately. The panel passes this substituted value to its FG controls in ui/overlay/src/ffi.rs:340, so it displays an explicit vendor selection that the user did not make. Forward the saved requested value and keep the runtime's resolved provider solely in the effective field. [runtime/orchestrator/src/overlay_service.rs:862](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_service.rs#L862) + +- [x] **Altitude | Medium | Require an adapter to acknowledge an editable overlay option.** Config accepts nonempty adapter options without an option_changed callback, and apply_intent treats a missing callback as success. It updates the panel cache and logs applied despite having no way to change or persist the adapter setting. overlay_api.h:98 assigns both responsibilities to the adapter. Reject this configuration, or expose such options explicitly as read-only, and update the cached value only after acknowledgment. [runtime/orchestrator/src/overlay_service.rs:1076](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_service.rs#L1076) + +- [x] **Duplication | Medium | Share the generated overlay wire types with the overlay frontend.** Overlay frame export ui/overlay/src/ffi.rs:90 reads the manually declared RsfOverlayStats and returns RsfOverlayIntent from ui/overlay/src/abi.rs:259. The runtime constructs and consumes the same records at runtime/orchestrator/src/overlay_service.rs:816 and :1066 using generated types in runtime/orchestrator/src/overlay_abi.rs:519 and :795. The manual stats documentation already diverges on zero SR choice masks. Generate one dependency-free overlay ABI module from overlay.h for both crates, keep semantic defaults and safe model conversion in UI code, and retain independent ABI compatibility assertions. [ui/overlay/src/abi.rs:49](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/abi.rs#L49) + +- [x] **Duplication | Medium | Define the selectable SR quality levels from the same capability list the runtime accepts.** The UI's Quality::ALL and from_abi stop at 4, and ui/overlay/src/panel.rs:881 builds every quality control from that list. Vulkan XeSS accepts 5 in runtime/orchestrator/src/vulkan_sr.rs:87 and selects SDK Ultra Quality from the six-element mapping at runtime/orchestrator/src/vulkan_sr/xess.rs:31 and :422. A host reporting that supported level gets an unknown-quality label at panel.rs:922 and no way to select it there. Share quality identifiers and expose per-backend supported choices to the panel so level 5 is selectable for XeSS while unsupported backends omit it. [ui/overlay/src/model.rs:31](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/model.rs#L31) + +- [x] **Duplication | Medium | Define sharpening defaults once for the runtime, panel and recording fixtures.** runtime/orchestrator/include/rescaleframe/sharpening_settings.h:26 supplies twelve default values that ui/overlay/src/model.rs:361 hardcodes again for the panel state at :317. runtime/orchestrator/src/callback_host/tests.rs:181, render_host/tests.rs:168 and integrations/godot/native/platform/fake.rs:89 also copy that tuple into their fake defaults leaves. Changing a runtime default can leave the panel initialization and passing tests on the old values. Generate named defaults for both languages from one definition, keeping each wrapper's ABI header distinct, or use deliberate sentinel defaults in forwarding tests and verify the canonical tuple once. [ui/overlay/src/model.rs:361](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/model.rs#L361) + +- [x] **Altitude | Medium | Reconcile refused quality and enable requests with an explicit apply result.** Selection keeps requested_quality and requested_enabled until effective stats equal the request. If a host refuses a quality change, the old quality stays in effect and the requested control stays pending indefinitely. Clicking that same choice cannot retry because upscale_tab compares it with the pending selection. Return a request-specific applied, pending or refused result in the snapshot and clear the pending selection on refusal. [ui/overlay/src/panel.rs:191](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/panel.rs#L191) + +- [x] **Altitude | Medium | Keep every offered integration tab reachable at supported panel scales.** show includes Game when the adapter supplies options, but draw_rail stops creating buttons when one does not fit, and only the selected tab body can scroll. At 720p with the 1.5x panel size the rail has 272 points. With sharpening offered, the fourth tab, Game, needs 290 points and has no status-strip shortcut. Make the rail scroll or provide overflow navigation so an adapter's controls remain reachable at that scale. [ui/overlay/src/panel.rs:667](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/panel.rs#L667) + +- [x] **Altitude | Medium | Let the pacing owner resolve the VRR frame limit from the effective output mode.** The panel multiplies the display interval plus 300 microseconds by requested_generated + 1, then emits only a fixed frame_limit_us. With 4x requested but generation suspended, choosing VRR on a 120 Hz display caps real frames at about 29 fps. The pacing owner receives no VRR intent to recalculate after a provider, generation count or refresh change. Send the selected limiter policy and resolve its interval from effective state at the orchestrator. [ui/overlay/src/panel.rs:1317](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/panel.rs#L1317) + +- [x] **Duplication | Medium | Share the FG deferral-reason catalog across the runtime and overlay.** Native FG assigns code 7 for invalid input at runtime/orchestrator/src/native_fg.rs:1194 and :1211. The panel receives that code via runtime/orchestrator/src/overlay_service.rs:888 but its independent numeric text table skips 7, so frames_tab at :1074 labels an invalid source as waiting for SDK-confirmed generation. OverlayService::description at :487 and runtime/orchestrator/src/render_host.rs:1141 independently translate overlapping subsets. Generate the identifiers from native_fg.h and share a complete reason-to-description table with explicit invalid-input and unknown cases, leaving host-level status precedence at each caller. [ui/overlay/src/panel.rs:2294](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/panel.rs#L2294) + +- [x] **Altitude | Medium | Leave presented FPS unknown when generation is active without an aggregate counter.** overlay_service.rs:891 reports aggregate-counter validity independently from vendor.active. Meter substitutes application_presented_frames when the aggregate is unavailable, then the HUD labels the result Presented. During active interpolation this counts only source Presents and can report identical rendered and presented rates while additional outputs are displayed. Keep the rendered rate and mark presented unavailable until an aggregate source is valid, using the application counter only for a known pass-through interval. [ui/overlay/src/performance.rs:28](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/performance.rs#L28) + +- [x] **Simplicity | Low | overlay_native12 Panel keeps its started state as three parallel Options and unwraps them on every Present** Panel (overlay_native12.rs:552-569) holds ui: Option, native: Option and fence: Option. They are only set together by initialize (:625-631) and only cleared together by retire_failed (:692-694). native.is_none() is the started test (:648, :745). rsf_core_overlay12_present then re-opens the invariant with .unwrap() at :765 (native), :766 and :776 (fence), :782 (native), :833 (ui), :870 (ui) and :891 (fence), and Fence::finish_event unwraps self.event at :166. Simpler: one started: Option field, matched once at the top of present (let Some(started) = &mut panel.started else { initialize }), so the seven unwraps become field accesses and "half-initialized" cannot be expressed. device/queue could live in Started too, since they are written in the same initialize. Tradeoff: retire_failed must take the whole struct, which it already does field by field. Fields drop in declaration order today, and the struct must keep the same order (atlas and graphics before ui and renderer) to preserve teardown order. This is separate from the per-call platform.X.unwrap() pattern in the same file (19 Option slots, which the tests stub selectively). [runtime/orchestrator/src/overlay_native12.rs:552](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_native12.rs#L552) + +- [x] **Duplication | Low | Use one elapsed-frame policy for the shared overlay panel.** The native D3D12 host subtracts millisecond ticks and sends the elapsed time directly to collect_input; the D3D11 host at runtime/orchestrator/src/overlay_host.rs:335 computes the same panel input in QPC ticks but substitutes 1/60 s for the first frame and any gap over 250 ms. After one second hidden, the D3D12 route can advance the panel clock by one second while D3D11 advances it by one nominal frame; ui/overlay/src/overlay.rs:368 accepts deltas up to one second. Share normalization of elapsed seconds across both hosts, preserving each clock source and GPU submission path. [runtime/orchestrator/src/overlay_native12.rs:813](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_native12.rs#L813) + +- [x] **Duplication | Low | Use one draw-admission decision for the wrapped overlay.** D3D11-on-12 starts a local timer after host startup and gates back-buffer wrapping on visibility, the performance HUD and eight seconds of startup hint. Its draw leaf then calls the host's draw_target, which repeats the same gate at runtime/orchestrator/src/overlay_host.rs:411 against a second clock initialized earlier at :331. A change to hint duration can make the wrapper suppress a requested frame or repeatedly acquire and flush a wrapped buffer the host declines. Expose one host-owned draw decision that the wrapper can consult before acquiring the back buffer, keeping resource acquisition conditional. [runtime/orchestrator/src/overlay_wrapped12.rs:195](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/overlay_wrapped12.rs#L195) + +- [x] **Altitude | Low | Document that a zero SR choice mask disables the upscaling controls.** The public Rust ABI field tells a host that zero selects a default list. overlay.h:149, the safe Stats model, panel.rs:548 and the no-SR fixture instead treat zero as an explicit declaration of no SR. A host following the Rust field contract can hide its functioning upscaler. Align the Rust documentation with the header and state that every SR-capable host must send its actual backend mask. [ui/overlay/src/abi.rs:165](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/abi.rs#L165) + +- [x] **Simplicity | Low | Make the reported quality a single value in the overlay model.** Stats exposes both quality_raw and its decoded Option. borrow_stats, Stats::default and set_quality keep them in sync manually, while panel.rs reads one for selection/reconciliation and the other for unknown-level text. Store the ABI value once and decode it with a quality() accessor where needed. This preserves the unknown numeric level and existing C ABI, at the cost of updating Rust callers of the two public fields and doing a small match on read. [ui/overlay/src/model.rs:152](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/model.rs#L152) + +- [x] **Simplicity | Low | Use the input event position to draw the overlay cursor.** Every visible frame converts both host mouse coordinates from pixels to points twice. raw_input sanitizes the coordinates, scales them and uses the result for egui motion and button events. frame repeats that work for paint_cursor. Return the computed Pos2 alongside RawInput and pass it directly to the painter. This adds one tuple element and keeps cursor placement and hit testing on the same conversion while preserving raw pixel history for move detection. [ui/overlay/src/overlay.rs:228](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/overlay.rs#L228) + +- [x] **Simplicity | Low | Draw available tabs directly from the fixed tab list.** show allocates a Vec of at most five tabs each visible frame and scans it to check the active tab. draw_rail then searches Tab::ALL twice for each visible tab to obtain the widget ID and Controls index. Compute availability once for the fixed five entries, check the current tab against it, and iterate indexed offered entries with a separate displayed-row index. This retains the order, fallback tab, IDs and compact row positions without a heap allocation or repeated position searches. [ui/overlay/src/panel.rs:336](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/panel.rs#L336) + +- [x] **Simplicity | Low | Limit the segmented control to the single-row layout its callers use.** All twelve private segments callers pass one column per item and construct every Segment with sub: None. The widget nevertheless computes multiple rows and paints a separate two-line subtitle layout; each caller must repeat its own column count. Derive the column count from items.len(), lay out one row and remove the subtitle field and branch. Keep newline-aware font size and height for the existing Depth RCAS and Depth DAS labels. A future layout needing subtitles or wrapping could add that behavior when it has a caller. [ui/overlay/src/panel.rs:1745](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/panel.rs#L1745) + +- [x] **Boundaries | Low | Replace the AC7 scene wording for the generic FG scene-unsupported reason.** waiting_reason maps fg_reason 4 to "Waiting for flight, hangar, or briefing". Code 4 is the vendor-neutral RSF_NATIVE_FG_REASON_SCENE_UNSUPPORTED (runtime/orchestrator/include/rescaleframe/native_fg.h:23, set in runtime/orchestrator/src/fg12.rs:824), which every FG-capable integration can produce, while flight/hangar/briefing are Ace Combat 7 screen classes (games/ac7/src/native_renderer.cpp:253-266). AGENTS.md Rule 2 forbids game-specific wording or controls in ui/overlay, so a Skyrim, Fallout 4 or Unity session paused on an ineligible screen is told to wait for an AC7 hangar. The runtime already words the same code generically in overlay_service.rs:490 ("Scene is not eligible"). Use a game-neutral phrase here, or have the adapter describe its eligible screens through the overlay service if that detail is wanted. The paint_cursor doc comment at ui/overlay/src/overlay.rs:513 ("because AC7 hides the system cursor") should be made neutral at the same time. [ui/overlay/src/panel.rs:2299](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/panel.rs#L2299) + +- [x] **Simplicity | Low | Check detailed HUD inputs before formatting the text.** Overlay::frame calls HudDetail::of on every frame with detailed HUD enabled. That allocates and formats SR and frame-limit strings before HudCache can compare its key, then update clones both strings into rows on a miss. Key the cache by cheap display inputs (optional active SR backend and quality, and frame-limit microseconds), format them directly into rows only on a miss, and preserve the distinction between compact and detailed HUD. This may refresh once when two raw limits round to the same visible FPS, but unchanged frames no longer rebuild either string. [ui/overlay/src/panel.rs:2349](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/ui/overlay/src/panel.rs#L2349) + +## Graphics and presentation + + + +### G01 · Graphics observers and device identity + +Port D3D11 and D3D12 observer registration, device identity and callback retirement. + +**Coordinate shared edits** + +- Observer callbacks, saved D3D state and slot restoration ([G02](#g02), [G03](#g03)). + +**Port files (12)** + +- [x] [runtime/graphics/include/rescaleframe/d3d11_observer.h](runtime/graphics/include/rescaleframe/d3d11_observer.h) +- [x] [runtime/graphics/include/rescaleframe/d3d12_observer.h](runtime/graphics/include/rescaleframe/d3d12_observer.h) +- [x] [runtime/graphics/src/d3d11_observer.cpp](runtime/graphics/src/d3d11_observer.cpp) +- [x] [runtime/graphics/src/d3d11_observer_callbacks.h](runtime/graphics/src/d3d11_observer_callbacks.h) +- [x] [runtime/graphics/src/d3d11_observer_capture.h](runtime/graphics/src/d3d11_observer_capture.h) +- [x] [runtime/graphics/src/d3d11_observer_hooks.h](runtime/graphics/src/d3d11_observer_hooks.h) +- [x] [runtime/graphics/src/d3d11_observer_module.h](runtime/graphics/src/d3d11_observer_module.h) +- [x] [runtime/graphics/src/d3d11_observer_present.h](runtime/graphics/src/d3d11_observer_present.h) +- [x] [runtime/graphics/src/d3d12_observer.cpp](runtime/graphics/src/d3d12_observer.cpp) +- [x] [runtime/graphics/src/d3d12_observer_platform.h](runtime/graphics/src/d3d12_observer_platform.h) +- [x] [runtime/graphics/src/device_owner.h](runtime/graphics/src/device_owner.h) +- [x] [runtime/graphics/src/vtable_patch.h](runtime/graphics/src/vtable_patch.h) + +**Fixtures (2)** + +- [x] [tests/d3d11_observer.cpp](tests/d3d11_observer.cpp) +- [x] [tests/d3d12_observer.cpp](tests/d3d12_observer.cpp) + +**Rust review findings (3)** + +- [x] **Altitude | Medium | Associate captured resources with the selected presenting device.** adopt_device replaces the retained device and clears its immediate context but leaves textures and constant buffers from earlier devices in one bounded inventory. record_texture counts those entries toward capacity, and record_buffer replaces by byte size alone. A helper device can fill the texture slots before the real Present or overwrite a constant buffer later, so dump::write tries foreign resources and misses the actual device's inputs. Partition or filter inventory by COM device identity and transfer only matching candidates when Present selects the owner. [runtime/orchestrator/src/d3d11_observer_capture.rs:203](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_observer_capture.rs#L203) + +- [x] **Altitude | Medium | Retain or verify the storage behind D3D11 probe vtables.** probe returns raw vtable addresses after releasing the temporary device, chain and chain1 interfaces. d3d11_observer.cpp:838 reads those tables to form patch slots, and Hooks retains slot addresses for later retirement. An object-local proxy vtable can disappear when the temporary object's final reference drops. Admit only independently verified resident tables, or retain the backing probe owner for the entire period the slots are read or patched. [runtime/orchestrator/src/d3d11_observer_hooks/probe.rs:124](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_observer_hooks/probe.rs#L124) + +- [x] **Duplication | Medium | Share checked on-disk PE section lookup between the observer and Skyrim compatibility code.** runtime/orchestrator/src/d3d11_observer_module.rs:31 and :62 validate PE32+ headers and translate RVAs into bounded file bytes for :135. games/skyrim-se/src/compatibility.rs:98 and :119 repeat the DOS/NT/COFF walk, section iteration and raw-range check for exact Community Shaders guards at :154. Skyrim additionally verifies fingerprint facts and executable section flags, while the observer needs the preferred image base and refuses virtual tails. Share a read-only PE32+ view returning bounded bytes and section characteristics, leaving profile limits and comparison rules at the callers. Run a common set of truncated-table and virtual-tail vectors against that parser. [runtime/orchestrator/src/d3d11_observer_module.rs:62](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_observer_module.rs#L62) + + + +### G02 · Frame tap, constants and scene promotion + +Port slot substitution, constant overrides and promotion as one lifetime chain. Address the restoration findings before releasing borrowed views. + +**Coordinate shared edits** + +- Borrowed view and constant-buffer identity across render, capture and velocity ([A02](#a02), [A03](#a03), [A05](#a05)). +- Observer callbacks, saved D3D state and slot restoration ([G01](#g01), [G03](#g03)). + +**Port files (9)** + +- [x] [runtime/graphics/include/rescaleframe/constant_buffer_read.h](runtime/graphics/include/rescaleframe/constant_buffer_read.h) +- [x] [runtime/graphics/include/rescaleframe/constant_twin.h](runtime/graphics/include/rescaleframe/constant_twin.h) +- [x] [runtime/graphics/include/rescaleframe/frame_tap.h](runtime/graphics/include/rescaleframe/frame_tap.h) +- [x] [runtime/graphics/include/rescaleframe/scene_promote.h](runtime/graphics/include/rescaleframe/scene_promote.h) +- [x] [runtime/graphics/src/constant_buffer_read.cpp](runtime/graphics/src/constant_buffer_read.cpp) +- [x] [runtime/graphics/src/constant_twin.cpp](runtime/graphics/src/constant_twin.cpp) +- [x] [runtime/graphics/src/frame_tap.cpp](runtime/graphics/src/frame_tap.cpp) +- [x] [runtime/graphics/src/frame_tap_platform.h](runtime/graphics/src/frame_tap_platform.h) +- [x] [runtime/graphics/src/scene_promote.cpp](runtime/graphics/src/scene_promote.cpp) + +- [x] [runtime/orchestrator/src/frame_tap_callbacks.cpp](runtime/orchestrator/src/frame_tap_callbacks.cpp) (introduced by the port to contain foreign C++ callback exceptions; now the C11 leaf [frame_tap_callbacks.c](runtime/orchestrator/src/frame_tap_callbacks.c) built by `build.rs`) + +**Fixtures (3)** + +- [x] [tests/constant_override.cpp](tests/constant_override.cpp) +- [x] [tests/frame_tap.cpp](tests/frame_tap.cpp) +- [x] [tests/scene_promote.cpp](tests/scene_promote.cpp) + +**Rust review findings (10)** + +- [x] **Altitude | High | Retain frame-tap slot ownership until restoration succeeds.** restore clears each replacement before calling the fallible platform writer and ignores its result. Failed-install rollback also clears the original pointer. A refused restoration can therefore leave a live detour with no recorded owner or forward target, while ordinary uninstall returns success and permits a new installation. Return the restoration result and retain forwarding state and the outstanding slots until restoration succeeds or the owner is explicitly retired. [runtime/orchestrator/src/frame_tap.rs:331](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_tap.rs#L331) + +- [x] **Altitude | High | Retain overridden constant buffers until their original bindings are restored.** begin_constant_override binds the replacement first and saves only the raw pointer from the binding snapshot. The native seed_geometry leaf releases its queried references, relying on the context to keep the bound buffers alive. Replacing a binding can drop that last reference, leaving end_constant_override to rebind a stale address after the draw. Acquire an owned reference to each original before replacing it and release it after restoring the corresponding slot. [runtime/orchestrator/src/frame_tap.rs:1424](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_tap.rs#L1424) + +- [x] **Altitude | High | Expire pending Map pointers with the frame-tap installation that observed them.** The process-wide PENDING table stores mapped CPU pointers until a matching Unmap by resource address. Uninstall drains in-flight hooks but neither uninstall nor retire_render clears this table. A Map followed by uninstall and an unobserved Unmap leaves a dangling entry. After reinstall, a later Unmap on that address can pass the old pointer to the new constant watch. Clear pending mappings at drained teardown and tie their identity to the observed context and installation. [runtime/orchestrator/src/frame_tap.rs:3171](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_tap.rs#L3171) + +- [x] **Altitude | High | Tie promotion rebuilds to successful retirement of the tap's borrowed views.** Promote::prepare drops its prior Frame on the assumption that the caller cleared the tap. apply_tail in loader/proxy/src/dlss_bridge.c:3618 calls rsf_frame_tap_set_plan(NULL) but ignores a refusal, then prepares new replacements. A concurrent admitted callback can make that clear fail while the tap still holds the old views. Require successful detachment before replacing the frame and make plan publication carry an ownership lease so a refused transition keeps the last valid plan alive. [runtime/orchestrator/src/scene_promote.rs:354](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/scene_promote.rs#L354) + +- [x] **Duplication | Medium | Report truncated pixel inputs consistently to every frame-tap draw callback.** divert_facts and consider_target_draw independently enumerate the occupied pixel-shader slots into rsf_frame_tap_target_draw. The reporting branch sets inputs_truncated at runtime/orchestrator/src/frame_tap.rs:1544, but the verdict and override paths at :1334 and :1391 stop at the same MAX_INPUTS limit and leave the flag zero. Thus a callback accepting the public record cannot tell those lists were cut short, even though consumers such as games/ac7/src/scene_color.rs:123 use that flag to refuse incomplete evidence. Extract the bounded input-list collector and populate its count and truncation fields for every draw callback. [runtime/orchestrator/src/frame_tap.rs:1089](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_tap.rs#L1089) + +- [x] **Altitude | Medium | Pin the original blend object while its address keys the patched-state cache.** begin_divert obtains a temporary reference to the bound blend, patched_blend_for caches its raw address alongside an owned patched blend, and release_saved drops the reference after restoring the draw. If the game releases that original and D3D11 reuses its address, a later draw gets the previous object's patched color and blend settings. Retain each non-null original until cache eviction, as Samplers already does for the analogous sampler-clone cache. [runtime/orchestrator/src/frame_tap.rs:1151](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_tap.rs#L1151) + +- [x] **Altitude | Medium | Invalidate every shadowed pipeline object when ClearState resets the context.** The ClearState detour calls invalidate_geometry, which clears the input layout, vertex shader, constants and target but leaves pixel_shader, blend_state and depth_stencil_state unchanged. Subsequent candidate_passes and common_facts still read those old addresses until new bind calls arrive. This can select a draw using a shader that is no longer bound and report stale blend/depth facts. Reset those fields with the context state and reseed them when the caller requires the actual bindings. [runtime/orchestrator/src/frame_tap.rs:1887](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_tap.rs#L1887) + +- [x] **Altitude | Medium | Scale the viewport from the binding actually forwarded.** When the replacement target and depth have different extents and the plan says DEPTH_REFUSE, plan_targets returns the game's original views. After forwarding those views, settle_target_substitution asks only whether the plan has an applicable replacement and marks the original target as substituted. Subsequent viewport and scissor requests are scaled for an output that was never bound. Return the actual substitution decision with the forwarded target and use that fact to update the viewport policy. [runtime/orchestrator/src/frame_tap.rs:2677](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_tap.rs#L2677) + +- [x] **Altitude | Low | Declare constant-watch write access when registering the callback.** The bridge's refresh_constant_watch must register a callback and then call set_constant_watch_writable because every registration silently restores write mode. The same mutable-pointer callback is used for a copied writable upload or the game's own read-only memory, depending on that second call. Accept the access mode in one registration and expose const data to observational callbacks, leaving a separate live mode change only for callers that actually switch behavior. [runtime/orchestrator/src/frame_tap.rs:2289](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_tap.rs#L2289) + +- [x] **Duplication | Low | Use the frame tap's plan type for scene promotion in the same crate.** The generator explicitly requests the plan, substitution and gate callback twice (tools/generate-rust-bindings.py:69 and :304), creating two nominal Rust definitions of a single contract. Scene promotion fills the first at runtime/orchestrator/src/scene_promote.rs:507 and frame_tap.rs:2208 reads the second defined at runtime/orchestrator/src/frame_tap_abi.rs:337. The proxy passes the very same plan between these calls at loader/proxy/src/dlss_bridge.c:3632 and :3645. Generate the common types once, with the zero default required by promotion, and import them into scene_promote_abi as this crate already does for resource-role records. [runtime/orchestrator/src/scene_promote_abi.rs:50](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/scene_promote_abi.rs#L50) + + + +### G03 · Graphics state, composition and resource roles + +Port state preservation, role selection, UI composition and resource views together with the device-facing fixtures. + +**Coordinate shared edits** + +- Observer callbacks, saved D3D state and slot restoration ([G01](#g01), [G02](#g02)). + +**Port files (25)** + +- [x] [runtime/graphics/include/rescaleframe/d3d11_state.h](runtime/graphics/include/rescaleframe/d3d11_state.h) +- [x] [runtime/graphics/include/rescaleframe/resource_ref.h](runtime/graphics/include/rescaleframe/resource_ref.h) +- [x] [runtime/graphics/include/rescaleframe/resource_roles.h](runtime/graphics/include/rescaleframe/resource_roles.h) +- [x] [runtime/graphics/include/rescaleframe/srv_cache.h](runtime/graphics/include/rescaleframe/srv_cache.h) +- [x] [runtime/graphics/include/rescaleframe/srv_format.h](runtime/graphics/include/rescaleframe/srv_format.h) +- [x] [runtime/graphics/include/rescaleframe/ui_identify.h](runtime/graphics/include/rescaleframe/ui_identify.h) +- [x] [runtime/graphics/include/rescaleframe/ui_layer.h](runtime/graphics/include/rescaleframe/ui_layer.h) +- [x] [runtime/graphics/src/d3d11_state.cpp](runtime/graphics/src/d3d11_state.cpp) +- [x] [runtime/graphics/src/d3d11_state_private.h](runtime/graphics/src/d3d11_state_private.h) +- [x] [runtime/graphics/src/resource_ref.cpp](runtime/graphics/src/resource_ref.cpp) +- [x] [runtime/graphics/src/ui_layer.cpp](runtime/graphics/src/ui_layer.cpp) +- [x] [runtime/orchestrator/include/rescaleframe/native_composition.h](runtime/orchestrator/include/rescaleframe/native_composition.h) +- [x] [runtime/orchestrator/include/rescaleframe/native_translucency.h](runtime/orchestrator/include/rescaleframe/native_translucency.h) +- [x] [runtime/orchestrator/src/com_ref.cpp](runtime/orchestrator/src/com_ref.cpp) +- [x] [runtime/orchestrator/src/native_regions.cpp](runtime/orchestrator/src/native_regions.cpp) +- [x] [runtime/orchestrator/src/native_regions.h](runtime/orchestrator/src/native_regions.h) +- [x] [runtime/orchestrator/src/native_regions_com.cpp](runtime/orchestrator/src/native_regions_com.cpp) +- [x] [runtime/orchestrator/src/native_reinsert.h](runtime/orchestrator/src/native_reinsert.h) +- [x] [runtime/orchestrator/src/native_reinsert_platform.cpp](runtime/orchestrator/src/native_reinsert_platform.cpp) +- [x] [runtime/orchestrator/src/native_translucency.cpp](runtime/orchestrator/src/native_translucency.cpp) +- [x] [runtime/orchestrator/src/native_translucency_com.cpp](runtime/orchestrator/src/native_translucency_com.cpp) +- [x] [runtime/orchestrator/src/sampler_bias_bridge.h](runtime/orchestrator/src/sampler_bias_bridge.h) +- [x] [runtime/orchestrator/src/sampler_bias_com.cpp](runtime/orchestrator/src/sampler_bias_com.cpp) +- [x] [runtime/orchestrator/src/depth_domains_abi.cpp](runtime/orchestrator/src/depth_domains_abi.cpp) (shared SDK predicate thunk) +- [x] [runtime/orchestrator/src/native_composition_unload.cpp](runtime/orchestrator/src/native_composition_unload.cpp) (CRT teardown registration; now the C11 initializer [native_composition_unload.c](runtime/orchestrator/src/native_composition_unload.c)) + +**Fixtures (8)** + +- [x] [tests/d3d11_state.cpp](tests/d3d11_state.cpp) +- [x] [tests/native_reinsert.cpp](tests/native_reinsert.cpp) +- [x] [tests/native_translucency.cpp](tests/native_translucency.cpp) +- [x] [tests/native_translucency_abi.cpp](tests/native_translucency_abi.cpp) +- [x] [tests/resource_roles.cpp](tests/resource_roles.cpp) +- [x] [tests/sampler_bias.cpp](tests/sampler_bias.cpp) +- [x] [tests/ui_identify.cpp](tests/ui_identify.cpp) +- [x] [tests/ui_layer.cpp](tests/ui_layer.cpp) + +**Rust review findings (6)** + +- [x] **Altitude | Medium | Include session identity in the translucency mask lease.** Ledger::open receives session_id but only uses it to match pending cloud depth. The mask key used by open_frame and take contains family, view, native frame and rectangle alone. Two sessions reusing those values on the same D3D11 device can be treated as one open scope, and SR can read the previous session's opaque snapshot and masks. Include session_id in Key and in the same-view close rule, and test identical keys from distinct sessions. [runtime/orchestrator/src/native_translucency.rs:159](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_translucency.rs#L159) + +- [x] **Duplication | Low | Use the public all-zero depth-domain rule in region preparation.** The depth kernel chooses legacy copying at runtime/orchestrator/src/native_regions.rs:282 using a field-by-field empty_layout predicate that enumerates every scalar, bitwise float and both transform arrays. The published contract at sdk/game/include/rescaleframe/game_renderer.h:45 defines the same decision as any nonzero byte, already used in the OpenGL evaluation path through runtime/orchestrator/src/gl_pipeline_platform.cpp:172. A newly appended field would immediately request mapping in those callers but be ignored by the field list until it too is edited. Reuse the published requested predicate for the full descriptor and keep the separate unused-domain validation at native_regions.rs:303. [runtime/orchestrator/src/native_regions.rs:124](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_regions.rs#L124) + +- [x] **Duplication | Low | Unbind D3D11 output targets once per temporal-mask dispatch.** The temporal-mask entry invoked from runtime/orchestrator/src/native_regions.cpp:117 unbinds output targets before its optional readable copy at runtime/orchestrator/src/native_regions.rs:804, then repeats the call at :842. The intervening code only creates or looks up SRVs, optionally copies a texture and builds constants; none of it binds an output. The leaf at runtime/orchestrator/src/d3d11_output_platform.cpp:89 issues an actual OMSetRenderTargets call both times. Keep the first unbind so the copy remains legal and remove the second call from the per-frame path. [runtime/orchestrator/src/native_regions.rs:842](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_regions.rs#L842) + +- [x] **Simplicity | Low | native_reinsert and native_exposure re-implement the SRV cache that native_regions already shares** native_regions.rs:399-424 exports pub(super) SourceView::get(cache, device, texture, format). It returns the cached view when the retained texture matches, otherwise creates an SRV with rsf_d3d11_output_create_srv and retains the texture so its identity cannot be reused. native_translucency.rs:15 and :544-553 already reuse it. native_reinsert.rs:97-136 declares its own SourceView { view, source } and Conversions::source_view with the same body (match retained pointer, else create SRV, retain, insert). native_exposure.rs:34-113 declares a third SourceView { view, source } with a two-entry round-robin of the same create-and-retain step. motion_d3d11.rs:31-92 is a fourth, generic SourceViews LRU (with idle expiry) shared by motion_decode and motion_resolve. Simpler: native_reinsert keeps an Option and calls SourceView::get, deleting its private struct and method. native_exposure can do the same with [Option; 2], or use motion_d3d11::SourceViews<2>. Tradeoff: SourceView::get drops the cache entry before creating the replacement while native_reinsert keeps the old view on failure; the shared helper would need to commit only after success (native_exposure already documents "Commit the replacement only after the new SRV is valid"). [runtime/orchestrator/src/native_reinsert.rs:97](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_reinsert.rs#L97) + +- [x] **Duplication | Low | Reuse the same R32 mask texture and UAV owner in both D3D11 passes.** Translucency creates three MaskTarget objects for reactive, coverage and bias output at runtime/orchestrator/src/native_translucency.rs:467. Region merging independently defines the same two-ComRef type and constructor at runtime/orchestrator/src/native_regions.rs:563 and creates two targets at :797. Both allocate a single-sample, single-mip R32_FLOAT texture with shader-read and unordered-access flags, then call the same rsf_regions_create_uav leaf. Expose one constructor beside the shared region resources so allocation flags, creation-failure cleanup and view lifetime are maintained together; each pass still chooses its own target count. [runtime/orchestrator/src/native_translucency.rs:440](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_translucency.rs#L440) + +- [x] **Altitude | Low | Give the frame-tap classifier the actual render extent or the adapter's supported range.** Without a known render size, at_render_resolution enforces a fixed half-output minimum for every adapter. frame_tap.rs::role_of always passes zero render dimensions, even though the runtime itself recognizes 3x output/input as Ultra Performance. At that ratio, a correctly shaped motion, depth or scene-color input cannot match any RENDER_SIZED rule. Pass the current render extent when known, or make the uncertain range part of the adapter's rule and retain candidate confidence. [runtime/orchestrator/src/resource_roles.rs:35](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/resource_roles.rs#L35) + + + +### G04 · Colour, depth, motion and fullscreen passes + +Port colour transport, depth and motion processing and the fullscreen effects, with the format and normalization fixtures. + +**Coordinate shared edits** + +- Shader inputs, formats and compilation interfaces ([G05](#g05), [G06](#g06)). + +**Port files (26)** + +- [x] [runtime/graphics/include/rescaleframe/colour_fidelity.h](runtime/graphics/include/rescaleframe/colour_fidelity.h) +- [x] [runtime/graphics/include/rescaleframe/colour_transport.h](runtime/graphics/include/rescaleframe/colour_transport.h) +- [x] [runtime/graphics/include/rescaleframe/depth_replay.h](runtime/graphics/include/rescaleframe/depth_replay.h) +- [x] [runtime/graphics/include/rescaleframe/depth_scale.h](runtime/graphics/include/rescaleframe/depth_scale.h) +- [x] [runtime/graphics/include/rescaleframe/fullscreen_pass.h](runtime/graphics/include/rescaleframe/fullscreen_pass.h) +- [x] [runtime/graphics/include/rescaleframe/motion_decode.h](runtime/graphics/include/rescaleframe/motion_decode.h) +- [x] [runtime/graphics/include/rescaleframe/motion_resolve.h](runtime/graphics/include/rescaleframe/motion_resolve.h) +- [x] [runtime/graphics/include/rescaleframe/present_blit.h](runtime/graphics/include/rescaleframe/present_blit.h) +- [x] [runtime/graphics/src/colour_d3d11_platform.h](runtime/graphics/src/colour_d3d11_platform.h) +- [x] [runtime/graphics/src/colour_fidelity.cpp](runtime/graphics/src/colour_fidelity.cpp) +- [x] [runtime/graphics/src/colour_transport.cpp](runtime/graphics/src/colour_transport.cpp) +- [x] [runtime/graphics/src/depth_platform.h](runtime/graphics/src/depth_platform.h) +- [x] [runtime/graphics/src/depth_replay.cpp](runtime/graphics/src/depth_replay.cpp) +- [x] [runtime/graphics/src/depth_scale.cpp](runtime/graphics/src/depth_scale.cpp) +- [x] [runtime/graphics/src/depth_scale_private.h](runtime/graphics/src/depth_scale_private.h) +- [x] [runtime/graphics/src/fullscreen_pass.cpp](runtime/graphics/src/fullscreen_pass.cpp) +- [x] [runtime/graphics/src/fullscreen_platform.h](runtime/graphics/src/fullscreen_platform.h) +- [x] [runtime/graphics/src/motion_d3d11_platform.h](runtime/graphics/src/motion_d3d11_platform.h) +- [x] [runtime/graphics/src/motion_decode.cpp](runtime/graphics/src/motion_decode.cpp) +- [x] [runtime/graphics/src/motion_decode_platform.h](runtime/graphics/src/motion_decode_platform.h) +- [x] [runtime/graphics/src/motion_resolve.cpp](runtime/graphics/src/motion_resolve.cpp) +- [x] [runtime/graphics/src/motion_resolve_platform.h](runtime/graphics/src/motion_resolve_platform.h) +- [x] [runtime/graphics/src/present_blit.cpp](runtime/graphics/src/present_blit.cpp) +- [x] [runtime/orchestrator/src/motion_convention.h](runtime/orchestrator/src/motion_convention.h) +- [x] [tools/exposure_probe/ngx.cpp](tools/exposure_probe/ngx.cpp) (pinned NGX virtual-parameter calls; replaced by C11 `tools/exposure_probe/ngx.c`, which calls the SDK vtable slots directly) +- [x] [tools/exposure-probe.cpp](tools/exposure-probe.cpp) + +**Fixtures (6)** + +- [x] [tests/colour_transport.cpp](tests/colour_transport.cpp) +- [x] [tests/depth_scale.cpp](tests/depth_scale.cpp) +- [x] [tests/exposure_normalization.cpp](tests/exposure_normalization.cpp) +- [x] [tests/fullscreen_pass.cpp](tests/fullscreen_pass.cpp) +- [x] [tests/motion_decode.cpp](tests/motion_decode.cpp) +- [x] [tests/motion_resolve.cpp](tests/motion_resolve.cpp) + +**Rust review findings (5)** + +- [x] **Altitude | Medium | Distinguish a missing optional depth layer from a rejected supplied layer.** When a non-null depth layer has the wrong device, format, extent or fails SRV creation, resolve sets has_layer to zero and can report success exactly as if no layer had been requested. native_sr.rs:208 supplies the layer for motion reconstruction, and native_fg.rs:1083 clears it downstream on the assumption D3D11 consumed it. Return a failure or an explicit layer-use result so the caller can choose whether scene-depth-only reprojection is acceptable. [runtime/orchestrator/src/motion_resolve.rs:162](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/motion_resolve.rs#L162) + +- [x] **Boundaries | Low | Move Unreal motion and jitter conventions out of the runtime backend crate.** runtime/backends/rsf-upscaler is a Runtime workspace crate, yet it encodes engine storage conventions: Encoding::UNREAL_G16R16 and MotionVectors::unreal_object_only (motion.rs:42, :73), Jitter::from_unreal_clip and MotionToPixels::unreal (frame.rs:40, :97), recommended_phase_count tuned for r.TemporalAASamples (frame.rs:68), and AC7 fixtures in lib.rs tests. AGENTS.md Rule 1 places native engine layouts and conventions in games/ or integrations/, with the runtime receiving adapter-supplied facts such as rsf_motion_decode_params. No crate, CMake target or C++ file depends on rsf-upscaler (the only mention is a comment in ui/overlay/src/model.rs:10), so the Runtime-side copy also disagrees silently with the live decode path. Delete the crate, or keep only the vendor-neutral check()/Reasons/Quality types in runtime and move the Unreal encodings and AC7 tests to games/ac7 where the decode parameters are actually produced. [runtime/backends/rsf-upscaler/src/motion.rs:42](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/backends/rsf-upscaler/src/motion.rs#L42) + +- [x] **Duplication | Low | Use the same rectangle and jitter predicates for auxiliary color and depth scaling.** DepthScale::render checks its integer source/output rectangles and finite +/-16384-pixel jitter at runtime/orchestrator/src/depth_scale.rs:176. The auxiliary surface validator independently implements the same integer output bounds and jitter limit at runtime/orchestrator/src/auxiliary_sr.rs:103 and :117, consumed by SurfacePlan validation and the draw path. A change to allowed auxiliary coordinates currently needs two implementations with separate boundary tests. Share the integer rectangle and jitter predicates, leaving auxiliary color's fractional source bounds in Mapping. [runtime/orchestrator/src/depth_scale.rs:78](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/depth_scale.rs#L78) + +- [x] **Simplicity | Low | Auxiliary SR reaches the Rust depth-scale owner through two C layers** AuxiliarySr (auxiliary_sr.rs:548-561, 687-692, 769-770, 808-814, 862) drives depth scaling through rsf_aux_platform.depth_create/reserve/prepare/redraw/commit/restore/discard/destroy. auxiliary_sr.cpp:179 fills those slots with the public rsf_depth_scale_* functions, and runtime/graphics/src/depth_scale.cpp:154-191 forwards each one to rsf_core_depth_scale_* with its static platform, which lands back in DepthScale in this same orchestrator crate (depth_scale.rs:291-402). Each call therefore goes Rust -> C++ table -> C++ wrapper -> Rust export, the handle travels as an opaque rsf_depth_scale*, and every step re-checks nulls, thread ownership and ABI fields that the Rust caller already holds. Simpler: give AuxiliarySr an Option> created with the depth Platform pointer (one pointer in rsf_aux_platform instead of eight leaves) and call reserve/render/commit/restore/discard directly; keep the public rsf_depth_scale_* C entry points only for their remaining C caller (tests/depth_scale.cpp). Tradeoff: DepthScale becomes pub(crate) and the aux platform gains one pointer; removes eight Option leaves and two forwarding layers. [runtime/orchestrator/src/depth_scale.rs:291](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/depth_scale.rs#L291) + +- [x] **Duplication | Low | Centralize adoption of partially populated D3D11 resource arrays.** Depth scaling wraps all fourteen returned COM slots before checking the native result, rejects any missing resource and unwraps the result array. Depth replay repeats this with three slots at runtime/orchestrator/src/depth_replay.rs:301, fullscreen reinsertion spells out nine slots at runtime/orchestrator/src/fullscreen_pass.rs:195, and motion resolve lists six at runtime/orchestrator/src/motion_resolve.rs:112. Each create path owns even partial outputs on failure, but their native status conventions differ. Add a const-generic all-or-none adopt operation beside ComRef, with each caller still translating its own status, so a future slot addition cannot skip release or validation. [runtime/orchestrator/src/depth_scale.rs:319](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/depth_scale.rs#L319) + + + +### G05 · Sharpening and shader assets + +Port host wrappers, options and bindings for sharpening. Track shader provenance with each payload. + +**Coordinate shared edits** + +- Shader inputs, formats and compilation interfaces ([G04](#g04), [G06](#g06)). + +**Port files (19)** + +- [x] [runtime/backends/common/sharpening.h](runtime/backends/common/sharpening.h) +- [x] [runtime/graphics/src/sharpening/d3d11.cpp](runtime/graphics/src/sharpening/d3d11.cpp) +- [x] [runtime/graphics/src/sharpening/d3d11.h](runtime/graphics/src/sharpening/d3d11.h) +- [x] [runtime/graphics/src/sharpening/d3d12.cpp](runtime/graphics/src/sharpening/d3d12.cpp) +- [x] [runtime/graphics/src/sharpening/d3d12.h](runtime/graphics/src/sharpening/d3d12.h) +- [x] [runtime/graphics/src/sharpening/d3d12_platform.h](runtime/graphics/src/sharpening/d3d12_platform.h) +- [x] [runtime/graphics/src/sharpening/da_das.h](runtime/graphics/src/sharpening/da_das.h) (unchanged licensed shader payload) +- [x] [runtime/graphics/src/sharpening/da_das_spirv.h](runtime/graphics/src/sharpening/da_das_spirv.h) (unchanged licensed shader payload) +- [x] [runtime/graphics/src/sharpening/da_rcas.h](runtime/graphics/src/sharpening/da_rcas.h) (unchanged licensed shader payload) +- [x] [runtime/graphics/src/sharpening/da_rcas_spirv.h](runtime/graphics/src/sharpening/da_rcas_spirv.h) (unchanged licensed shader payload) +- [x] [runtime/graphics/src/sharpening/depth_color.inc](runtime/graphics/src/sharpening/depth_color.inc) (C++ raw string containing shared HLSL) +- [x] [runtime/graphics/src/sharpening/pass_payload.cpp](runtime/graphics/src/sharpening/pass_payload.cpp) (retained GPL shader access and constant packing; now GPL-3.0-only C11 `pass_payload.c`, byte-identical output to the C++ unit) +- [x] [runtime/graphics/src/sharpening/options.h](runtime/graphics/src/sharpening/options.h) (now a C11 header, GPL-3.0-only; the HLSL and SPIR-V payload headers use C literals and arrays) +- [x] [runtime/graphics/src/sharpening/rcas.h](runtime/graphics/src/sharpening/rcas.h) (unchanged licensed shader payload) +- [x] [runtime/graphics/src/sharpening/rcas_spirv.h](runtime/graphics/src/sharpening/rcas_spirv.h) (unchanged licensed shader payload) +- [x] [runtime/orchestrator/include/rescaleframe/sharpening_settings.h](runtime/orchestrator/include/rescaleframe/sharpening_settings.h) +- [x] [runtime/orchestrator/src/sharpening_pass_options.h](runtime/orchestrator/src/sharpening_pass_options.h) +- [x] [runtime/orchestrator/src/sharpening_vulkan.h](runtime/orchestrator/src/sharpening_vulkan.h) +- [x] [runtime/orchestrator/src/sharpening_vulkan_core.h](runtime/orchestrator/src/sharpening_vulkan_core.h) + +**Fixtures (7)** + +- [x] [tests/engine_sharpening.cpp](tests/engine_sharpening.cpp) +- [x] [tests/sharpening.cpp](tests/sharpening.cpp) +- [x] [tests/sharpening_d3d12.cpp](tests/sharpening_d3d12.cpp) +- [x] [tests/sharpening_settings_native.cpp](tests/sharpening_settings_native.cpp) (C11 SDK descriptor and CRT fixture probes) +- [x] [tests/sharpening_settings.cpp](tests/sharpening_settings.cpp) +- [x] [tests/sharpening_vulkan.cpp](tests/sharpening_vulkan.cpp) +- [x] [tests/sharpening_vulkan_cpu.cpp](tests/sharpening_vulkan_cpu.cpp) + +**Rust review findings (4)** + +- [x] **Simplicity | Low | Pass the admitted sharpening device and slot through recording.** record returns early unless initialize succeeds. Neither free_slot, prepare nor create_views can remove the device, yet the remaining path tests self.device four times and indexes the same slot separately in each helper. After choosing the index, borrow the device once and the slot mutably from the disjoint slots field. Let prepare and create_views take these references and use the same ones for refusal cleanup and recording. This adds explicit helper parameters while preserving the failed-bind latch, allocation order and slot retirement behavior. [runtime/orchestrator/src/vulkan_sharpening.rs:145](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sharpening.rs#L145) + +- [x] **Duplication | Low | Report optional Vulkan sharpening failure from one owner.** Shared sharpenvk_record already owns the once-only fallback diagnostic. FidelityFX SR at runtime/orchestrator/src/vulkan_sr.rs:745 and XeSS at runtime/orchestrator/src/vulkan_sr/xess.rs:597 keep separate flags, repeat the message and perform their own logging because native_sr_vulkan.cpp:399 and native_xess_vulkan.cpp:254 select the silent execute wrapper. DLSS and FSR4 already use the reporting run wrapper. Delegate once-per-owner logging to one facade path for all four providers, including failed allocation of its Rust owner, while preserving each caller's successful vendor output. [runtime/orchestrator/src/vulkan_sharpening.rs:372](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sharpening.rs#L372) + +- [x] **Duplication | Low | Keep sharpening activation policy out of the Vulkan owner's fake platform.** The off/vendor/zero-strength owner test at :372 passes through a fake that implements its own mode/strength predicate. The real callback at runtime/orchestrator/src/sharpening_vulkan.h:164 sanitizes first and then calls runtime/graphics/src/sharpening/options.h:37. For an active filter with NaN sharpness and MAS off, the fake returns inactive while native sanitization at options.h:26 restores 0.4 and dispatches. Make the owner fixture explicitly supply the callback's active/inactive result and test the option combinations against the actual native policy at its boundary. [runtime/orchestrator/src/vulkan_sharpening/tests.rs:204](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sharpening/tests.rs#L204) + +- [x] **Duplication | Low | Generate the Vulkan sharpening callback and pass records from their native header.** Rust manually mirrors the native facts, pass and 15-slot callback table in runtime/orchestrator/src/sharpening_vulkan_core.h:22, :30 and :37. Vulkan sharpening builds a pass at runtime/orchestrator/src/vulkan_sharpening.rs:260 and native code consumes it through the table populated at runtime/orchestrator/src/sharpening_vulkan.h:218. The Rust assertions at :104 check only selected field offsets and table size, so reordering equally sized fields or callbacks can compile on both sides. Add these private records to tools/generate-rust-bindings.py alongside the related Vulkan records at :279, blocklisting the shared resource and setup types. [runtime/orchestrator/src/vulkan_sharpening_abi.rs:40](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sharpening_abi.rs#L40) + + + +### G06 · Shader patching and compilation + +Port shader patch sessions, compiler interfaces and the cache with their CPU and device fixtures. + +**Coordinate shared edits** + +- Shader inputs, formats and compilation interfaces ([G04](#g04), [G05](#g05)). + +**Port files (5)** + +- [x] [runtime/graphics/include/rescaleframe/shader_compile.h](runtime/graphics/include/rescaleframe/shader_compile.h) +- [x] [runtime/shader_patch/include/rescaleframe/shader_patch.h](runtime/shader_patch/include/rescaleframe/shader_patch.h) +- [x] [runtime/shader_patch/src/export.cpp](runtime/shader_patch/src/export.cpp) +- [x] [runtime/shader_patch/src/platform.cpp](runtime/shader_patch/src/platform.cpp) +- [x] [runtime/shader_patch/src/platform.h](runtime/shader_patch/src/platform.h) + +**Fixtures (2)** + +- [x] [tests/shader_patch.cpp](tests/shader_patch.cpp) +- [x] [tests/shader_patch_device.cpp](tests/shader_patch_device.cpp) + +**Rust review findings (4)** + +- [x] **Altitude | Medium | Use one admitted root record for shader preparation and metadata queries.** Session open stores Option while prepare_variant independently walks raw JSON. The session fixture explicitly asserts open succeeds, root_count includes both roots, root returns FORMAT for the missing patched hash, yet prepare succeeds for that same root. Clients cannot enumerate the set they can prepare. Validate roots once before claiming them, or represent genuinely optional metadata in a queryable root record, and make enumeration and compilation use that same record. [runtime/orchestrator/src/shader_patch.rs:308](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/shader_patch.rs#L308) + +- [x] **Altitude | Medium | Report incomplete shader inventory dumps to the requesting adapter.** Once the directory exists, dump ignores each DXBC write, disassembly result and assembly file write and returns OK. Anomaly's motion_stage.cpp:351 forwards that result, so a full disk or disassembler refusal looks like a complete inventory. Continue collecting independent entries but return a partial/failure result and identify unsuccessful shader hashes in the dump report. [runtime/orchestrator/src/shader_patch/d3d11.rs:217](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/shader_patch/d3d11.rs#L217) + +- [x] **Quality | Low | Failed hook enable frees trampolines of hooks that are already live** attach() enables the six CreateXShader hooks in order (lines 101-105). If hook_enable fails for hook i, the rollback at lines 106-111 calls hook_remove on every created target. hook_remove in platform.cpp:229-233 does MH_DisableHook and then MH_RemoveHook, which frees the trampoline. Hooks 0..i-1 were already enabled, so an engine thread that entered create:: (line 42) can still load ORIGINALS[I] (line 62) and call the freed trampoline. ID3D11Device shader creation is free-threaded, so concurrent creation during loading can reach this. reflex_audit.rs:75-80 handles the same case by disabling and keeping the trampolines. This is a race inference: the code path is confirmed, but the crash depends on timing. No test covers a partial enable failure. [runtime/orchestrator/src/shader_patch/d3d11.rs:106](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/shader_patch/d3d11.rs#L106) + +- [x] **Duplication | Low | Test shader-pack admission without maintaining a second JSON parser.** Pack::load calls the platform parser through runtime/orchestrator/src/shader_patch/pack.rs:177; production uses yyjson_read at runtime/shader_patch/src/platform.cpp:71. The Rust test Reader and fake_parse instead implement a different JSON grammar: a Unicode escape is parsed into one u8 and unrecognized backslash escapes are accepted as their literal byte. The malformed-JSON assertion at shader_patch/tests.rs:477 consequently exercises a different parser. Test Rust-specific builder rules with explicit visitor events, and run syntax/Unicode fixtures through the existing native parser contract, retaining fake compiler and reflection leaves. [runtime/orchestrator/src/shader_patch/tests.rs:38](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/shader_patch/tests.rs#L38) + + + +### G07 · Texture and frame capture + +Port input dumps, texture readback, capture metadata and completion; account for partial allocation and retirement. + +**Coordinate shared edits** + +- Capture publication after a submitted command or queue is retired ([V02](#v02), [V04](#v04), [V05](#v05), [V06](#v06)). + +**Port files (12)** + +- [x] [runtime/backends/common/frame_capture12.h](runtime/backends/common/frame_capture12.h) +- [x] [runtime/backends/common/frame_capture_vk.h](runtime/backends/common/frame_capture_vk.h) +- [x] [runtime/graphics/include/rescaleframe/texture_dump.h](runtime/graphics/include/rescaleframe/texture_dump.h) +- [x] [runtime/graphics/src/texture_dump.cpp](runtime/graphics/src/texture_dump.cpp) +- [x] [runtime/graphics/src/texture_dump_platform.h](runtime/graphics/src/texture_dump_platform.h) +- [x] [runtime/orchestrator/include/rescaleframe/input_dump.h](runtime/orchestrator/include/rescaleframe/input_dump.h) +- [x] [runtime/orchestrator/include/rescaleframe/input_dump_d3d12.h](runtime/orchestrator/include/rescaleframe/input_dump_d3d12.h) +- [x] [runtime/orchestrator/include/rescaleframe/input_dump_vulkan.h](runtime/orchestrator/include/rescaleframe/input_dump_vulkan.h) +- [x] [runtime/orchestrator/include/rescaleframe/named_frame_dump.h](runtime/orchestrator/include/rescaleframe/named_frame_dump.h) +- [x] [runtime/orchestrator/src/input_dump.cpp](runtime/orchestrator/src/input_dump.cpp) +- [x] [runtime/orchestrator/src/input_dump_platform.h](runtime/orchestrator/src/input_dump_platform.h) +- [x] [runtime/orchestrator/src/input_dump_vulkan.cpp](runtime/orchestrator/src/input_dump_vulkan.cpp) + +**Fixtures (6)** + +- [x] [tests/capture_metadata.cpp](tests/capture_metadata.cpp) +- [x] [tests/input_dump.cpp](tests/input_dump.cpp) +- [x] [tests/input_dump_d3d12.cpp](tests/input_dump_d3d12.cpp) +- [x] [tests/input_dump_vulkan.cpp](tests/input_dump_vulkan.cpp) +- [x] [tests/input_dump_vulkan_cpu.cpp](tests/input_dump_vulkan_cpu.cpp) +- [x] [tests/texture_dump.cpp](tests/texture_dump.cpp) + +**Rust review findings (13)** + +- [x] **Altitude | Medium | Preserve capture view and resource generation in legacy filenames.** The D3D12 exporter matches submissions with session, frame, view and resource generation, but writes raw/JSON files using only session, frame, role and ordinal. Its event file also omits view and generation. Vulkan's legacy writer at frame_capture_vk.rs:673 fixes the ordinal at zero and omits the same identity. Two captures of the same role for different views of one source overwrite each other even though their metadata describes different inputs. Have the capture owner derive artifact names from the complete identity and distinguish repeated evaluations when necessary. [runtime/orchestrator/src/frame_capture12.rs:348](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_capture12.rs#L348) + +- [x] **Duplication | Medium | Serialize shared legacy capture metadata once for D3D12 and Vulkan.** D3D12 readback publication and Vulkan publish_legacy call separate legacy_json writers (runtime/orchestrator/src/frame_capture_vk.rs:609). Both interpolate the unescaped role into JSON, emit the same identity, extents and jitter, and manually maintain the same five row-vector matrix names and encodings. A role containing a quote makes both sidecars invalid. Share the frame/camera writer and JSON string escaping, with separate layout, reset, provider and completion fields so existing backend-specific evidence is retained. [runtime/orchestrator/src/frame_capture12.rs:502](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_capture12.rs#L502) + +- [x] **Altitude | Medium | Apply the same execution proof to the Vulkan legacy file and the core ticket.** For a shared-completion readback with both outputs enabled, full flush can reject the core ticket because gpu_ready has no execution proof, then map the very same allocation and write it as a legacy capture. A drain can retire an abandoned command buffer without executing its image copy. The default capture in native_sr_fsr4_vulkan.cpp uses this shared path. Make completion an attribute of the readback, require it for either publication and retain drain-only proof solely for freeing the allocation. [runtime/orchestrator/src/frame_capture_vk.rs:518](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_capture_vk.rs#L518) + +- [x] **Duplication | Medium | Use one Rust pixel descriptor for capture publication and input-dump ingestion.** The input-dump ABI reads a hand-written seven-field Pixels record (runtime/orchestrator/src/input_dump/abi.rs:192). Vulkan publishes a separate manual definition of the same rsf_dump_pixels at runtime/orchestrator/src/frame_capture_vk.rs:38 and :523; D3D12 imports that producer type and reaches the reader through rsf_input_dump_pixels at runtime/backends/common/frame_capture12.h:130. The intervening C boundary lets the two Rust definitions drift independently on format, byte count or pointer offsets. Generate or declare the descriptor once from the public texture-dump header and import it in producers and consumers. [runtime/orchestrator/src/input_dump.rs:73](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/input_dump.rs#L73) + +- [x] **Altitude | Medium | Derive capture completeness from the operations the selected frame actually performed.** The record-based path requires only final_color and a written frame record. input_dump/abi.rs:78 initializes sr_result to success before any SDK result arrives, and roles with no reservation do not count as failures. A frame using SR can consequently get a complete manifest with no scene color, motion, depth or evaluation result. Derive required evidence from the selected path, keep unobserved SDK results explicit, and preserve final-only completion for a frame explicitly identified as native. [runtime/orchestrator/src/input_dump.rs:478](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/input_dump.rs#L478) + +- [x] **Altitude | Medium | Certify GPU completion for the recordings a submission actually contains.** gpu_submission encodes the capture ticket and the current count of all image reservations. gpu_completed advances one count per API/device, and gpu_ready treats every earlier index as executed. input_dump_vulkan.rs:142 publishes that count when one snapshot queue retires. An earlier reservation on another command buffer or queue of the same device is thereby eligible for mapping even if its copy never ran. Attach reservation IDs to the submitted command batch and advance only those receipts on completion. [runtime/orchestrator/src/input_dump/abi.rs:272](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/input_dump/abi.rs#L272) + +- [x] **Duplication | Medium | Use the same camera availability check when writing and updating capture metadata.** The first frame.json written by rsf_core_dump_begin_record at runtime/orchestrator/src/input_dump/abi.rs:80 calls the camera available whenever its struct_size is large enough. Capture::fill_sr_metadata at runtime/orchestrator/src/input_dump.rs:400 also checks RSF_GAME_CAMERA_ABI_VERSION before trusting the same embedded record. A full-size camera from another ABI is consequently labelled available in the file while the owner considers it replaceable. Reuse the size-and-version predicate for both the flag and enrichment decision, leaving the dimension match as a separate enrichment requirement. [runtime/orchestrator/src/input_dump/metadata.rs:352](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/input_dump/metadata.rs#L352) + +- [x] **Altitude | Medium | Use the same source-provenance rule in every capture artifact.** manifest and frame.json emit null for source_frame_id when RSF_FRAME_FLAG_AMBIGUOUS_ID is set. The same capture's stage-result and SR-parameter writers instead emit record.frame_id as a known source, although matches_pass expressly permits that value to be a native frame counter without a known source. Centralize identity serialization and keep the native frame ID separately so tools cannot join a status file to an input frame on fabricated evidence. [runtime/orchestrator/src/input_dump/metadata.rs:425](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/input_dump/metadata.rs#L425) + +- [x] **Altitude | Medium | Distinguish device loss from a pending Vulkan capture fence.** Owner::join recognizes DEVICE_LOST and discards the snapshot but converts the state to FenceOnly and returns NOT_READY, just as for a timeout. The only destroy path calls join again, so a permanently lost device prevents release of the command pool, fence and native capture owner. Return a terminal device-lost outcome and provide teardown after loss is established, while preserving retry for genuinely pending work. [runtime/orchestrator/src/input_dump_vulkan.rs:131](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/input_dump_vulkan.rs#L131) + +- [x] **Boundaries | Medium | Derive the velocity preview from adapter-supplied motion encoding, not an Unreal constant.** The Runtime texture dump hard-codes Unreal's encoded-velocity convention: VELOCITY_SCALE = 0.499*0.5 and VELOCITY_BIAS = 32767/65535 (sample.rs:12-13) with "x != 0 means written" for view 1 (sample.rs:180-184). The public header names it "Treat the texture as Unreal velocity" (runtime/graphics/include/rescaleframe/texture_dump.h:46-48). The Runtime dlss_pipeline.rs:1345-1349 and :1520-1525 then label any game motion with zero_means_unwritten as VIEW_VELOCITY, and the AC7 C carrier requests it directly (loader/proxy/src/dinput8_proxy.c:762). AGENTS.md Rule 1 keeps engine conventions out of runtime/orchestrator; the adapter already supplies motion encoding facts (scale/bias/sentinel) to the motion decode owner, so previews of a non-Unreal encoded motion buffer are decoded with the wrong constants. Pass the adapter's decode parameters into the dump request (or dump only the already-decoded motion) and retire the engine-named view. [runtime/orchestrator/src/texture_dump/sample.rs:12](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/texture_dump/sample.rs#L12) + +- [x] **Duplication | Low | Share D3D12 readback allocation and copy leaves between frame capture and FG color pairs.** FrameCapture12 and runtime/orchestrator/src/fg12/colors.rs:25 both request a COPY_DEST buffer and the same six-field footprint, then record a subresource-zero copy and map/unmap it. Runtime/backends/common/frame_capture12.h:64 and runtime/orchestrator/src/fg12_platform.cpp:94 independently allocate and fill that footprint, transition and restore the source, and map the identical byte range. The common capture leaf checks single-slice textures while the FG pair has its own format and matching-extent rules. Use one footprint type and shared readback leaves, retaining each caller's admission, fence ownership and file format. [runtime/orchestrator/src/frame_capture12.rs:44](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_capture12.rs#L44) + +- [x] **Duplication | Low | Share the capture-ticket test sink between Vulkan and D3D12.** The Vulkan reserve/failed/pixels callbacks and runtime/orchestrator/src/frame_capture12/tests.rs:145 simulate the same input-dump ticket API with independent ticket counters and tuple logs. Vulkan's pixels callback ignores the supplied native format and its reserve callback ignores the description, while D3D12 preserves or validates those fields. Both suites exercise publication and failure on owner destruction (Vulkan :463 and D3D12 :657). Extract a test sink recording the full common callback payload so both can assert it, while keeping the Vulkan event model and D3D12 COM/fence fixtures separate. [runtime/orchestrator/src/frame_capture_vk/tests.rs:118](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/frame_capture_vk/tests.rs#L118) + +- [x] **Duplication | Low | Share Vulkan capture command-pool and fence operations.** The public snapshot owner and the DLSS real-Present capture owner at runtime/orchestrator/src/dlss_vulkan_capture.rs:81 each declare the same ten Vulkan pool, command-buffer and fence operations. Their native implementations separately resolve the same functions and populate the same Vulkan create structures at runtime/orchestrator/src/input_dump_vulkan.cpp:53 and runtime/orchestrator/src/native_fg_dlss_vulkan_capture.cpp:106. The snapshot owner allocates one queue family at open, while DLSS creates a slot lazily per observed family and preserves WSI waits. Factor the common command/fence leaves and slot allocation/reset/release into a reusable component; leave submission, completion evidence and wait consumption with each owner. [runtime/orchestrator/src/input_dump_vulkan.rs:27](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/input_dump_vulkan.rs#L27) + + + +### D01 · D3D11 rendering host + +Port host setup, output admission and reduced-frame handling through the shared D3D11 host. + +**Coordinate shared edits** + +- Shared device, chain and SR handoff ([D02](#d02), [D03](#d03)). + +**Port files (5)** + +- [x] [runtime/orchestrator/include/rescaleframe/d3d11_host.h](runtime/orchestrator/include/rescaleframe/d3d11_host.h) +- [x] [runtime/orchestrator/src/d3d11_host.cpp](runtime/orchestrator/src/d3d11_host.cpp) +- [x] [runtime/orchestrator/src/d3d11_host_platform.h](runtime/orchestrator/src/d3d11_host_platform.h) +- [x] [runtime/orchestrator/src/d3d11_output_platform.cpp](runtime/orchestrator/src/d3d11_output_platform.cpp) +- [x] [runtime/orchestrator/src/d3d11_output_platform.h](runtime/orchestrator/src/d3d11_output_platform.h) + +**Fixtures (3)** + +- [x] [tests/d3d11_host.cpp](tests/d3d11_host.cpp) +- [x] [tests/d3d11_host_rendered_fg_device.c](tests/d3d11_host_rendered_fg_device.c) (C++ removed; C11 launcher with the outer-chain COM wrapper as a hand-written vtable, phases and verdicts stay in Rust; shared helpers in `tests/d3d11_host_device_launch.h`) +- [x] [tests/d3d11_host_shared_sr_device.c](tests/d3d11_host_shared_sr_device.c) (C++ removed; C11 launcher, phases and verdicts stay in Rust) + +**Rust review findings (8)** + +- [x] **Altitude | Medium | Carry depth inversion and the far-plane convention as independent D3D11 facts.** install_bridge copies setup.depth_inverted into both depth_inverted and depth_infinite. The public host setup can therefore express neither reversed finite depth nor forward infinite depth, even though the presenter forwards both flags independently and FSR generation uses them for separate create flags. Append a size/version-checked far-plane convention supplied by the adapter; retain the legacy interpretation only for old callers and cover all four combinations. [runtime/orchestrator/src/d3d11_host.rs:584](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_host.rs#L584) + +- [x] **Altitude | Medium | Report the inputs observed on the actual D3D11 SR pass.** The host sets color, depth, motion and jitter availability on every report, including configure-only requests. Skyrim resolution.rs constructs those requests with output dimensions and a swapchain but no input textures or valid camera. overlay_service.rs:834 turns the bitmask into availability indicators, so a preparation request can claim all inputs were supplied. Leave the input receipt untouched on preparation or derive its bits from the qualified evaluation's resource and camera checks. [runtime/orchestrator/src/d3d11_host.rs:1234](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_host.rs#L1234) + +- [x] **Duplication | Medium | Decode versioned CPU source packets once for dispatch and diagnostics.** runtime/orchestrator/src/d3d11_host.rs:64 and runtime/orchestrator/src/native_cpu.rs:22 independently define the original source packet as the base event plus 24 bytes. The dispatcher at native_cpu.rs:180 rejects intermediate sizes between that prefix and the full record, while the D3D11 diagnostic reader at d3d11_host.rs:1901 treats every such size as the legacy prefix and decodes generation and abort reason after dispatch. A future extension can change which fields the two paths consider valid. Share a bounded decoder using the actual field offset, with distinct legacy/full/malformed results, and let diagnostics report the raw header and rejection without interpreting malformed payloads. [runtime/orchestrator/src/d3d11_host.rs:1901](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_host.rs#L1901) + +- [x] **Altitude | Medium | Check the pass session at the common D3D11 SR admission boundary.** host_process validates role, size, swapchain and camera but forwards an ordinary pass to Host::process without comparing its session_id to the host. Other render-pass and auxiliary entry points at lines 2143 and 2642 perform that check. A mismatched pass targeting the bound chain can drive the host's context and label captures with a foreign session. Check session identity before any graphics initialization, evaluation or capture in the shared process path. [runtime/orchestrator/src/d3d11_host.rs:2213](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_host.rs#L2213) + +- [x] **Duplication | Medium | Use the generated swapchain dispatch request on both sides of the Steam facade.** integrations/steam/src/chain_abi.rs:18 describes the public 72-byte dispatch record with typed argument and result unions. integrations/steam/src/lib.rs:167 builds it and :178 forwards it to runtime/orchestrator/src/d3d11_host.rs:2370. The runtime redeclares the record at d3d11_host_abi.rs:99 with a signed result and a raw five-word argument union; the Present adapter at d3d11_host.rs:2425 constructs that mirror. A new largest method argument or result interpretation currently requires updating the raw representation separately. Move the generated request and method constants to shared D3D11 host bindings, and use the named Present and Release variants at each end. [runtime/orchestrator/src/d3d11_host_abi.rs:99](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_host_abi.rs#L99) + +- [x] **Duplication | Medium | Compare reserved auxiliary surface identity with one predicate.** Ticket::temporal_surfaces at runtime/orchestrator/src/d3d11_host_reduced.rs:236 compares minimum size, texture, kind, flags and output rectangle. Host::process checks it at d3d11_host.rs:972, then calls temporal_prepare at :1100, whose SurfacePlan::accepts at auxiliary_sr.rs:155 repeats the same identity fields before checking source bounds and jitter. The earlier check distinguishes an unrelated request from a failed preparation, so keep both admission points. Share a typed immutable surface key or matcher and retain the stricter mapping checks in the products owner to avoid future identity fields being enforced on only one route. [runtime/orchestrator/src/d3d11_host_reduced.rs:236](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_host_reduced.rs#L236) + +- [x] **Simplicity | Low | D3D11 host advanced options are a positional index protocol mirrored in four places** The five overlay options exist only as positions: initialize builds the `advanced` toggle array in order capture-next, transport, correction, capture-failures, capture-sequence (d3d11_host.rs:735-750); host_options rebuilds the current values in the same order with literal zeros at 0 and 4 (:2190-2196); action() decodes index 0|4, 3 and 1|2 with nested ifs choosing the flag and INI key (:1932-1971); and rsf_core_d3d11_host_capture_control maps its operation back to the magic indices 4 and 3 (:2344-2348). Adding, removing or reordering one option means editing all four in lockstep with nothing tying them together. Simpler: one `enum Advanced { CaptureNext, Transport, Correction, CaptureFailures, CaptureSequence }` plus a const table of (label, kind: OneShot(&AtomicBool) | Persisted(&AtomicBool, ini key, bumps_generation)), from which the toggle array, the current values and action() are all derived, and capture_control names the variant. Tradeoff: a small table type; the overlay ABI still receives the same ordered option array. [runtime/orchestrator/src/d3d11_host.rs:1932](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_host.rs#L1932) + +- [x] **Boundaries | Low | Call the auxiliary SR owner directly instead of through its own C exports.** d3d11_host_reduced.rs declares rsf_auxiliary_sr_create/reserve/seal/commit/restore and the rest as unsafe extern "C" imports and wraps the returned opaque pointer in Auxiliary, but those symbols are #[no_mangle] functions of the same crate (runtime/orchestrator/src/auxiliary_sr.rs:886-1002) operating on the Rust AuxiliarySr type. The D3D11 host therefore crosses an unchecked C ABI to reach a sibling Rust module: the handle loses its type, every call re-validates raw pointers and slices, the slice lengths are narrowed to u32, and a signature drift between the two declarations is not caught by the compiler. This is an avoidable unsafe FFI boundary inside one Rust owner. Make AuxiliarySr pub(crate), implement Products for it (or hold Box) and call its methods directly; keep the C exports only for the remaining native callers, if any. [runtime/orchestrator/src/d3d11_host_reduced.rs:55](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_host_reduced.rs#L55) + + + +### D02 · D3D11 presentation and shared surfaces + +Port swapchain dispatch, presentation synchronization and shared surface ownership with their consumer fixtures. + +**Coordinate shared edits** + +- Shared device, chain and SR handoff ([D01](#d01), [D03](#d03)). +- OpenGL shared surfaces, device ownership and linked Minecraft callers ([D08](#d08), [M01](#m01)). + +**Port files (8)** + +- [x] [runtime/orchestrator/include/rescaleframe/d3d11_present_api.h](runtime/orchestrator/include/rescaleframe/d3d11_present_api.h) +- [x] [runtime/orchestrator/src/d3d11_present_api.cpp](runtime/orchestrator/src/d3d11_present_api.cpp) +- [x] [runtime/presentation/include/rescaleframe/d3d11_chain_dispatch.h](runtime/presentation/include/rescaleframe/d3d11_chain_dispatch.h) +- [x] [runtime/presentation/include/rescaleframe/d3d11_present_bridge.h](runtime/presentation/include/rescaleframe/d3d11_present_bridge.h) +- [x] [runtime/presentation/include/rescaleframe/shared_surface.h](runtime/presentation/include/rescaleframe/shared_surface.h) +- [x] [runtime/presentation/src/d3d11_present_bridge.c](runtime/presentation/src/d3d11_present_bridge.c) (C++ removed; C11 leaf with the layout `_Static_assert`s, the MinHook and CreateDXGIFactory1 calls, the guarded factory trampolines and the SDK callback table) +- [x] [runtime/presentation/src/d3d11_present_platform.h](runtime/presentation/src/d3d11_present_platform.h) +- [x] [runtime/presentation/src/shared_surface.cpp](runtime/presentation/src/shared_surface.cpp) + +**Fixtures (4)** + +- [x] [tests/d3d11_present_api.cpp](tests/d3d11_present_api.cpp) +- [x] [tests/d3d11_present_bridge.c](tests/d3d11_present_bridge.c) (C++ removed; C11 launcher keeping the AC7 native command list layout, the command execution guard and the D3D11 draw calls, phases and verdicts stay in Rust) +- [x] [tests/fg_present_bridge.cpp](tests/fg_present_bridge.cpp) +- [x] [tests/shared_surface.cpp](tests/shared_surface.cpp) + +**Rust review findings (4)** + +- [x] **Duplication | Medium | Reject nonfinite view-space scales consistently at presentation setup.** runtime/orchestrator/src/d3d11_host.rs:357 and sr_legacy.rs:118 require a finite positive units_to_meters value. The presentation entry at d3d11_present.rs:210 reimplements the rule as a NaN check and a lower bound, which admits positive infinity. generation_setup then forwards infinity to the provider at :771. The refusal vectors at d3d11_present_tests.rs:1403 omit infinity. Share a finite-positive unit-scale predicate for these ingress points and exercise positive infinity in the public presentation setup fixture. [runtime/orchestrator/src/d3d11_present.rs:210](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_present.rs#L210) + +- [x] **Altitude | Medium | Preserve pending physical-chain creation across a host-load refusal.** ensure_physical consumes physical_pending before attempting host_generation_load. If that operation refuses, the method returns E_FAIL without publishing a chain, selecting fallback or restoring the pending flag. Subsequent Present and buffer calls immediately report WAS_STILL_DRAWING even after the host is ready. Keep a distinct creating state and return to pending on retryable refusal, or publish a terminal fault/fallback that callers can act on. [runtime/orchestrator/src/d3d11_present.rs:960](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_present.rs#L960) + +- [x] **Duplication | Medium | Read one provider status snapshot when publishing a presentation owner.** Owner::initialize at runtime/orchestrator/src/d3d11_present.rs:1322 queries status through paced_by_host, then :1332 queries it again for publication and :1334 queries a third time when logging is enabled. Lazy creation at :992 and switching at :1493 repeat the pacing/publication pair. Each reaches the same provider.status callback declared at :717 and substituted by d3d11_present_tests.rs:260. If the cached provider status changes between reads, published pacing ownership and reported status can describe different observations. Take one snapshot per publication transition and derive HOST_PACED, the public snapshot and optional log from it, preserving later per-frame refreshes. [runtime/orchestrator/src/d3d11_present.rs:1322](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_present.rs#L1322) + +- [x] **Altitude | Medium | Keep a retryable physical Present result distinct from device loss.** The facade forwards Present flags to the physical chain, then permanently sets faulted for every failing HRESULT on both native D3D12 and D3D11 paths. A nonblocking Present can return DXGI_ERROR_WAS_STILL_DRAWING while the device is healthy; the next application Present then receives DEVICE_REMOVED without retrying. Track whether submitted work is safely fenced separately from whether DXGI displayed the frame, and preserve retryable Present outcomes when the fence is known. [runtime/orchestrator/src/d3d11_present.rs:1828](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d11_present.rs#L1828) + + + +### D03 · SR sessions and bridging + +Port generic SR setup, legacy bridging and auxiliary reconstruction. Trace the public SR API into each backend. + +**Coordinate shared edits** + +- Shared device, chain and SR handoff ([D01](#d01), [D02](#d02)). +- Provider setup, feature guards and teardown across the Runtime and backends ([D04](#d04), [D05](#d05), [D06](#d06), [D07](#d07)). + +**Port files (15)** + +- [x] [runtime/backends/common/sr_helpers.h](runtime/backends/common/sr_helpers.h) +- [x] [runtime/orchestrator/include/rescaleframe/d3d11_sr_api.h](runtime/orchestrator/include/rescaleframe/d3d11_sr_api.h) +- [x] [runtime/orchestrator/include/rescaleframe/native_sr.h](runtime/orchestrator/include/rescaleframe/native_sr.h) +- [x] [runtime/orchestrator/include/rescaleframe/sr_bridge.h](runtime/orchestrator/include/rescaleframe/sr_bridge.h) +- [x] [runtime/orchestrator/include/rescaleframe/sr_session.h](runtime/orchestrator/include/rescaleframe/sr_session.h) +- [x] [runtime/orchestrator/src/auxiliary_sr.cpp](runtime/orchestrator/src/auxiliary_sr.cpp) +- [x] [runtime/orchestrator/src/auxiliary_sr.h](runtime/orchestrator/src/auxiliary_sr.h) +- [x] [runtime/orchestrator/src/auxiliary_sr_platform.h](runtime/orchestrator/src/auxiliary_sr_platform.h) +- [x] [runtime/orchestrator/src/d3d11_sr_api.cpp](runtime/orchestrator/src/d3d11_sr_api.cpp) +- [x] [runtime/orchestrator/src/native_sr.cpp](runtime/orchestrator/src/native_sr.cpp) Deleted. Every guarded callee is a Rust export, so `native_sr.rs` calls them directly and exports `rsf_native_sr_evaluate` itself. +- [x] [runtime/orchestrator/src/native_sr_completion.h](runtime/orchestrator/src/native_sr_completion.h) Deleted with `native_sr.cpp`. The D3D11 host takes the Rust ordered entry. +- [x] [runtime/orchestrator/src/sr_bridge_platform.cpp](runtime/orchestrator/src/sr_bridge_platform.cpp) +- [x] [runtime/orchestrator/src/sr_legacy_adapter.cpp](runtime/orchestrator/src/sr_legacy_adapter.cpp) +- [x] [runtime/orchestrator/src/sr_legacy_adapter.h](runtime/orchestrator/src/sr_legacy_adapter.h) +- [x] [runtime/orchestrator/src/sr_session_backends.cpp](runtime/orchestrator/src/sr_session_backends.cpp) + +**Fixtures (4)** + +- [x] [tests/auxiliary_sr.cpp](tests/auxiliary_sr.cpp) +- [x] [tests/sr_backend_switch_device.cpp](tests/sr_backend_switch_device.cpp) +- [x] [tests/sr_bridge.cpp](tests/sr_bridge.cpp) +- [x] [tests/sr_session.cpp](tests/sr_session.cpp) + +**Rust review findings (11)** + +- [x] **Duplication | Medium | Reuse the saved D3D11 state guard for auxiliary passes.** runtime/orchestrator/src/auxiliary_sr.rs:213 stores the context, opaque saved state and restore-on-drop flag for auxiliary render, commit and rollback. runtime/orchestrator/src/d3d11_output.rs:66 already owns that save/restore pair for colour and reinsertion calls, for example colour_d3d11.rs:113. The auxiliary route adds clear/copy operations and restores early before releasing frame references at auxiliary_sr.rs:855. Its generated state type is a separate Rust declaration of the same 8192-byte C record. Import one state binding, construct the shared guard only after save succeeds, and drop it explicitly at the existing early-restore point. Keep auxiliary clear/copy operations on the caller. [runtime/orchestrator/src/auxiliary_sr.rs:213](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/auxiliary_sr.rs#L213) + +- [x] **Duplication | Medium | Reuse one fake IUnknown header for orchestrator ownership tests.** runtime/orchestrator/src/com_ref.rs:64 already has a test vtable and reference-counted Fake. auxiliary_sr.rs:1010, callback_host/tests.rs:14, sr_bridge/tests.rs:12 and sr12/tests.rs:11 separately implement the same vtable prefix and AddRef/Release counter for production COM calls. The fixtures differ usefully in their payloads (width, device, resource descriptor or release-event log), but only some explicitly guard over-release or provide a callable E_NOINTERFACE stub. Move the common repr(C) header, refcount and default QueryInterface into com_ref::test, embed it first in the specialized fixtures, and keep their descriptive payloads and optional last-release instrumentation. [runtime/orchestrator/src/auxiliary_sr.rs:1010](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/auxiliary_sr.rs#L1010) + +- [x] **Duplication | Medium | Decode region-preparation failures once for SR and explicit FG.** The native prepare_regions leaf at runtime/orchestrator/src/native_sr.cpp:62 returns 1 after publishing all three textures, 0 on refusal, and leaf_fault on a caught exception. The SR path at runtime/orchestrator/src/native_sr.rs:176 explicitly stops on the exception code; capture_on_stream repeats the call but checks only for zero, so that same exception reaches fg.decode with the still-null vectors output. Wrap the callback in one result decoder returning the three textures only on success. Each caller can then map refusal and fault into its own status and history policy. [runtime/orchestrator/src/native_sr.rs:337](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_sr.rs#L337) + +- [x] **Altitude | Medium | Invalidate the FG history when its own input validation faults.** capture_validated handles a device or depth-layout leaf fault by calling discard_history(NOT_READY). That helper always resets the SR history, even though this path prepares only FG inputs and native_sr_state.rs maintains independent histories. A capture fault can therefore reset a healthy SR frame and leave the old FG history eligible if the source retries. Give the failure handler the affected history owner and cover both slots in the test. [runtime/orchestrator/src/native_sr.rs:447](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/native_sr.rs#L447) + +- [x] **Altitude | Medium | Expose the SR bridge's retained-on-timeout destruction result.** The public destroy function returns void both when it consumes the bridge and when wait or warm-up retirement times out and the entire SDK/device/texture owner remains live. The caller cannot know whether retrying will release outstanding work or touch an already freed handle, so the implementation abandons recoverable failures until process exit. Provide a checked close that consumes the handle only on successful retirement and returns a retryable status otherwise. [runtime/orchestrator/src/sr_bridge.rs:1003](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/sr_bridge.rs#L1003) + +- [x] **Altitude | Medium | Preserve the supplied far-plane convention independently of depth direction.** The legacy adapter copies the caller's rsf_sr_open_desc and then overwrites depth_infinite with inverted_depth. Its evaluate path forwards the frame's actual far_plane independently. A reversed-Z projection with a finite far plane, or a standard-Z infinite projection, is therefore opened under a mismatching vendor convention. Carry both producer facts through create, using the existing open.depth_infinite field or an explicit legacy argument. [runtime/orchestrator/src/sr_legacy.rs:132](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/sr_legacy.rs#L132) + +- [x] **Duplication | Low | Share the destructor-backed owner for opaque graphics handles.** The D3D11-to-D3D12 SR bridge's Owned and runtime/orchestrator/src/gl_pipeline.rs:158 have identical NonNull storage, destructor callback, null-to-Option constructor, accessor and Drop. Native FG normalization uses the same representation for MotionPass at runtime/orchestrator/src/native_sr.rs:258. The callers wrap shared fences and surfaces, GL/SR sessions and textures, or decode/resolve passes respectively, each with its own destructor. Move that exact non-COM owner to a common module and keep each higher-level owner's drop order and GPU completion rules at the caller. [runtime/orchestrator/src/sr_bridge.rs:112](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/sr_bridge.rs#L112) + +- [x] **Simplicity | Low | sr_bridge keeps one prepared shape as three parallel Options and re-checks them after prepare** Bridge holds surfaces: Option, output: Option and shape: Option (sr_bridge.rs:200-203). They are only ever cleared together (release_surfaces, :422-426) and set together at the end of a successful prepare (:480-482). evaluate() still has to re-destructure them after prepare returned OK, with an unreachable (Some(surfaces), Some(output)) else INIT_FAILED branch (:624-626). Simpler: one prepared: Option; prepare compares prepared.as_ref().map(|p| p.shape) with the new shape and returns Result<&Prepared, i32>, so evaluate gets the surfaces and output directly with no second Option check, and release_surfaces becomes prepared = None. Tradeoff: none in behavior; drop order is unchanged because the three fields sit next to each other between session and fence today, so the combined field takes their place. [runtime/orchestrator/src/sr_bridge.rs:200](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/sr_bridge.rs#L200) + +- [x] **Simplicity | Low | Key prepared bridge textures by the dimensions used to allocate them.** evaluate collects five texture descriptions so Shape can copy the color and motion formats, although input_accepted already requires COLOR_FORMAT and MOTION_FORMAT. prepare also allocates output-sized textures but the key contains only render dimensions and those two fixed formats. Validate descriptions in place, use the constants when allocating, and key the set by render and output dimensions. Steady-size frames keep reusing their allocations, while a new output size with unchanged render dimensions requires one fence wait and reallocation. [runtime/orchestrator/src/sr_bridge.rs:589](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/sr_bridge.rs#L589) + +- [x] **Simplicity | Low | Orchestrator re-declares the struct_size prefix check in eleven modules beside the crate-visible has_capacity** sr_session.rs:54 exports pub(crate) has_capacity (non-null and leading u32 >= size_of::()), and dlss_streamline.rs:11 already imports it. The same body is re-declared privately at dlss_pipeline.rs:437, fg12.rs:90 (full_prefix, plus checked at :94 returning Option<&T>), fg_dispatch.rs:20 (full_prefix), fg_session.rs:106, fg_scene.rs:89 (full_pass, Pass only), frame_assembly.rs:5, native_cpu.rs:132, native_fg_cpu.rs:1438 (compares as u32), native_scene.rs:25 (full_prefix) sr12.rs:1281 (full_pass returning Option<&Pass>) and input_dump.rs:747 (pub(super) checked returning Option<&T>). Simpler: keep one crate helper pair, has_capacity and a checked -> Option<&T> built on it, and import both, so there is one definition of the prefix contract instead of eleven. Tradeoff: an extra crate import per module. native_fg_cpu compares in u32 rather than usize, which gives the same answer for any real struct size. Inference: other modules read struct_size inline (grep shows 67 cast::().read() sites in 41 files). Only the eleven named helper copies were checked to be identical. [runtime/orchestrator/src/sr_session.rs:54](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/sr_session.rs#L54) + +- [x] **Duplication | Low | Announce the selected FSR provider once per successful SR switch.** The D3D12 FSR owner logs its version name at runtime/orchestrator/src/d3d12_sr/fsr.rs:84 during provider open. Session::replace forwards the same logger to open, obtains that version from the provider, and writes its name again after planning and committing. The sr12 session selection at runtime/orchestrator/src/sr12.rs:494 therefore emits the same line twice on a successful switch, and the first copy can appear even when planning subsequently refuses it. Emit the active-version announcement at commit, preserving the provider's diagnostics for unavailable candidates and any direct-open reporting contract. [runtime/orchestrator/src/sr_session.rs:252](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/sr_session.rs#L252) + + + +### D04 · D3D12 SR and generation hosts + +Port shared D3D12 SR, FG, provider dispatch and retirements. Coordinate provider-table changes with the vendor packages. + +**Coordinate shared edits** + +- Provider setup, feature guards and teardown across the Runtime and backends ([D03](#d03), [D05](#d05), [D06](#d06), [D07](#d07)). + +**Port files (10)** + +- [x] [runtime/backends/common/d3d12_helpers.h](runtime/backends/common/d3d12_helpers.h) (C declarations only) +- [x] [runtime/backends/common/fg_helpers.h](runtime/backends/common/fg_helpers.h) (C declarations only) +- [x] [runtime/backends/common/generation12_checks.h](runtime/backends/common/generation12_checks.h) +- [x] [runtime/backends/common/generation12_platform.h](runtime/backends/common/generation12_platform.h) +- [x] [runtime/backends/common/sr12_platform.h](runtime/backends/common/sr12_platform.h) +- [x] [runtime/orchestrator/include/rescaleframe/native_fg_d3d12.h](runtime/orchestrator/include/rescaleframe/native_fg_d3d12.h) +- [x] [runtime/orchestrator/include/rescaleframe/native_sr_d3d12.h](runtime/orchestrator/include/rescaleframe/native_sr_d3d12.h) +- [x] [runtime/orchestrator/src/fg12_platform.cpp](runtime/orchestrator/src/fg12_platform.cpp) (install dispatch in fg12/native.rs; capture lifetime in the C11 leaf fg12_platform.c) +- [x] [runtime/orchestrator/src/fg12_platform.h](runtime/orchestrator/src/fg12_platform.h) +- [x] [runtime/orchestrator/src/sr12_platform.cpp](runtime/orchestrator/src/sr12_platform.cpp) + +**Fixtures (2)** + +- [x] [tests/fg12_abi.cpp](tests/fg12_abi.cpp) +- [x] [tests/sr12_abi.cpp](tests/sr12_abi.cpp) + +**Rust review findings (16)** + +- [x] **Altitude | Medium | Preserve wait failure, timeout and device status as distinct D3D12 results.** The shared wait helper turns every WaitForSingleObject result except WAIT_OBJECT_0 into false, then returns DXGI_ERROR_DEVICE_HUNG for both a timeout and WAIT_FAILED. It also replaces the fence-arm HRESULT with E_FAIL. Callers through runtime/backends/common/d3d12_helpers.h:42 see a device diagnosis for an expired wait or bad event. Preserve the arm result, distinguish timeout and Win32 failure, and report device loss/hang only when the device supplies that evidence. [runtime/orchestrator/src/d3d12_fence.rs:60](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d12_fence.rs#L60) + +- [x] **Altitude | Medium | Expose unsuccessful provider teardown to the presentation owner.** The shared destroy callback returns void even when Session::retire declines and deliberately keeps the allocation alive. FSR can refuse while disabling or waiting for callbacks, and XeSS can refuse FG or XeLL destruction. d3d11_present.rs:1459 discards the outgoing handle and starts creating a replacement regardless, losing the retry handle and potentially overlapping HWND or SDK ownership. Add a checked teardown/retirement result and retain the outgoing session until it acknowledges completion. [runtime/orchestrator/src/d3d12_generation.rs:418](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d12_generation.rs#L418) + +- [x] **Altitude | Medium | Deduplicate XeLL input markers only after the SDK accepts them.** Xess::marker sets input_sampled before the SDK marker callback returns. If that call fails, the first attempt returns FEATURE_FAILED but every retry for the same frame returns OK without contacting XeLL. This makes the shared presentation marker route report delivery that never happened. Keep the attempted call serialized and set input_sampled only on SDK success. [runtime/orchestrator/src/d3d12_generation/xess.rs:351](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d12_generation/xess.rs#L351) + +- [x] **Duplication | Medium | Apply the same FG12 option validation at install and live update.** Installation validates mode and generated count but stores the request in OWNER without checking its reflex_mode. Runtime/orchestrator/src/fg12.rs:1266 (live update via runtime/orchestrator/src/fg12_platform.cpp:303) rejects reflex_mode above BOOST, and runtime/orchestrator/src/native_fg.rs:673 independently rejects it when install forwards the setup. Thus the local D3D12 presenter and shared settings can start with different options. Use one FG12-specific validator for the two entry points before publishing or forwarding settings, preserving any broader mode support in the shared owner. [runtime/orchestrator/src/fg12.rs:320](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg12.rs#L320) + +- [x] **Altitude | Medium | Give failed FG12 installation a rollback boundary for shared settings and callbacks.** Before native install reports success, the installer publishes the requested graphics API, FG options and logger, including its borrowed user pointer, to shared owners. On INIT_FAILED it only resets INSTALL. native_fg.rs:686 retains that sink, and subsequent native FG diagnostics can invoke it after the failed installer released its user context. Stage callback registration with the installer and publish on success, or restore the previous registrations and shared options on every failed return. [runtime/orchestrator/src/fg12.rs:384](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg12.rs#L384) + +- [x] **Duplication | Medium | Use the pacing owner's eligibility check before aborting older FG tokens.** D3D12 Present preparation walks its own CPU ring and calls host_abort on every older same-session row without a completed Present, then marks it complete regardless of the result. The shared pacing owner at runtime/orchestrator/src/native_fg_cpu.rs:305 and :1386 independently retires stale tokens, requiring ended, unsubmitted work with no render start or in-flight pacing, and its capacity path checks whether the host accepted the abort. An older recorded or pacing source can pass the FG12 scan but fail those checks, and a refused abort is then hidden by the completion bit. Route the sweep through the shared source ledger, retaining eligibility and abort result per token. [runtime/orchestrator/src/fg12.rs:882](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg12.rs#L882) + +- [x] **Altitude | Medium | Associate failed FG capability queries with the current Present.** D3D12 prepare returns immediately when provider.status fails, before recording last_result, reason or source_frame_id and before configuring the provider off. In the same backend generation, status_snapshot can still return the preceding source's successful preparation and active vendor status through rsf_fg12_status, which the callback render host reads. Make prepare publish a current-frame failure and deactivate the cached state on the early exit, and carry that result through retirement. [runtime/orchestrator/src/fg12.rs:912](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg12.rs#L912) + +- [x] **Duplication | Medium | Derive Reflex frame-limit intervals consistently across the native FG paths.** The D3D12 prepare callback and runtime/orchestrator/src/native_fg.rs:1410 independently construct rsf_fg_options from the same native options, capability and frame eligibility. Both cap the generated count and disable generation when ineligible. The latter divides the requested rendered-frame interval by generated+1 when Reflex paces eligible fixed FG, while fg12.rs:942 passes the full interval to that same pacing owner. At two generated frames the two configure callbacks receive a threefold difference. Share the provider-option calculation with explicit eligibility, keeping resource capture and provider submission in their respective owners. [runtime/orchestrator/src/fg12.rs:924](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg12.rs#L924) + +- [x] **Duplication | Medium | Count interpolated preparation consistently in native FG status.** D3D12 increments tagged_frames on every successful provider prepare, including eligible frames submitted with interpolate=0 when FG is off. The D3D11 bridge at runtime/orchestrator/src/native_fg.rs:1645 increments the same public field only when prepare succeeds and interpolation was requested. The counter reaches Unity package status at games/unity-mono/src/package_state.rs:512 and the Anomaly runtime-tagged display at games/anomaly/src/fg_stage.rs:610. Give both producers the same successful-interpolation predicate, or publish distinct counters if disabled preparation is independently useful. [runtime/orchestrator/src/fg12.rs:1030](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg12.rs#L1030) + +- [x] **Altitude | Medium | Keep inferred native-frame provenance attached to every SR12 capture operation.** For a pass with source_frame_id zero, evaluate marks only a temporary identity ambiguous for dump_begin_record. Its subsequent readbacks, SR parameters and result use the unflagged record. input_dump::Capture::wants explicitly requires the ambiguity flag to match, so the capture selects the frame and rejects its own inputs and results. Construct the record with the correct provenance once and use it consistently, including at FG handoff where a native counter alone cannot identify an input frame. [runtime/orchestrator/src/sr12.rs:1011](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/sr12.rs#L1011) + +- [x] **Boundaries | Medium | Bring the D3D12 SR test platform table back in line with the owner.** sr12.rs:118-120 declares the platform fields create_exposure_texture, create_exposure_upload and write_exposure_upload (matching sr12_platform.cpp:324-326/368-369), but the synthetic table in sr12/tests.rs:441-494 still initialises a field named create_unit_exposure (fn at :248, field at :460) and omits the three current fields. Because the module is compiled under #[cfg(test)] (sr12.rs:24-25) with Platform from super::*, the orchestrator crate test build cannot compile, so none of its owner tests (including the boundary contracts for SR/FG/overlay) run. Observed while checking the Rust-to-C++ platform table boundary; replace the stale fake with the three current callbacks. [runtime/orchestrator/src/sr12/tests.rs:460](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/sr12/tests.rs#L460) + +- [x] **Duplication | Low | Use one coexistence check when opening D3D12 generation providers.** The FSR constructor checks for a loaded Streamline DLL without a host before validating its supported UI modes. The XeFG constructor in runtime/orchestrator/src/d3d12_generation/xess.rs:509 checks UI_LAYER first, then repeats the same restart rule at line 512. With UI_LAYER and an unowned loaded Streamline module, the two native create callers (runtime/backends/fsr/src/fsr_generation.cpp:302 and runtime/backends/xess/src/xess_generation.cpp:263) therefore receive different errors for the same two failed prerequisites. Put the coexistence decision in a shared preflight with explicit precedence, leaving each provider to declare its supported options. [runtime/orchestrator/src/d3d12_generation/fsr.rs:779](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d12_generation/fsr.rs#L779) + +- [x] **Duplication | Low | Share ownership of resolved D3D12 provider bindings.** The SR loader closes a partially produced handle on bind failure, rejects success with a null handle, then unbinds before dropping the DLL. The FG loader independently implements the same rollback and destruction contract at runtime/orchestrator/src/d3d12_generation.rs:75 and :139. Both serve live FSR and XeSS constructors, including runtime/orchestrator/src/d3d12_sr/fsr.rs:47 and runtime/orchestrator/src/d3d12_generation/xess.rs:515. Extract the raw binding owner and result-to-handle conversion into sdk_module, retaining the SR compatibility lease and the FG optional latency DLL in their existing release order. [runtime/orchestrator/src/d3d12_sr.rs:35](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d12_sr.rs#L35) + +- [x] **Duplication | Low | Share the bounded FidelityFX provider enumeration used for SR and FG.** SR open and the FG probe/create path at runtime/orchestrator/src/d3d12_generation/fsr.rs:741 each allocate 32 version records, check the returned count, invoke ffx_version::select, and reject a zero winner. Their native leaves also duplicate the SDK query, parallel ID/name buffers, count check and record conversion at runtime/backends/fsr/src/fsr_backend.cpp:122 and runtime/backends/fsr/src/fsr_generation.cpp:87. Only the device source, queried context kind and failure diagnostics differ. Parameterize the native enumeration by device and context kind, and wrap the bounded candidates and admitted winner in ffx_version so SR can still log its list and FG can probe silently. [runtime/orchestrator/src/d3d12_sr/fsr.rs:90](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/d3d12_sr/fsr.rs#L90) + +- [x] **Altitude | Low | Retire failed diagnostic readbacks when their device generation is drained.** Colors::poll retires a completed fence or a missing fence after a generation switch. A fence reporting DeviceRemoved falls through forever, even after the presentation owner drains the old generation. Colors::wants then refuses every subsequent final/HUD-less capture because pending stays occupied. Preserve the distinction between pending and failed completion, discard the unusable pair on verified teardown, and allow the next generation to capture. [runtime/orchestrator/src/fg12/colors.rs:136](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fg12/colors.rs#L136) + +- [x] **Simplicity | Low | Reuse the validated external exposure view during normalization.** On each D3D12 evaluation with external exposure, inputs_valid describes the texture at line 718 and checks its SRV format. normalize immediately describes the retained texture a second time solely to obtain that same format. Store the validated format beside the retained COM reference and pass the pair to write_srv, using R32_FLOAT for the absent input as today. This trades one stored format for one fewer native description per evaluation and preserves the existing reference lifetime. [runtime/orchestrator/src/sr12.rs:894](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/sr12.rs#L894) + + + +### D05 · D3D11 and D3D12 DLSS + +Port Streamline startup, DLSS frame planning, evaluate and shutdown across shared and owned registrations. + +**Coordinate shared edits** + +- Provider setup, feature guards and teardown across the Runtime and backends ([D03](#d03), [D04](#d04), [D06](#d06), [D07](#d07)). + +**Port files (11)** + +- [x] [runtime/backends/dlss/include/rescaleframe/dlss.h](runtime/backends/dlss/include/rescaleframe/dlss.h) +- [x] [runtime/backends/dlss/include/rescaleframe/dlss_native12.h](runtime/backends/dlss/include/rescaleframe/dlss_native12.h) +- [x] [runtime/backends/dlss/include/rescaleframe/dlss_preset.h](runtime/backends/dlss/include/rescaleframe/dlss_preset.h) +- [x] [runtime/backends/dlss/src/dlss_native12.cpp](runtime/backends/dlss/src/dlss_native12.cpp) (deleted; Rust owns the typed D3D12 SDK calls in `dlss_native12/sdk.rs`) +- [x] [runtime/backends/dlss/src/dlss_streamline.cpp](runtime/backends/dlss/src/dlss_streamline.cpp) (deleted; Rust owns the signature verification in `streamline_sr/signature.rs`, exported as `rsf_dlss_sdk_verify_signature`, and the SDK default and enum checks in the `dlss_sr_layout` fixture; the remaining C++-only vendor header checks are in `tests/dlss_sr_layout_facts.cpp`, listed under C++ introduced during the port) +- [x] [runtime/backends/dlss/src/streamline_frame.h](runtime/backends/dlss/src/streamline_frame.h) (C declaration only: `rsf_streamline_common_set`) +- [x] [runtime/backends/dlss/src/streamline_load.h](runtime/backends/dlss/src/streamline_load.h) (C declaration only: the Rust interposer loader `rsf_streamline_load_interposer`) +- [x] [runtime/backends/dlss/src/streamline_sr.h](runtime/backends/dlss/src/streamline_sr.h) (deleted; the SDK records are built in Rust and checked in `dlss_streamline.cpp`) +- [x] [runtime/orchestrator/include/rescaleframe/dlss_pipeline.h](runtime/orchestrator/include/rescaleframe/dlss_pipeline.h) +- [x] [runtime/orchestrator/src/dlss_pipeline.cpp](runtime/orchestrator/src/dlss_pipeline.cpp) +- [x] [runtime/orchestrator/src/dlss_pipeline_platform.h](runtime/orchestrator/src/dlss_pipeline_platform.h) + +**Fixtures (2)** + +- [x] [tests/dlss_backend.cpp](tests/dlss_backend.cpp) +- [x] [tests/sr_pipeline.cpp](tests/sr_pipeline.cpp) + +**Rust review findings (12)** + +- [x] **Altitude | Medium | Give DLSS viewport resources the same ownership as the contexts that use them.** sr12.rs:443 can create multiple SR contexts from one device registration. Each context has its own quality and used_viewport flag, but Route::viewport derives the same viewport solely from registration type. Their options/tags can overwrite one another, and dropping either evaluated context calls free_viewport on the surviving context's ID. Allocate distinct viewport IDs per independent view or enforce a single live context per registered viewport and release it through that owner. [runtime/orchestrator/src/dlss_native12.rs:160](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_native12.rs#L160) + +- [x] **Duplication | Medium | Use one mapping for adapter-supplied Streamline engine metadata.** The owned D3D12 registration passes Unity through and maps all other rsf_dlss_setup engine values to custom. The D3D11 startup at runtime/orchestrator/src/dlss_streamline.rs:217 passes both Unreal and Unity through. Both native initialization leaves cast the result to the same sl::EngineType (runtime/backends/dlss/src/dlss_native12.cpp:113 and runtime/backends/dlss/src/dlss_streamline.cpp:268). An adapter declaring RSF_DLSS_ENGINE_UNREAL thus reports different engine identity solely by taking the other API. Share the supported enum mapping and keep render API, directory and logging preferences local. [runtime/orchestrator/src/dlss_native12.rs:302](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_native12.rs#L302) + +- [x] **Altitude | Medium | Start the requested D3D11 SR provider without requiring DLSS to initialize first.** The shared host chooses an SR backend from the owning adapter, but d3d11_host.rs:892 starts the pipeline and calls pipeline_select only after startup succeeds. Pipeline::start unconditionally loads Streamline, requires DLSS support and asks DLSS for a plan. An Intel or AMD device lacking DLSS cannot reach its selected XeSS or FSR backend. Give startup the selected backend and initialize only its dependencies, while sharing device/output ownership and provider-switch retirement. [runtime/orchestrator/src/dlss_pipeline.rs:791](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_pipeline.rs#L791) + +- [x] **Duplication | Medium | Build dense-motion resolve parameters from one conversion.** The DLSS scene pipeline converts canonical UV motion into previous-minus-current render pixels and fills the D3D11 resolve record. The native FG preparation at runtime/orchestrator/src/native_sr.rs:344 and the alternate SR backend at runtime/orchestrator/src/sr_legacy.rs:238 construct the same record and duplicate both signed axis products. Native FG and DLSS also separately derive sentinel availability from the two decoder flags. The legacy path explicitly uses zero jitter, the scene path can supply a depth layer and handle NDC input, and native FG takes camera jitter. Share the canonical conversion and parameter constructor, with the encoding, jitter and depth layer explicit in the caller, so a sign or sentinel fix reaches all three resolve calls. [runtime/orchestrator/src/dlss_pipeline.rs:1069](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_pipeline.rs#L1069) + +- [x] **Altitude | Medium | Distinguish original and submitted resources in the requested SR dump.** write_dump labels frame.scene_color and frame.depth as the backend's inputs. When colour transport runs, evaluate_scene passes dlss.color_in = encoded and no exposure; when dense normalization runs, it substitutes dlss.depth. A requested capture can therefore pair the backend output with different color/depth inputs from the same frame, obscuring reconstruction defects. Capture the descriptor handed to the selected provider at dispatch, and label engine originals separately. [runtime/orchestrator/src/dlss_pipeline.rs:1514](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_pipeline.rs#L1514) + +- [x] **Duplication | Medium | Commit successful SR quality changes through the same history reset.** The public quality setter at runtime/orchestrator/src/dlss_pipeline.cpp:460 reaches two copies of the post-plan state update. The DLSS branch at runtime/orchestrator/src/dlss_pipeline.rs:1923 calls restart_history, while the legacy FSR/XeSS branch at :1898 only sets reset_pending. After 120 vendor evaluation failures the common gate at :877 refuses every subsequent frame, so changing quality succeeds but cannot restart an alternate backend. Share the quality/range commit and call restart_history on either successful plan, preserving the provider-specific planning operations. [runtime/orchestrator/src/dlss_pipeline.rs:1898](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_pipeline.rs#L1898) + +- [x] **Quality | Medium | Switching back to DLSS drops the zero-range fallback and can refuse every later frame.** select_backend(SR_DLSS) stores Range::reported(plan) (line 2069), which keeps min/max exactly as the SDK reported them, while start, set_quality and resize_output use Range::of, whose comment says an SDK build that reports no range must accept the optimal size rather than be read as any size. The plan leaf copies slDLSSGetOptimalSettings renderWidthMin/Max straight through (dlss_streamline/planning.rs:148-151). When those are zero, evaluate_scene (line 912) rejects every frame because rw > range.max[0] == 0, so after a FSR/XeSS -> DLSS switch the pipeline returns INVALID for all frames until quality, resize or restart rebuilds the range with Range::of. The backend-switch test (dlss_pipeline_tests.rs:1141) uses a fixture plan with non-zero min/max, so the path is untested. [runtime/orchestrator/src/dlss_pipeline.rs:2069](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_pipeline.rs#L2069) + +- [x] **Altitude | Medium | Resolve a DLSS viewport once for constants, options, tags and evaluation.** The public frame contract describes scene viewport 0 and layer viewport 1. evaluate maps any other value to slot 0 for options, tags and evaluation, but the shared-host constants callback receives the unmodified frame.viewport. The frame fixture asserts viewport 7 reaches the host while the slot is 0. Reject an unsupported viewport before touching the SDK, or pass one consistently validated viewport identity through all four operations. [runtime/orchestrator/src/dlss_streamline/frame.rs:64](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_streamline/frame.rs#L64) + +- [x] **Duplication | Low | Share the projection-to-forward conversion with an explicit orthographic convention.** DLSS SR evaluation signs view_to_world[8..11] from view_to_clip[11]. FSR FG prepare does the same calculation at runtime/orchestrator/src/d3d12_generation/fsr.rs:619 and :247. The perspective branches agree, while a zero coefficient selects negative forward in DLSS SR and positive forward in FSR FG. The native DLSS FG caller at runtime/backends/dlss/src/dlss_generation.cpp:736 already expresses this distinction as an orthographic sign argument to runtime/backends/dlss/src/streamline_frame.h:12. Give the Rust evaluations the same shared pure conversion and explicit fallback, with cases for both perspective signs and zero. [runtime/orchestrator/src/dlss_native12.rs:586](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_native12.rs#L586) + +- [x] **Duplication | Low | Exercise the production DLSS motion-sign rule in the frame-assembly fixture.** The pipeline applies its Rust sign conversion to both axes at runtime/orchestrator/src/dlss_pipeline.rs:1092. The sign and reconstruction checks at tests/frame_assembly.cpp:105 instead invoke the separate constexpr implementation in runtime/orchestrator/src/motion_convention.h:7, whose only code caller is that test. Editing the native copy can make those reprojection checks pass without changing evaluation. Move the raw, dense-resolved and unspecified convention vectors to a Rust test of the production conversion, or run the native fixture through the actual public pipeline evaluation. [runtime/orchestrator/src/dlss_pipeline.rs:377](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_pipeline.rs#L377) + +- [x] **Simplicity | Low | dlss_pipeline re-implements the %.9g formatter that frame_capture_vk already exports** dlss_pipeline.rs:386-421 g9 is a private printf %.9g formatter: special-cases NaN, inf and zero, formats {:.8e}, splits the exponent, trims trailing zeros and chooses the scientific form outside -4..9. frame_capture_vk.rs:571-607 already exports pub(crate) general(value) = general_precision(value, 9) with the same algorithm, and frame_capture12.rs:11 imports it. Two test suites pin the same cases (dlss_pipeline_tests.rs:1231-1247 g9_matches_printf and frame_capture_vk/tests.rs:562-577 general_matches_iostream_precision_nine; both cover 0.1f32, 1e-5 or 1e-7, 123456789 and 1234567890). The only behavioural difference is that g9 prints -nan for a negative NaN where general prints nan. Simpler: delete g9, call crate::frame_capture_vk::general (or move the formatter to a small shared module), and keep one test table. Tradeoff: the diagnostic frame record would print nan instead of -nan for a sign-negative NaN, unless general adopts the -nan branch, which matches printf. [runtime/orchestrator/src/dlss_pipeline.rs:386](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_pipeline.rs#L386) + +- [x] **Duplication | Low | Pass the existing DLSS support and planning records through the pipeline leaves.** The pipeline maintains a private six-output range and eight-output support struct alongside the generated public types at runtime/orchestrator/src/dlss_streamline_abi.rs:7 and :42. The native leaves at runtime/orchestrator/src/dlss_pipeline.cpp:109 and :121 construct those public records, call the DLSS facade, and copy each output field back into the private layouts consumed by pipeline start and quality changes. Pass initialized public records across those leaves directly, keeping inputs and struct_size in the public plan and converting to the internal Range only where the pipeline applies its fallback rules. [runtime/orchestrator/src/dlss_pipeline_abi.rs:32](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_pipeline_abi.rs#L32) + + + +### D06 · D3D12 Streamline generation and compatibility + +Port generation, latency instrumentation and bundled compatibility handling with explicit module and callback ownership. + +**Coordinate shared edits** + +- Provider setup, feature guards and teardown across the Runtime and backends ([D03](#d03), [D04](#d04), [D05](#d05), [D07](#d07)). + +**Port files (14)** + +- [x] [runtime/backends/dlss/include/rescaleframe/streamline_host.h](runtime/backends/dlss/include/rescaleframe/streamline_host.h) +- [x] [runtime/backends/dlss/src/dlss_generation.cpp](runtime/backends/dlss/src/dlss_generation.cpp) (ported to `streamline_host/native.rs` with the shared SDK mirrors in `streamline_sdk.rs`; deleted) +- [x] [runtime/backends/dlss/src/mfg_unlock.cpp](runtime/backends/dlss/src/mfg_unlock.cpp) (ported to `mfg_state.rs`; deleted) +- [x] [runtime/backends/dlss/src/mfg_unlock.h](runtime/backends/dlss/src/mfg_unlock.h) (deleted; the Rust D3D12 host owns its `rsf_mfg_state` and calls `rsf_core_mfg_*` directly) +- [x] [runtime/backends/dlss/src/reflex_audit.cpp](runtime/backends/dlss/src/reflex_audit.cpp) (ported to `reflex_audit.rs`; deleted) +- [x] [runtime/backends/dlss/src/reflex_audit.h](runtime/backends/dlss/src/reflex_audit.h) (deleted with its last includer, dlss_generation.cpp) +- [x] [runtime/backends/dlss/src/streamline_diagnostics.h](runtime/backends/dlss/src/streamline_diagnostics.h) (deleted; the Rust host passes its log to `rsf_core_streamline_log_*` directly) +- [x] [runtime/backends/dlss/third_party/mfg_unlocker/dlssg_provider_policy.cpp](runtime/backends/dlss/third_party/mfg_unlocker/dlssg_provider_policy.cpp) +- [x] [runtime/backends/dlss/third_party/mfg_unlocker/dlssg_provider_policy.h](runtime/backends/dlss/third_party/mfg_unlocker/dlssg_provider_policy.h) +- [x] [runtime/backends/dlss/third_party/mfg_unlocker/midpoint_fix.cpp](runtime/backends/dlss/third_party/mfg_unlocker/midpoint_fix.cpp) (MIT; adapted in `mfg_midpoint.rs`; deleted) +- [x] [runtime/backends/dlss/third_party/mfg_unlocker/midpoint_fix.h](runtime/backends/dlss/third_party/mfg_unlocker/midpoint_fix.h) (deleted with its implementation) +- [x] [runtime/backends/dlss/third_party/mfg_unlocker/ngx_mfg_gate.h](runtime/backends/dlss/third_party/mfg_unlocker/ngx_mfg_gate.h) (MIT; adapted in `mfg_gate.rs`; deleted) +- [x] [runtime/backends/dlss/third_party/mfg_unlocker/protected_pointer.h](runtime/backends/dlss/third_party/mfg_unlocker/protected_pointer.h) (MIT; byte publication in `mfg_gate.rs`, pointer publication in `mfg_midpoint.rs`; deleted) +- [x] [runtime/backends/dlss/third_party/mfg_unlocker/universal_wrapper_profile.h](runtime/backends/dlss/third_party/mfg_unlocker/universal_wrapper_profile.h) + +**Fixtures (1)** + +- [x] [tests/latency_host.cpp](tests/latency_host.cpp) + +**Rust review findings (7)** + +- [x] **Altitude | Medium | Settle the token when the combined Streamline begin operation fails to sleep.** rsf_core_slhost_begin first commits acquire, advancing last_begin and occupying a token slot, then returns the sleep result directly. If the SDK sleep fails, the token remains live with sleep_claimed set, so repeating begin for that ID cannot succeed and destroy refuses while it remains. A caller using the combined public operation has no indication that it must now abort a partially acquired frame. Abort the token on failed begin, or return an explicit retained-token outcome while preventing a second sleep. [runtime/orchestrator/src/streamline_host.rs:464](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/streamline_host.rs#L464) + +- [x] **Duplication | Medium | Deduplicate the controller sample across both Streamline marker entry points.** Generation's provider marker at runtime/orchestrator/src/streamline_host/generation.rs:516 calls marker_for, which maps INPUT_SAMPLE with controller=1 to PCL marker 13 but never reads or sets Token::controller_sampled. The input-receipt route at runtime/orchestrator/src/streamline_host.rs:759 emits the identical marker and does set that bit. A controller marker followed by a controller receipt, or two controller marker calls for one token, can therefore notify the SDK twice. Route both through one locked emit-once helper, set the bit only on success, and keep the physical input counters specific to actual receipts. [runtime/orchestrator/src/streamline_host.rs:649](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/streamline_host.rs#L649) + +- [x] **Duplication | Medium | Share revision and source ordering across D3D12 generation providers.** DLSS-G Copied::stage_prepare, complete_prepare and abort repeat the FSR/XeSS state transitions in runtime/orchestrator/src/d3d12_generation.rs:253, :264 and :276. Both reject stale revisions and non-increasing frame IDs, consume a successful late completion's ID even after abort, and suppress activity from invalidated prepares. DLSS also publishes an SDK retirement fence and dynamic capabilities; FSR/XeSS record different observation counters. Extract only the revision/last-prepare/history state machine and run the interleaving tests from both providers against it, leaving statistics and SDK retirement data local. [runtime/orchestrator/src/streamline_host/generation.rs:124](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/streamline_host/generation.rs#L124) + +- [x] **Altitude | Medium | Keep Reflex and DLSS-G state coherent after a partial configuration failure.** Session configure applies the new Reflex mode and interval before calling the SDK generation-options operation. If generation configuration fails, the copied options/status still describe the previous request while the host already uses the new Reflex settings. Reapplying the old request hits the equality shortcut and skips restoring the driver. Roll back the accepted Reflex change or record the partial result so the next configure reconciles both SDK states. [runtime/orchestrator/src/streamline_host/generation.rs:472](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/streamline_host/generation.rs#L472) + +- [x] **Simplicity | Low | Represent an empty Streamline token slot once.** acquire publishes a nonzero source ID only after the SDK returns a nonnull handle. Retirement clears only the ID, leaving a handle that no caller may use. sleep, marker_for and generation.rs:603 nevertheless test for a missing handle after looking up a live ID. Use an array of Option with a required NonNull handle, publish Some on acquire, and take the slot on retirement. This moves the presence check into ring lookup while keeping the six-slot rotation, marker ordering and retry behavior. [runtime/orchestrator/src/streamline_host.rs:186](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/streamline_host.rs#L186) + +- [x] **Simplicity | Low | Keep one flag for a successfully prepared DLSS-G history.** Snapshot.history_valid and prepared_enabled are private, initialized false, cleared together under the same mutex by configured, stage_prepare and abort, and both assigned enabled by complete_prepare. polled requires both to report activity, and the concurrency tests mirror the pair. Keep history_valid alone and use it for both reset and activity decisions. The revision still rejects stale publication, and last_prepare still records consumed sources. A separate flag would become useful only if a transition could change one without the other. [runtime/orchestrator/src/streamline_host/generation.rs:52](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/streamline_host/generation.rs#L52) + +- [x] **Simplicity | Low | Borrow the boxed host for non-owning FFI tests.** The ring-retirement, PCL-profile and generation-reload tests convert a Box to a raw pointer and reconstruct the Box after calling functions that only borrow the host. The ring and reload cases repeat the transfer. Keep a mutable Box in each test and pass its as_mut() result at each FFI call. This removes unsafe ownership reconstruction and keeps cleanup automatic if an assertion fails, while exercising the same C entry points. [runtime/orchestrator/src/streamline_host/tests.rs:276](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/streamline_host/tests.rs#L276) + + + +### D07 · D3D12 FidelityFX and XeSS + +Port the two providers and FSR4 compatibility controls, coordinating the shared D3D12 dispatch contract with D04. + +**Coordinate shared edits** + +- Provider setup, feature guards and teardown across the Runtime and backends ([D03](#d03), [D04](#d04), [D05](#d05), [D06](#d06)). + +**Port files (12)** + +- [x] [runtime/backends/fsr/include/rescaleframe/fsr_backend.h](runtime/backends/fsr/include/rescaleframe/fsr_backend.h) +- [x] [runtime/backends/fsr/src/ffx_version.h](runtime/backends/fsr/src/ffx_version.h) +- [x] [runtime/backends/fsr/src/fsr4_compat.cpp](runtime/backends/fsr/src/fsr4_compat.cpp) +- [x] [runtime/backends/fsr/src/fsr4_compat.h](runtime/backends/fsr/src/fsr4_compat.h) +- [x] [runtime/backends/fsr/src/fsr4_compat_core.cpp](runtime/backends/fsr/src/fsr4_compat_core.cpp) (deleted; the Vulkan FSR4 bridge calls the C lease API directly) +- [x] [runtime/backends/fsr/src/fsr4_compat_core.h](runtime/backends/fsr/src/fsr4_compat_core.h) (deleted with the .cpp; `fsr4_compat_platform.h` carries the C declarations) +- [x] [runtime/backends/fsr/src/fsr4_compat_platform.h](runtime/backends/fsr/src/fsr4_compat_platform.h) +- [x] [runtime/backends/fsr/src/fsr_backend.cpp](runtime/backends/fsr/src/fsr_backend.cpp) +- [x] [runtime/backends/fsr/src/fsr_generation.cpp](runtime/backends/fsr/src/fsr_generation.cpp) +- [x] [runtime/backends/xess/include/rescaleframe/xess_backend.h](runtime/backends/xess/include/rescaleframe/xess_backend.h) +- [x] [runtime/backends/xess/src/xess_backend.cpp](runtime/backends/xess/src/xess_backend.cpp) +- [x] [runtime/backends/xess/src/xess_generation.cpp](runtime/backends/xess/src/xess_generation.cpp) + +**Fixtures (1)** + +- [x] [tests/fsr_backend.cpp](tests/fsr_backend.cpp) + +**Rust review findings (1)** + +- [x] **Quality | Low | FSR4 INT8 compatibility refuses silently when MinHook cannot create the hook.** install() uses `create_hook(...)?` and returns None without setting diagnostic.refusal. The native platform create_hook in runtime/backends/fsr/src/fsr4_compat_core.cpp:61 returns nullptr when MH_Initialize or MH_CreateHook fails (for example a target already hooked by another tool), and rsf_fsr4_acquire_int8_adapter only logs when diagnostic.refusal is non-null. On NVIDIA/Intel the FSR4 INT8 path then silently uses the SDK native refusal with no log line, which AGENTS.md treats as indistinguishable from a patch that worked. Set a refusal string such as "resident hook creation failed" before returning, as the enable_hook failure branch already does. [runtime/backends/fsr/compat/src/lib.rs:163](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/backends/fsr/compat/src/lib.rs#L163) + + + +### D08 · OpenGL interop and rendering + +Port OpenGL sharing, the rendering pipeline and its surface fixture alongside linked consumers. + +**Coordinate shared edits** + +- OpenGL shared surfaces, device ownership and linked Minecraft callers ([M01](#m01), [D02](#d02)). + +**Port files (4)** + +- [x] [runtime/orchestrator/include/rescaleframe/gl_pipeline.h](runtime/orchestrator/include/rescaleframe/gl_pipeline.h) +- [x] [runtime/orchestrator/src/gl_pipeline_platform.cpp](runtime/orchestrator/src/gl_pipeline_platform.cpp) +- [x] [runtime/presentation/include/rescaleframe/gl_shared_surface.h](runtime/presentation/include/rescaleframe/gl_shared_surface.h) +- [x] [runtime/presentation/src/gl_shared_surface.cpp](runtime/presentation/src/gl_shared_surface.cpp) + +**Fixtures (1)** + +- [x] [tests/gl_shared_surface.cpp](tests/gl_shared_surface.cpp) + +**Rust review findings (10)** + +- [x] **Altitude | Medium | Make the OpenGL child-window and swapchain resize one recoverable operation.** Pipeline::prepare resizes the child window first and returns on a failed DXGI resize without restoring its old extent. Configure keeps the preceding surfaces, width and height on this return, leaving the visible window at the rejected size. A subsequent request for the old Shape takes the fast path and never repairs the mismatch. Roll back the window resize or track each actual extent and reconcile both before reporting the surviving configuration. [runtime/orchestrator/src/gl_pipeline.rs:505](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/gl_pipeline.rs#L505) + +- [x] **Altitude | Medium | Publish the result of the complete OpenGL SR reconfiguration.** select_sr stores the result of creating the candidate provider before surface allocation and resize finish. The existing rejected_switch_keeps_published_session_and_a_retry_rebuilds test explicitly observes FEATURE_FAILED from configure when the third replacement texture fails, but status reports requested FSR3, effective DLSS and sr_result OK. Preserve the active session and record the final configuration result, with a separate field if provider discovery or evaluation results must also be retained. [runtime/orchestrator/src/gl_pipeline.rs:573](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/gl_pipeline.rs#L573) + +- [x] **Altitude | Medium | Carry the presented OpenGL view identity through to FG.** Evaluate and hudless accept the engine's pass and keep its view_key, but the generic present entry accepts only a frame ID and constructs a window pass with view_key fixed to 1. Minecraft happens to supply 1 in games/minecraft/native/frame.rs:78. A caller supplying a different valid view cannot match its captured depth, motion and HUD-less inputs in fg12::View::matches. Pass the presented view explicitly, or retain the frame-to-view association and reject ambiguous frames. [runtime/orchestrator/src/gl_pipeline.rs:720](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/gl_pipeline.rs#L720) + +- [x] **Altitude | Medium | Keep an owned presentation window retryable when destruction fails.** Pipeline::close checks the GL drain and close results, but discards the result of window_destroy, clears both window pointers and marks the pipeline closed. The Win32 leaf returns failure when the owning thread does not process the destruction request, so close can report success while leaving the child alive with no handle to retry. Model the remaining window teardown as a distinct step, retain its handle on failure and retry only the outstanding work. [runtime/orchestrator/src/gl_pipeline.rs:757](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/gl_pipeline.rs#L757) + +- [x] **Altitude | Medium | Return a cleanup owner for partially opened OpenGL pipelines.** After FG hook installation succeeds, a failed or unintercepted DXGI chain causes open to forget the chain and return an error with a null output. The GL sharing object and any owned child window also remain live, and fg12's process-wide registration makes reopening return NEEDS_RESTART. The caller cannot retire these resources or detach its borrowed logger. Separate hook registration from per-pipeline resources and return a cleanup-only handle when callbacks still require them. [runtime/orchestrator/src/gl_pipeline.rs:924](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/gl_pipeline.rs#L924) + +- [x] **Altitude | Medium | Make the GL semaphore operations report whether the ownership transfer succeeded.** The native release and acquire leaves return void even though their GL semaphore operations can set error flags. Begin schedules a D3D12 queue wait on the assumed GL signal, and settle marks the slot idle after an assumed GL wait. A rejected signal can leave the queue waiting indefinitely, while a rejected acquire lets the caller reuse a texture without the promised synchronization. Return the GL result from both leaves and retain an explicit failed-transfer state until recovery is proven. [runtime/orchestrator/src/gl_shared_surface.rs:432](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/gl_shared_surface.rs#L432) + +- [x] **Altitude | Medium | Have GL submission reacquire the batch released by begin.** The begin operation validates and releases textures and retains their D3D12 resources, but stores only the slot in Phase::Recording. Submit accepts a second caller-supplied texture list and uses it for the GL acquire without comparing it with the first. Supplying a different valid batch, or zero textures, can complete the operation without restoring the original textures' ownership. Store the released batch with the recording and consume it at submit, or reject a mismatch before executing commands. [runtime/orchestrator/src/gl_shared_surface.rs:832](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/gl_shared_surface.rs#L832) + +- [x] **Boundaries | Low | Use the shared Runtime SR and FG Auto policies in the OpenGL pipeline.** gl_pipeline.rs:43 and :429 resolve SR Auto by trying DLSS, FSR4, XeSS, FSR3, FSR2 in a fixed order until one session is created, regardless of GPU vendor, while the Runtime Auto owner rsf_gpu_select_sr_backend (lib.rs:385) picks the vendor preference and then FSR3/XeSS from the servable choices and is what callback_host, d3d11_host, render_host, Unity and Godot use. gl_pipeline.rs:524 likewise resolves FG Auto with rsf_fg_default_backend(vendor, software) alone and skips rsf_fg_select_auto_backend (fg_choice.rs:47) and its served-provider/FSR3 fallback. The same Auto setting therefore selects different backends on the OpenGL host (for example DLSS attempted first on AMD/Intel, Off instead of FSR3 for an unknown vendor), and backend choice is split across two Runtime policies instead of one owner. [runtime/orchestrator/src/gl_pipeline.rs:43](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/gl_pipeline.rs#L43) + +- [x] **Simplicity | Low | Rust hosts reach the sibling sr12 and fg12 owners through C++ wrapper leaves** gl_pipeline.rs:98-109 has platform slots sr_create, sr_plan, sr_evaluate, sr_set_sharpening, sr_destroy, fg_install, fg_options, fg_cpu, fg_hudless, fg_submitted, fg_window and fg_status. gl_pipeline_platform.cpp:199-210 and :233-235 fill them with rsf_sr12_* and rsf_fg12_*. Those are C++ wrappers: sr12_platform.cpp:393-396 rsf_sr12_create just returns rsf_core_sr12_create(setup, out, &platform), and fg12_platform.cpp:240-304 makes each rsf_fg12_* call bind_platform() and forward to rsf_core_fg12_*. Both are #[no_mangle] Rust exports in this crate (sr12.rs:1287, fg12.rs:392-1274). The same detour is used by render_host (render_host_platform.cpp:118-122) and the callback host (callback_render_host_platform.cpp:87-107). So a Rust owner calls a C++ leaf, which calls a Rust export, which re-validates raw pointers and struct sizes the caller already built in Rust. Simpler: register the sr12 and fg12 platform tables once (fg12 already keeps a OnceLock PLATFORM, fg12.rs:32), and have gl_pipeline, render_host and callback_host call crate::sr12 and crate::fg12 functions directly. The twelve per-host slots and their C++ fills go away. Tradeoff: sr12 must hold its platform table globally rather than take it per rsf_sr12_create, and the host must ensure the one-time bind ran before its first FG call, which is what bind_platform() does inside every wrapper today. gl_pipeline does the same for its nine gl_* slots (gl_pipeline.rs:75-83): gl_pipeline_platform.cpp:177-184 and :230-231 fill them with rsf_gl_graphics, rsf_gl_texture_create, rsf_gl_begin and the others, which are #[no_mangle] Rust exports of gl_shared_surface.rs:718-881 in the same crate, so a typed gl_shared_surface::Context is handled as an opaque Handle. native_window.rs:161-166 likewise receives native_scene.rs:171 rsf_native_scene_for_window back as its query_scene function-pointer argument (native_window_platform.cpp:31-32) instead of calling crate::native_scene directly. overlay_host.rs:191 calls the platform load_panel slot, which loader/proxy/src/overlay_host.cpp:27-30 implements as rsf_core_overlay_panel_open from overlay_panel.rs:87 in this crate. The panel table it returns has already been checked by complete() (overlay_panel.rs:29-35), but it is then unwrapped through leaf() at each use. overlay_service.rs gets input_counters_get, input_routes_get and fg_status_get through rsf_overlay_platform (overlay_platform.cpp:90-92). Those are C++ forwards to this crate's rsf_core_overlay_input_counters (overlay_input_route.rs:363, via runtime/graphics/src/overlay_input.cpp:424-427), rsf_core_native_input_routes_get (native_fg_cpu.rs:1490, via native_fg.cpp:115-117) and rsf_core_native_fg_status_get (native_fg.rs:693, via native_fg_platform.cpp:229-232). Meanwhile overlay_service.rs:7 already calls native_cpu::rsf_native_input_receipts_get directly. This is related to but distinct from the auxiliary_sr C-export entry (PORT.md, Boundaries) and the depth_scale entry. [runtime/orchestrator/src/gl_pipeline.rs:98](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/gl_pipeline.rs#L98) + +- [x] **Duplication | Low | Use one reserve-then-initialize operation for graphics owner handles.** GL context open, texture creation at runtime/orchestrator/src/gl_shared_surface.rs:754 and pipeline open at runtime/orchestrator/src/gl_pipeline.rs:969 all call the shared allocator, then separately cast uninitialized storage, write the completed object, publish it, or rebuild a Box to free it on failure. SR session open at runtime/orchestrator/src/d3d12_sr.rs:109 already keeps a Box> until Box::write succeeds. Put that initialization transaction beside allocate_handle, taking a fallible initializer and caller-specific allocation error. This preserves the necessary allocation-before-GPU-side-effects ordering and removes three manual cleanup branches. [runtime/orchestrator/src/gl_shared_surface.rs:697](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/gl_shared_surface.rs#L697) + + + +### V01 · Vulkan SR and provider admission + +Port the shared Vulkan SR services, split routes and provider-selection boundaries. + +**Coordinate shared edits** + +- Shared Vulkan resource state, provider selection and queue retirement ([V02](#v02), [V03](#v03), [V04](#v04), [V05](#v05), [V06](#v06)). + +**Port files (8)** + +- [x] [runtime/orchestrator/include/rescaleframe/native_sr_split_vulkan.h](runtime/orchestrator/include/rescaleframe/native_sr_split_vulkan.h) +- [x] [runtime/orchestrator/include/rescaleframe/native_sr_vulkan.h](runtime/orchestrator/include/rescaleframe/native_sr_vulkan.h) +- [x] [runtime/orchestrator/src/native_sr_split_lease.h](runtime/orchestrator/src/native_sr_split_lease.h) +- [x] [runtime/orchestrator/src/native_sr_split_vulkan.cpp](runtime/orchestrator/src/native_sr_split_vulkan.cpp) +- [x] [runtime/orchestrator/src/native_sr_vulkan.c](runtime/orchestrator/src/native_sr_vulkan.c) (C++ removed; C11 leaf with the FidelityFX SDK layout asserts, the SEH-guarded SDK and device-proc calls filtered on 0xE06D7363, the CMake-selected platform table and the seven export thunks) +- [x] [runtime/orchestrator/src/native_vulkan_timing.h](runtime/orchestrator/src/native_vulkan_timing.h) +- [x] [runtime/orchestrator/src/vulkan_fidelityfx_native.h](runtime/orchestrator/src/vulkan_fidelityfx_native.h) (C declarations only) +- [x] [runtime/orchestrator/src/vulkan_sdk_native.h](runtime/orchestrator/src/vulkan_sdk_native.h) (C declarations and a loader initializer macro only) + +**Fixtures (4)** + +- [x] [tests/native_sr_split_vulkan.cpp](tests/native_sr_split_vulkan.cpp) +- [x] [tests/native_sr_vulkan.cpp](tests/native_sr_vulkan.cpp) +- [x] [tests/native_sr_xess_range_check.py](tests/native_sr_xess_range_check.py) (writes a C++ contract fixture) +- [x] [tests/native_vulkan_exports.cpp](tests/native_vulkan_exports.cpp) + +**Rust review findings (10)** + +- [x] **Duplication | Medium | Share Vulkan image allocation while preserving FidelityFX's nonlocal memory fallback.** FidelityFX allocates its output and zero mask at :635 by repeating create-image, query requirements, choose a memory type, allocate and bind through the same image callback table used by runtime/orchestrator/src/vulkan_fg_resources.rs:94. The shared allocator checks success handles and rolls back a partial replacement. StagingImage instead publishes partial handles for later release and its memory_type at :486 permits a compatible nonlocal type. Factor the allocation transaction into the shared resource owner with an explicit memory-choice policy, then adapt its result to FidelityFX's INIT_FAILED contract. [runtime/orchestrator/src/vulkan_sr.rs:446](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sr.rs#L446) + +- [x] **Altitude | Medium | Give the SR output capture the same stage meaning across Vulkan providers.** The FidelityFX path records sr-output-linear after its optional post-sharpening dispatch. Vulkan DLSS records the identically named input before sharpening, and the owner fixtures explicitly assert both orderings. A comparison of SDK outputs can therefore include RSF's filter on one provider only. Capture the raw SDK output before post-processing on every path, labeling any separately requested final sharpened output by its actual stage. [runtime/orchestrator/src/vulkan_sr.rs:753](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sr.rs#L753) + +- [x] **Altitude | Medium | Return a cleanup-only Vulkan SR owner when failed creation cannot retire the SDK.** If FidelityFx::create fails after creating an effect and Drop cannot destroy it, Drop forgets the module and device-dispatch lease and abandons the native owner. rsf_core_srvk_create leaves out null, so no caller can retry cleanup even if destruction becomes possible later. Preserve the partially constructed owner for checked destruction, as the Vulkan FG creation path already does, while refusing evaluation and plan queries on it. [runtime/orchestrator/src/vulkan_sr.rs:803](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sr.rs#L803) + +- [x] **Altitude | Medium | Honor XeSS context destruction failures during constructor rollback.** XessOwner::destroy preserves a published owner if the SDK refuses destruction, but Drop during failed initialization ignores the same destroy_context result, releases the private images, closes the native handle and releases the library lease. A failure after context creation can thus leave a live SDK context without its cleanup owner. Keep the partially constructed owner and its dependencies reachable until checked teardown succeeds, and inject a rollback refusal in the initialization fixture. [runtime/orchestrator/src/vulkan_sr/xess.rs:662](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sr/xess.rs#L662) + +- [x] **Duplication | Medium | Exercise the production Vulkan SR admission path in XeSS owner fixtures.** XeSS fixtures invoke a second create/plan/evaluate/retire/destroy surface, including tests/native_xess_vulkan.cpp:129 and :152. Its owner_admit normalizes the input and checks frame_admit before calling XeSS directly. The actual rsf_core_srvk_evaluate at runtime/orchestrator/src/vulkan_sr.rs:907 also validates sharpening, starts capture and records the backend result; its create branch calls XessOwner::create directly at :833. Route end-to-end fixture calls through the production dispatcher with the XeSS fake platform, and test any isolated owner behavior directly so the separate fixture ABI cannot drift. [runtime/orchestrator/src/vulkan_sr/xess.rs:678](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sr/xess.rs#L678) + +- [x] **Simplicity | Low | Set fake Vulkan blit capabilities on the fake device.** fallback_probe reads the native format feature mask from call.output.copy_source, so the fallback test writes LINEAR_BLIT into a resource field that represents copy-source availability. The setup already supplies a Fake through call.device. Give Fake a blit_features field and have the probe read it there. This adds one fixture field and lets the existing supported, unsupported and alias cases use ordinary resource descriptors. [runtime/orchestrator/src/vulkan_sr/owner_tests.rs:428](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sr/owner_tests.rs#L428) + +- [x] **Simplicity | Low | Store each XeSS private image descriptor once.** Private carries an Image alongside OwnedImage. Creation writes formats and dimensions into the first, passes them to ensure_image, then copies the allocated image handle back. texture reads the first handle and format, the second view, and takes the allocation dimensions again from its caller. Keep the four OwnedImage records, pass requested format and extent directly at allocation, and construct the SDK texture from the resulting record. Build the output capture descriptor locally with setup.device and GENERAL layout. This adds a small conversion at the capture boundary and keeps active render dimensions independent of the maximum allocation. [runtime/orchestrator/src/vulkan_sr/xess.rs:334](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sr/xess.rs#L334) + +- [x] **Simplicity | Low | Remove the global raw pointer from the XeSS test fixture.** with_state publishes a pointer to a stack Fake, then passes a separate mutable borrow to the test. The callback helper state() can manufacture a mutable reference with any lifetime and leaves the pointer installed if an assertion unwinds. Keep the SDK-session serialization mutex and put the fake event log and configurable results in a thread-local RefCell, borrowing it only to edit or inspect data between calls. The synchronous fake callbacks can take their own short borrows, at the cost of slightly more explicit test assertions. [runtime/orchestrator/src/vulkan_sr/xess/tests.rs:66](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sr/xess/tests.rs#L66) + +- [x] **Duplication | Low | Share the Vulkan SR test callback macro between sibling fixtures.** The XeSS fixture and runtime/orchestrator/src/vulkan_sr/owner_tests.rs:89 define the same leaf macro that turns a typed inline body into an unsafe extern C callback. The fixture tables already compose across modules: the shared platform uses XeSS OPS, and the XeSS routing test calls that shared platform. Define the macro once under cfg(test) in their parent module so callback calling-convention and syntax changes apply to both tables. [runtime/orchestrator/src/vulkan_sr/xess/tests.rs:76](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sr/xess/tests.rs#L76) + +- [x] **Duplication | Low | Use the admitted Vulkan FSR4 setup when constructing the split owner.** The public create path discards the two validated records returned by admit_setup. Its provider callback at native_sr_split_vulkan.cpp:46 goes through runtime/orchestrator/src/native_sr_fsr4_vulkan.cpp:177 to runtime/orchestrator/src/vulkan_fsr4_sr.rs:475, where the same function rereads and revalidates both input structures. Move owner initialization into a Rust function accepting the admitted Setup/Handoff, have independent ABI entries validate once at their own boundary, and keep the public NOT_COMPILED and private result mappings at the appropriate entry. [runtime/orchestrator/src/vulkan_sr_split.rs:101](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_sr_split.rs#L101) + + + +### V02 · Vulkan FG and shared WSI + +Port common frame-generation resources, transfers, submission and swapchain lifetime for Vulkan. + +**Coordinate shared edits** + +- Capture publication after a submitted command or queue is retired ([G07](#g07), [V04](#v04), [V05](#v05), [V06](#v06)). +- Shared Vulkan resource state, provider selection and queue retirement ([V01](#v01), [V03](#v03), [V04](#v04), [V05](#v05), [V06](#v06)). + +**Port files (9)** + +- [x] [runtime/orchestrator/include/rescaleframe/native_fg_vulkan.h](runtime/orchestrator/include/rescaleframe/native_fg_vulkan.h) +- [x] [runtime/orchestrator/src/native_fg_ffx_vulkan.h](runtime/orchestrator/src/native_fg_ffx_vulkan.h) +- [x] [runtime/orchestrator/src/native_fg_vulkan.cpp](runtime/orchestrator/src/native_fg_vulkan.cpp) (SDK leaf in `vulkan_ffx_fg/sdk.rs`; the C11 leaf `native_fg_vulkan.c` keeps the `RSF_HAVE_FFX_VK` gate, the provider symbols and the resolver exception guards) +- [x] [runtime/orchestrator/src/native_fg_vulkan_dispatch.cpp](runtime/orchestrator/src/native_fg_vulkan_dispatch.cpp) (C11 provider table `native_fg_vulkan_dispatch.c`, kept native for the CMake provider gates and link-time fixture providers) +- [x] [runtime/orchestrator/src/native_fg_vulkan_platform.h](runtime/orchestrator/src/native_fg_vulkan_platform.h) +- [x] [runtime/orchestrator/src/vulkan_fg_copy.h](runtime/orchestrator/src/vulkan_fg_copy.h) +- [x] [runtime/orchestrator/src/vulkan_fg_frames.h](runtime/orchestrator/src/vulkan_fg_frames.h) +- [x] [runtime/orchestrator/src/vulkan_fg_resources.h](runtime/orchestrator/src/vulkan_fg_resources.h) +- [x] [runtime/orchestrator/src/vulkan_fg_resources_native.h](runtime/orchestrator/src/vulkan_fg_resources_native.h) + +**Fixtures (8)** + +- [x] [tests/vulkan-fg/dispatch_fixture.cpp](tests/vulkan-fg/dispatch_fixture.cpp) (fake provider callbacks) +- [x] [tests/vulkan-fg/ffx_fixture.cpp](tests/vulkan-fg/ffx_fixture.cpp) (SDK records and Vulkan callbacks; fake SDK module in `src/ffx_sdk.rs`, C11 launcher `ffx_fixture.c`) +- [x] [tests/ffx_vulkan_wsi_dispatch.cpp](tests/ffx_vulkan_wsi_dispatch.cpp) (C11 `ffx_vulkan_wsi_dispatch.c` over the C11 `wsi-dispatch.h` section) +- [x] [tests/native_ffx_vulkan_harness.h](tests/native_ffx_vulkan_harness.h) +- [x] [tests/native_ffx_vulkan_reset.cpp](tests/native_ffx_vulkan_reset.cpp) +- [x] [tests/native_ffx_vulkan_submission.cpp](tests/native_ffx_vulkan_submission.cpp) +- [x] [tests/native_ffx_vulkan_wsi_route.cpp](tests/native_ffx_vulkan_wsi_route.cpp) +- [x] [tests/native_fg_vulkan_dispatch.cpp](tests/native_fg_vulkan_dispatch.cpp) + +**Rust review findings (4)** + +- [x] **Duplication | Medium | Use one image-barrier ABI for native Vulkan and Vulkan-to-DX12 command recording.** The shared Vulkan recorder sends its nine-field barrier to a native callback at :109. The DX12 bridge defines the identical 40-byte record at runtime/orchestrator/src/vulkan_dx12_fg.rs:325 and sends it through GraphicsOps::record at :518. Their native declarations are also maintained separately in runtime/orchestrator/src/vulkan_fg_copy.h:6 and runtime/orchestrator/src/native_fg_dx12_vulkan_platform.h:34. Use the existing barrier type and header for both with a queue-family-aware constructor for external acquire/release. Keep the distinct copy/blit descriptors, which carry different extent and layout information. [runtime/orchestrator/src/vulkan_fg_copy.rs:20](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_fg_copy.rs#L20) + +- [x] **Altitude | Medium | Apply the stored source's FG veto in the shared presentation admission check.** Implicit PresentSource reports true for both matches and allows_fg. The shared present_candidate checks submission/completion but never checks NO_FG or AMBIGUOUS_ID on the stored frame. Vulkan FFX and DLSS pass those values straight through, while vulkan_dx12_fg.rs separately rejects the stored flags. Enforce the stored veto in the common predicate, with the explicit Present identity able to impose an additional veto; test both provider call styles. [runtime/orchestrator/src/vulkan_fg_frames.rs:248](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_fg_frames.rs#L248) + +- [x] **Simplicity | Low | Let the WSI route determine which FidelityFX owner can release it.** Owner.admitted mirrors Route.owner solely to guard withdraw. Route::release already compares the caller ID under its mutex before resetting the route, so both a refused applicant and a repeated release leave another owner untouched. Call route().release(self.id()) at the existing two teardown points and remove admitted and withdraw. This takes one extra mutex acquisition on failed admission while keeping the route held through module unload. [runtime/orchestrator/src/vulkan_ffx_fg.rs:840](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_ffx_fg.rs#L840) + +- [x] **Duplication | Low | Give Vulkan FG recording owners a typed submission-plan function.** DLSS-G at runtime/orchestrator/src/vulkan_dlss_fg.rs:533, FidelityFX at runtime/orchestrator/src/vulkan_ffx_fg.rs:606 and the Vulkan-to-DX12 bridge at runtime/orchestrator/src/vulkan_dx12_fg.rs:1036 each assemble raw pointers to the six recording slots and initialize a three-mask plan that the shared FFI function immediately overwrites. The bridge even converts an existing command slice back into pointer/count. Return the plan from one Rust function taking a fixed array of mutable slot references and a command slice, adapt the C entry once if retained, and leave backend-specific fence and capture actions at the callers. [runtime/orchestrator/src/vulkan_fg_frames.rs:175](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_fg_frames.rs#L175) + + + +### V03 · Vulkan DX12 interop and generation + +Port Vulkan-to-D3D12 graphics and queue handoff shared by the FSR4 and XeSS FG consumers. + +**Coordinate shared edits** + +- Shared Vulkan resource state, provider selection and queue retirement ([V01](#v01), [V02](#v02), [V04](#v04), [V05](#v05), [V06](#v06)). + +**Port files (5)** + +- [x] [runtime/orchestrator/src/native_dx12_vulkan_interop.cpp](runtime/orchestrator/src/native_dx12_vulkan_interop.cpp) +- [x] [runtime/orchestrator/src/native_dx12_vulkan_interop.h](runtime/orchestrator/src/native_dx12_vulkan_interop.h) +- [x] [runtime/orchestrator/src/native_dx12_vulkan_platform.h](runtime/orchestrator/src/native_dx12_vulkan_platform.h) +- [x] [runtime/orchestrator/src/native_fg_dx12_vulkan.cpp](runtime/orchestrator/src/native_fg_dx12_vulkan.cpp) +- [x] [runtime/orchestrator/src/native_fg_dx12_vulkan_platform.h](runtime/orchestrator/src/native_fg_dx12_vulkan_platform.h) + +**Fixtures (2)** + +- [x] [tests/native_dx12_vulkan_interop.cpp](tests/native_dx12_vulkan_interop.cpp) +- [x] [tests/vulkan_interop_fixture.h](tests/vulkan_interop_fixture.h) + +**Rust review findings (5)** + +- [x] **Altitude | Medium | Resolve Vulkan dispatch where the typed function pointers live.** The native interop open function calls Rust to enumerate thirteen procedure names, Rust calls its C++ lookup thunk once per name, and native_dx12_vulkan_interop.cpp:65 assigns the resulting untyped array to Vulkan function pointers by position. Changing one list's order can bind a non-null address with the wrong calling signature and still pass Rust's completeness check. Let native open resolve each named procedure into its typed member and return one status to the Rust owner. [runtime/orchestrator/src/dx12_vulkan_interop.rs:60](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dx12_vulkan_interop.rs#L60) + +- [x] **Duplication | Medium | Validate Vulkan image descriptors through the existing shared predicate.** The bridge checks device identity, nonzero image, extent, shader-read layout, exact format and copy-source permission before staging depth, motion and HUD-less inputs at :932 and :997. DLSS-G repeats these checks at runtime/orchestrator/src/vulkan_dlss_fg.rs:401, while FidelityFX's directly consumed guides at runtime/orchestrator/src/vulkan_ffx_fg.rs:450 omit the copy permission. Move or reuse runtime/orchestrator/src/vulkan_sr.rs:104 valid_image for the shared descriptor fields and require copy_source only at the copy callers, so both presentation and reconstruction interpret the same descriptor consistently. [runtime/orchestrator/src/vulkan_dx12_fg.rs:897](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dx12_fg.rs#L897) + +- [x] **Altitude | Medium | Resize retired FG guide images independently of the presentation swapchain.** After waiting for the slot's consumer timeline and source fences, prepare returns OUT_OF_DATE whenever guide width or height differs from its first use. A render-scale or quality change can therefore disable the FSR4/XeSS bridge on each reused slot even though its output dimensions and swapchain still match. The importer currently retains images until whole-owner destruction. Add a checked replacement/release operation at the imported-image owner and resize only the drained depth and motion pair. [runtime/orchestrator/src/vulkan_dx12_fg.rs:945](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dx12_fg.rs#L945) + +- [x] **Duplication | Low | Derive Vulkan FG capture group IDs in the recording ledger.** Both the DX12 bridge and DLSS-G at runtime/orchestrator/src/vulkan_dlss_fg.rs:150 encode the shared recording_sequence and the guides/HUD-less discriminator into the same integer. The bridge uses shifts for recording, completion and discard at :857, :985 and :1060, while DLSS uses multiplication for SDK capture and submission discard at :484 and :552. Put the group calculation on the common recording type in vulkan_fg_frames and use it at each capture lifecycle step so recording and retirement cannot adopt different encodings. [runtime/orchestrator/src/vulkan_dx12_fg.rs:717](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dx12_fg.rs#L717) + +- [x] **Simplicity | Low | Use the committed timeline values to identify first-use images.** Before submitting the first Present the fallback images and each imported backbuffer start uninitialized. The only writes to fallback_initialized and buffer.initialized occur together with last_done and buffer.done after a successful present_submit. The done value is allocated with checked_add(2), so zero uniquely means no successful submission. Gate fallback clear on last_done == 0 and choose the backbuffer acquire barrier using buffer.done != 0. The tradeoff is documenting that zero sentinel once; the independent guide and HUD-less submission states still need their own flags. [runtime/orchestrator/src/vulkan_dx12_fg.rs:1183](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dx12_fg.rs#L1183) + + + +### V04 · Streamline and NGX Vulkan + +Port SDK loading, DLSS SR and FG, capture and session lifetime across the Runtime and standalone bridges. + +**Coordinate shared edits** + +- Capture publication after a submitted command or queue is retired ([G07](#g07), [V02](#v02), [V05](#v05), [V06](#v06)). +- Shared Vulkan resource state, provider selection and queue retirement ([V01](#v01), [V02](#v02), [V03](#v03), [V05](#v05), [V06](#v06)). + +**Port files (18)** + +- [x] [runtime/orchestrator/include/rescaleframe/native_fg_dlss_vulkan.h](runtime/orchestrator/include/rescaleframe/native_fg_dlss_vulkan.h) +- [x] [runtime/orchestrator/include/rescaleframe/native_streamline_vulkan.h](runtime/orchestrator/include/rescaleframe/native_streamline_vulkan.h) +- [x] [runtime/orchestrator/src/native_dlss_vulkan.cpp](runtime/orchestrator/src/native_dlss_vulkan.cpp) (converted to the C11 table `native_dlss_vulkan.c`; the SDK, device, image, sharpening and capture leaves are Rust in `vulkan_dlss_sr/leaves.rs`) +- [x] [runtime/orchestrator/src/native_dlss_vulkan_platform.h](runtime/orchestrator/src/native_dlss_vulkan_platform.h) (C declarations only; the DLSS options and optimal-settings records moved to `runtime/vulkan/streamline/sdk_sr_options.h`) +- [x] [runtime/orchestrator/src/native_fg_dlss_vulkan.cpp](runtime/orchestrator/src/native_fg_dlss_vulkan.cpp) (converted to the C11 `native_fg_dlss_vulkan.c`: production table and `rsf_dlssgvk_*` export thunks; the SDK, device and capture leaves are Rust in `vulkan_dlss_fg/leaves.rs`) +- [x] [runtime/orchestrator/src/native_fg_dlss_vulkan_capture.cpp](runtime/orchestrator/src/native_fg_dlss_vulkan_capture.cpp) (deleted; the Vulkan, WSI, registration and file leaves are Rust in `dlss_vulkan_capture/leaves.rs`) +- [x] [runtime/orchestrator/src/native_fg_dlss_vulkan_capture.h](runtime/orchestrator/src/native_fg_dlss_vulkan_capture.h) (deleted with its C++ class) +- [x] [runtime/orchestrator/src/native_fg_dlss_vulkan_capture_ledger.h](runtime/orchestrator/src/native_fg_dlss_vulkan_capture_ledger.h) (C declarations only) +- [x] [runtime/orchestrator/src/native_fg_dlss_vulkan_platform.h](runtime/orchestrator/src/native_fg_dlss_vulkan_platform.h) (C declarations only, with the `rsf_dlgvk_sdk` entry record at the start of the native owner) +- [x] [runtime/vulkan/ngx/vulkanstory_ngx.h](runtime/vulkan/ngx/vulkanstory_ngx.h) +- [ ] [runtime/vulkan/streamline/sdk_fg_options_checks.h](runtime/vulkan/streamline/sdk_fg_options_checks.h) (native DLSS-G SDK layout assertions; blocked: `sl_dlss_g.h` declares `sl::DLSSGOptions` and `sl::DLSSGState` with constructors in the `sl::` namespace, C++ only, so the checks need a C++ translation unit; `tests/streamline_selected_device.cpp` now compiles them, covering the Rust leaves' `rsf_slvk_sdk_fg_options` and `rsf_slvk_sdk_fg_state`) **Kept:** included by `tests/streamline_selected_device.cpp:4`; `sl_dlss_g.h` is C++ only. +- [ ] [runtime/vulkan/streamline/sdk_records_checks.h](runtime/vulkan/streamline/sdk_records_checks.h) (native SDK layout assertions; blocked: `sl.h` is C++ only (namespaces, constructors, the virtual `sl::FrameToken`), so the checks need a C++ translation unit; `tests/dlss_sr_layout_facts.cpp` compiles them, now also for the viewport, adapter, Reflex and PCL state, DLSS options and optimal-settings records, result codes and the FrameToken vtable slot) **Kept:** included by `tests/dlss_sr_layout_facts.cpp:16`; `sl.h` is C++ only. +- [x] [runtime/vulkan/streamline/bridge.cpp](runtime/vulkan/streamline/bridge.cpp) (deleted; the `rsf_vk_sl_*` exports and SDK calls are Rust in `lifecycle/src/win32/bridge.rs`; C11 leaves `bridge.c` (injected interposer digest) and `sdk_guard.c` (SEH containment, FrameToken virtual call); `build.ps1` links with gcc in C11) +- [x] [runtime/vulkan/streamline/present-capture.h](runtime/vulkan/streamline/present-capture.h) (C declarations only; unchanged because the corrected SDK receipt pins its hash) +- [ ] [runtime/vulkan/streamline/sdk-fixes/ngx-vulkan-dispatch.h](runtime/vulkan/streamline/sdk-fixes/ngx-vulkan-dispatch.h) (blocked: `prepare.py` copies it into Streamline as `sl.chi/ngxVulkanDispatch.h`, and Streamline's C++ `sl.chi/vulkan.cpp` and `sl.common/commonEntry.cpp` include it and assign its functions to the private `m_ddt` table and the NGX init call; the corrected SDK receipt pins its SHA-256 (`dispatchSha256`), checked by `runtime/orchestrator/CMakeLists.txt`, `build.ps1` and `eng/build-godot.ps1`, so any change needs a coordinated SDK rebuild) **Kept:** copied into Streamline by `runtime/vulkan/streamline/sdk-fixes/prepare.py:84`, included by `tests/streamline_vulkan_dispatch.cpp:4`, SHA-256 checked by `runtime/vulkan/streamline/verify-receipt.cmake:17` and `build-sdk.ps1:30`; it is Streamline's own C++. +- [ ] [runtime/vulkan/streamline/sdk-fixes/prepare.py](runtime/vulkan/streamline/sdk-fixes/prepare.py) (patches the Streamline SDK source; blocked: its edits are C++ inside Streamline's own classes (`sl.chi/vulkan.cpp`, `vknvll2.cpp`, `sl.interposer/vulkan/wrapper.cpp`, `secureLoadLibrary.cpp`), and its hash `patchSha256` pins the corrected SDK receipt) **Kept:** run by `runtime/vulkan/streamline/build-sdk.ps1:105`; its hash is pinned by `verify-receipt.cmake:17`; the edits it applies are Streamline's own C++. +- [ ] [runtime/vulkan/streamline/sdk-fixes/selected-device-config.h](runtime/vulkan/streamline/sdk-fixes/selected-device-config.h) (blocked: Streamline's C++ `wrapper.cpp` includes it and calls `rsf::streamline::selectedAdapterMask` and `deviceConfigApplies` with `sl::AdapterInfo` and `sl::Feature`; `selectedDeviceConfigSha256` pins it in the corrected SDK receipt) **Kept:** injected by `runtime/vulkan/streamline/sdk-fixes/selected_device.py:90`, included by `tests/streamline_selected_device.cpp:2`, hash pinned at `verify-receipt.cmake:20` and `build-sdk.ps1:32`; Streamline's C++ `wrapper.cpp` calls it with `sl::` types. +- [ ] [runtime/vulkan/streamline/sdk-fixes/selected_device.py](runtime/vulkan/streamline/sdk-fixes/selected_device.py) (writes C++ changes to Streamline device selection; blocked: the edits are C++ in Streamline's `wrapper.cpp` and `sl.chi/vulkan.cpp`, and `selectedDevicePatchSha256` pins the corrected SDK receipt) **Kept:** imported by `prepare.py:5` (run at `runtime/vulkan/streamline/build-sdk.ps1:105`), hash computed at `build-sdk.ps1:31` and pinned at `verify-receipt.cmake:19`, covered by `tests/streamline_selected_device_patch_test.py:14`; it writes Streamline's own C++. + +**Fixtures (5)** + +- [x] [runtime/vulkan/streamline/sdk-fixes/dispatch-tests.cpp](runtime/vulkan/streamline/sdk-fixes/dispatch-tests.cpp) (deleted; its first-use layout cases run in `streamline_vulkan_dispatch_contract` from `tests/vulkan-fg/src/streamline_dispatch.rs` through three shims in `tests/streamline_vulkan_dispatch.cpp`) +- [x] [tests/native_dlss_vulkan.cpp](tests/native_dlss_vulkan.cpp) +- [x] [tests/native_fg_dlss_vulkan.cpp](tests/native_fg_dlss_vulkan.cpp) (deleted; the synthetic session, SDK entries and capture tables are Rust in `tests/vulkan-fg/src/dlss/sdk.rs`, with the shared C main and the production `native_fg_dlss_vulkan.c`) +- [ ] [tests/streamline_selected_device.cpp](tests/streamline_selected_device.cpp) (blocked: a 30-line shim that compiles the C++ `selected-device-config.h` above, pinned by the SDK receipt, and the C++-only `sdk_fg_options_checks.h`; the cases are Rust, called through `rsf_fixture_sl_selected_run`) **Kept:** the only source of `rsf_streamline_selected_device_test` (`tests/CMakeLists.txt:698`); it includes the C++ `selected-device-config.h` and `sdk_fg_options_checks.h`. +- [ ] [tests/streamline_vulkan_dispatch.cpp](tests/streamline_vulkan_dispatch.cpp) (blocked: a shim that compiles the C++ `ngx-vulkan-dispatch.h` above, pinned by the SDK receipt; the cases are Rust, called through `rsf_fixture_sl_dispatch_run`) **Kept:** the only source of `rsf_streamline_vulkan_dispatch_test` (`tests/CMakeLists.txt:686`); it includes the C++ `ngx-vulkan-dispatch.h`. + +**Rust review findings (15)** + +- [x] **Altitude | High | Close a native Vulkan capture exactly once on Rust owner allocation failure.** rsf_core_dlss_capture_open passes a fully constructed Owner to allocate_handle. On allocation refusal that helper never moves its argument into the allocation, so normal Rust drop calls Owner::drop and closes native at line 203. The caller then calls ops.close(native) again. Let Owner be the sole cleanup owner once constructed and remove the second close, or allocate uninitialized storage before transferring the handle. [runtime/orchestrator/src/dlss_vulkan_capture.rs:446](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/dlss_vulkan_capture.rs#L446) + +- [x] **Duplication | Medium | Share the common Vulkan FG source-record admission rules.** The DLSS-G record path at :412 and FidelityFX prepare and HUD-less paths at runtime/orchestrator/src/vulkan_ffx_fg.rs:498 and :542 independently validate the same frame ID, camera ABI, extent agreement, frame time, near/far planes, FOV, jitter, and four transforms. FidelityFX additionally checks world_to_view at :417, while DLSS checks the setup motion/depth flags here and FidelityFX checks them only in guides_valid at :464. Extract the overlapping record predicates into vulkan_fg_frames and retain provider-specific matrix and guide requirements at their callers so a camera ABI change has one common admission rule. [runtime/orchestrator/src/vulkan_dlss_fg.rs:366](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dlss_fg.rs#L366) + +- [x] **Quality | Medium | A WSI error during active Vulkan DLSS-G quarantines the owner and the global FG claim for good** present() (lines 617-627) sets slot.inputs = Inputs::Unknown when a Present with FG active is not accepted. That covers VK_ERROR_OUT_OF_DATE_KHR (-1000001004), which a window resize produces, and the case where sample() refuses. Nothing ever moves Unknown back to Retired: Inputs::retire (lines 117-129) returns false for Unknown on every call. record() (lines 439-442) then returns NOT_READY for every later frame mapped to that slot. drain() (lines 685-689) also returns NOT_READY, and it checks retire() only after configure(false) and a successful vkDeviceWaitIdle with an unchanged timeout epoch, by which point no queued input work can still be outstanding. As a result rsf_core_dlgvk_destroy (line 980) never succeeds. The vulkan_dlss_fg Claim and the vulkan_fg.rs PrimaryClaim (OCCUPIED) stay held, so rsf_core_fgvk_create returns NOT_READY for every provider (DLSS, FFX, FSR4, XeSS) for the rest of the process, and the swapchain recreated after the resize gets no FG. owner_tests.rs:326-344 asserts this quarantine (destroy returns NOT_READY after a present_result of -1000001004) and drops the owner by hand. No path is tested in which the device-idle drain retires Unknown inputs. [runtime/orchestrator/src/vulkan_dlss_fg.rs:626](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dlss_fg.rs#L626) + +- [x] **Duplication | Medium | Generate both views of the NGX entry table from one declaration.** Rust resolves and publishes twelve opaque addresses in NgxEntries at :59 and :87. The native shim independently repeats all twelve fields at runtime/vulkan/ngx/vulkanstory_ngx.c:31 and casts them to different function signatures when called, for example CreateFeature1 at :413. A same-sized field reorder on one side still compiles and can dispatch the wrong SDK function. Give the private table one header definition and generate/include its Rust layout, retaining the nullable optional entries and native call wrappers. [runtime/vulkan/ngx/src/lib.rs:10](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/ngx/src/lib.rs#L10) + +- [x] **Altitude | Medium | Return the acquired Streamline frame token with the begin result.** LatencySession.cs:160-164 calls BeginFrame and then CurrentFrameToken to associate a frame ID with an SDK token. begin releases its acquisition lease before that second FFI call, so another successful begin can replace the global current pointer in between. Return the newly acquired token from the checked begin operation and store it against the requesting frame immediately, keeping the legacy getter only for compatibility. [runtime/vulkan/streamline/lifecycle/src/frame_token.rs:77](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/streamline/lifecycle/src/frame_token.rs#L77) + +- [x] **Altitude | Medium | Check the requested Streamline configuration before reporting an initialized session.** VulkanStorySlInitializeFeatures takes a plugin directory, project ID and requested features. The initialized fast path returns success before reading any of them. A PCL-only session thus reports successful DLSS-G initialization without loading DLSS-G, and a different project is likewise silently accepted. Store the effective initialization tuple and return success only for compatible requests, or explicitly report the active configuration. [runtime/vulkan/streamline/lifecycle/src/lifecycle.rs:241](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/streamline/lifecycle/src/lifecycle.rs#L241) + +- [x] **Altitude | Medium | Return a checked outcome when the Streamline interposer cannot unload.** Lifecycle::unload silently returns when the session is busy, including the condition covered by overlapping_lifecycle_call_is_refused_without_waiting. Through VulkanStorySlUnload the managed Dispose still frees the bridge library, clears its teardown ledger and marks itself disposed. Return BUSY or the retained shutdown error through a checked unload export and keep the bridge and disposal state until unloading succeeds. [runtime/vulkan/streamline/lifecycle/src/lifecycle.rs:348](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/streamline/lifecycle/src/lifecycle.rs#L348) + +- [x] **Simplicity | Low | Import the five Vulkan FG resource functions from their Rust owner.** The DLSS-G owner redeclares five functions as foreign symbols and passes a raw platform-table pointer each time it creates or releases images or handles fence submission. All five definitions already have pub(super) visibility in vulkan_fg_resources.rs and take a platform reference. Import the definitions, obtain a valid reference to the GPU table at admission, and keep the existing exported symbols for native callers. This requires checking the table once and lets Rust check future signature changes at the DLSS-G call sites. [runtime/orchestrator/src/vulkan_dlss_fg.rs:48](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dlss_fg.rs#L48) + +- [x] **Duplication | Low | Share the bounded swapchain-image enumeration used by Vulkan FG providers.** The DLSS-G images export and the FidelityFX owner at runtime/orchestrator/src/vulkan_ffx_fg.rs:468 (called by its public images route at :954) separately query the available count, clamp caller capacity, fill the array, reject overreported writes, and return VK_INCOMPLETE for a short buffer. Different SDK proxy quirks need the same protection against exposing uninitialized tail handles. Extract the bounded enumeration once, accepting a closure that captures each native chain and preserves its result codes, and exercise count-only, query failure, short, oversized, and overreported fills against it. [runtime/orchestrator/src/vulkan_dlss_fg.rs:825](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dlss_fg.rs#L825) + +- [x] **Duplication | Low | Reuse the atomic ownership guard across Vulkan singleton owners.** The SR creator at :249 takes an atomic flag and stores a guard that releases it on Drop. Vulkan DLSS-G repeats the compare-exchange, orderings and destructor at runtime/orchestrator/src/vulkan_dlss_fg.rs:88 for its creator at :760, and the FG dispatcher repeats them at runtime/orchestrator/src/vulkan_fg.rs:31 for :175. Keep each independent ownership flag but have one guard borrow the selected static AtomicBool, so failed construction and successful destruction use one release mechanism. [runtime/orchestrator/src/vulkan_dlss_sr.rs:24](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dlss_sr.rs#L24) + +- [x] **Duplication | Low | Share the Vulkan SR capture input names and resource mapping.** After evaluation DLSS and XeSS at runtime/orchestrator/src/vulkan_sr/xess.rs:583 emit the same color texture twice as sr-source-jittered and sr-linear-color, then the depth and motion inputs under the same two role strings. FSR4 repeats the same four mappings before its external-queue copy at runtime/orchestrator/src/vulkan_fsr4_sr.rs:250. These names identify resources in cross-backend dumps. Provide a shared iterator over the four (source image, role) pairs while preserving each caller's stage, reset semantics, and the optional DLSS bias mask. [runtime/orchestrator/src/vulkan_dlss_sr.rs:208](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dlss_sr.rs#L208) + +- [x] **Duplication | Low | Construct Streamline Vulkan worker calls from one frame-identity helper.** DLSS SR evaluation writes both token IDs from the frame while effect release at :111 writes both as zero. DLSS-G already constructs the same versioned rsf_slvk_call from an optional record at runtime/orchestrator/src/vulkan_dlss_fg.rs:201, for feature calls at :330 and recording at :499. Move that construction beside the call ABI and pass the platform-specific invoke function separately, so all SDK operations propagate version, callback context and optional token identity consistently. [runtime/orchestrator/src/vulkan_dlss_sr.rs:307](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dlss_sr.rs#L307) + +- [x] **Duplication | Low | Route Vulkan DLSS preset changes through the production preset validator.** The runtime preset setter at runtime/orchestrator/src/vulkan_sr.rs:973 reaches an independent literal allowlist here before releasing the current effect. Native D3D12 startup at runtime/backends/dlss/src/dlss_native12.cpp:368 and callback-host settings at runtime/orchestrator/src/callback_host.rs:615 use the common SDK policy in runtime/backends/dlss/include/rescaleframe/dlss_preset.h:7. An SDK model-list update can consequently make a setting accepted by the overlay unusable on Vulkan. Bind the same production predicate into the Vulkan setter or generate both from a single model list. [runtime/orchestrator/src/vulkan_dlss_sr.rs:319](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_dlss_sr.rs#L319) + +- [x] **Boundaries | Low | Rename the game-named Vulkan provider exports under runtime/vulkan.** The Vulkan provider owners are generic vendor code (NGX, FidelityFX, XeSS-FG, Streamline), but their C ABI is named after one game: rsf_vulkanstory_ngx_get_entries/rsf_vulkanstory_ngx_load_error here, the VulkanStoryFsr3*/VulkanStoryFsr4* records mirrored in runtime/vulkan/fsr3/owner.rs:90-167 and fsr4/owner.rs:119, the VulkanStoryXessFrame record in xess-fg/session.rs:29, and the VulkanStorySl* exports that streamline/lifecycle/src/lifecycle.rs:18 serves through bridge.cpp. AGENTS.md Rule 1 places game-named control entry points in the integration, not the runtime, and says an existing violation is not a pattern to follow; runtime/vulkan/README.md keeps the names only as compatibility ABI for the VulkanStory host. A second Vulkan integration would have to call VulkanStory-named functions or fork the bridges. Publish neutral rsf_vk_* names (the rsf_core_* Rust exports already are) and keep any VulkanStory aliases in that host or a thin compatibility shim owned by its integration. [runtime/vulkan/ngx/src/lib.rs:87](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/ngx/src/lib.rs#L87) + +- [x] **Simplicity | Low | Store the sticky Streamline shutdown result as one optional value.** Session maintains shutdown_attempted and shutdown_result separately. Initialization and unload test both, shutdown returns the prior result on repeat, and successful initialization resets both fields. Use Option for the attempt result. Reserve Some(0) before invoking the native callback under the session lock and overwrite it with the SDK result if called. None then means no attempt, Some(0) allows reinitialization, and a nonzero result keeps the module resident. The published initialized bit remains necessary for the lock-free API. [runtime/vulkan/streamline/lifecycle/src/lifecycle.rs:100](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/streamline/lifecycle/src/lifecycle.rs#L100) + +- **Withdrawn after review (Altitude).** Vulkan DLSS SR staging initialization at recording time follows the caller contract. On failure the caller must submit that command buffer in recording order or retire the context before reuse. [Caller contract, lines 73–75](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/include/rescaleframe/native_sr_vulkan.h#L73) + + + +### V05 · FidelityFX Vulkan bridges + +Port the FSR3 and FSR4 bridge owners, private ABI and SDK patch payloads alongside their state fixtures. + +**Coordinate shared edits** + +- Capture publication after a submitted command or queue is retired ([G07](#g07), [V02](#v02), [V04](#v04), [V06](#v06)). +- Shared Vulkan resource state, provider selection and queue retirement ([V01](#v01), [V02](#v02), [V03](#v03), [V04](#v04), [V06](#v06)). + +**Port files (22)** + +- [x] [runtime/orchestrator/src/native_fg_fsr4_vulkan.cpp](runtime/orchestrator/src/native_fg_fsr4_vulkan.cpp) (removed; `vulkan_fsr4_fg.rs` builds the production table and exports the probe and create entries) +- [x] [runtime/orchestrator/src/native_fg_fsr4_vulkan.h](runtime/orchestrator/src/native_fg_fsr4_vulkan.h) +- [x] [runtime/orchestrator/src/native_fg_fsr4_vulkan_platform.h](runtime/orchestrator/src/native_fg_fsr4_vulkan_platform.h) (C declarations only; it includes V03's `native_fg_dx12_vulkan_platform.h` for the importer and graphics records) +- [x] [runtime/orchestrator/src/native_sr_fsr4_vulkan.cpp](runtime/orchestrator/src/native_sr_fsr4_vulkan.cpp) (converted to the C11 leaf `native_sr_fsr4_vulkan.c`, which keeps SEH containment of host and SDK C++ exceptions) +- [x] [runtime/orchestrator/src/native_sr_fsr4_vulkan.h](runtime/orchestrator/src/native_sr_fsr4_vulkan.h) +- [x] [runtime/orchestrator/src/native_sr_fsr4_vulkan_platform.h](runtime/orchestrator/src/native_sr_fsr4_vulkan_platform.h) +- [x] [runtime/vulkan/fsr3/bridge.cpp](runtime/vulkan/fsr3/bridge.cpp) +- [x] [runtime/vulkan/fsr3/bridge_platform.h](runtime/vulkan/fsr3/bridge_platform.h) +- [ ] [runtime/vulkan/fsr3/sdk-fixes/descriptor-pool-size.json](runtime/vulkan/fsr3/sdk-fixes/descriptor-pool-size.json) (C++ edits applied to the FidelityFX SDK). Blocked: `runtime/vulkan/fsr3/build-sdk.ps1` applies it to the pinned FidelityFX Vulkan SDK sources (`c6efa6bf`) before building `amd_fidelityfx_vk.dll`, so the correction changes the vendor's own C++ and has no first-party translation unit to port (`sdk/src/backends/vk/ffx_vk.cpp` global descriptor pool). **Kept:** applied by `runtime/vulkan/fsr3/build-sdk.ps1:53` (listed at `eng/build-godot-vulkan.ps1:57`); vendor C++. +- [ ] [runtime/vulkan/fsr3/sdk-fixes/line-width.json](runtime/vulkan/fsr3/sdk-fixes/line-width.json) (C++ edits applied to the FidelityFX SDK). Blocked: `runtime/vulkan/fsr3/build-sdk.ps1` applies it to the pinned FidelityFX Vulkan SDK sources (`c6efa6bf`) before building `amd_fidelityfx_vk.dll`, so the correction changes the vendor's own C++ and has no first-party translation unit to port (pipeline state in `FrameInterpolationSwapchainVK_DebugPacing.cpp` and `_UiComposition.cpp`). **Kept:** applied by `runtime/vulkan/fsr3/build-sdk.ps1:39` (listed at `eng/build-godot-vulkan.ps1:57`); vendor C++. +- [ ] [runtime/vulkan/fsr3/sdk-fixes/presenter-cpu-drain.json](runtime/vulkan/fsr3/sdk-fixes/presenter-cpu-drain.json) (C++ edits applied to the FidelityFX SDK). Blocked: `runtime/vulkan/fsr3/build-sdk.ps1` applies it to the pinned FidelityFX Vulkan SDK sources (`c6efa6bf`) before building `amd_fidelityfx_vk.dll`, so the correction changes the vendor's own C++ and has no first-party translation unit to port (presenter thread state and `waitForPresents` in `FrameInterpolationSwapchainVK.h` and `.cpp`). **Kept:** applied by `runtime/vulkan/fsr3/build-sdk.ps1:57` (listed at `eng/build-godot-vulkan.ps1:57`); vendor C++. +- [ ] [runtime/vulkan/fsr3/sdk-fixes/swapchain-lifetime.json](runtime/vulkan/fsr3/sdk-fixes/swapchain-lifetime.json) (C++ edits applied to the FidelityFX SDK). Blocked: `runtime/vulkan/fsr3/build-sdk.ps1` applies it to the pinned FidelityFX Vulkan SDK sources (`c6efa6bf`) before building `amd_fidelityfx_vk.dll`, so the correction changes the vendor's own C++ and has no first-party translation unit to port (swapchain, semaphore and UI composition lifetimes in `FrameInterpolationSwapchainVK*.cpp`). Its WSI call sites now use the C entries of `wsi-dispatch.h`. **Kept:** applied by `runtime/vulkan/fsr3/build-sdk.ps1:45` (listed at `eng/build-godot-vulkan.ps1:57`); vendor C++. +- [ ] [runtime/vulkan/fsr3/sdk-fixes/swapchain-trace.h](runtime/vulkan/fsr3/sdk-fixes/swapchain-trace.h). Blocked: `build-sdk.ps1 -SwapchainTrace` copies it into the pinned SDK as `rsf-swapchain-trace.h`, compiled only inside the vendor C++ units that `swapchain-trace.json` instruments. Its RAII `Frame`/`Scope` objects and `call()` lambda wrapper close a row on every return path of those vendor functions; a C form needs an explicit finish at each vendor exit. **Kept:** copied by `runtime/vulkan/fsr3/build-sdk.ps1:64,183` and hashed at `eng/build-godot.ps1:96`; compiled only inside the vendor C++ units. +- [ ] [runtime/vulkan/fsr3/sdk-fixes/swapchain-trace.json](runtime/vulkan/fsr3/sdk-fixes/swapchain-trace.json) (C++ edits applied to the FidelityFX SDK). Blocked: `runtime/vulkan/fsr3/build-sdk.ps1` applies it to the pinned FidelityFX Vulkan SDK sources (`c6efa6bf`) before building `amd_fidelityfx_vk.dll`, so the correction changes the vendor's own C++ and has no first-party translation unit to port (optional `-SwapchainTrace` diagnostics in `FrameInterpolationSwapchainVK*.cpp`). **Kept:** applied by `runtime/vulkan/fsr3/build-sdk.ps1:61` (listed at `eng/build-godot-vulkan.ps1:57`) with `-SwapchainTrace`; vendor C++. +- [x] [runtime/vulkan/fsr3/wsi-dispatch.h](runtime/vulkan/fsr3/wsi-dispatch.h) (C declarations plus a C11 implementation section, compiled inside the corrected SDK unit and the WSI fixture) +- [x] [runtime/vulkan/fsr4-fg/bridge.cpp](runtime/vulkan/fsr4-fg/bridge.cpp) (ported to `runtime/vulkan/fsr4-fg/native.rs`) +- [x] [runtime/vulkan/fsr4-fg/bridge_api.h](runtime/vulkan/fsr4-fg/bridge_api.h) +- [x] [runtime/vulkan/fsr4-fg/bridge_contract.h](runtime/vulkan/fsr4-fg/bridge_contract.h) +- [x] [runtime/vulkan/fsr4-fg/bridge_platform.h](runtime/vulkan/fsr4-fg/bridge_platform.h) (removed; Rust owns both sides of the private table) +- [x] [runtime/vulkan/fsr4/bridge.cpp](runtime/vulkan/fsr4/bridge.cpp) (ported to `runtime/vulkan/fsr4/native.rs`; the standalone DLL links only Rust and MinHook) +- [x] [runtime/vulkan/fsr4/bridge_api.h](runtime/vulkan/fsr4/bridge_api.h) +- [x] [runtime/vulkan/fsr4/bridge_platform.h](runtime/vulkan/fsr4/bridge_platform.h) (removed; Rust owns both sides of the private table) + +**Fixtures (5)** + +- [x] [tests/native_fsr4_fg_bridge.cpp](tests/native_fsr4_fg_bridge.cpp) +- [x] [tests/native_fsr4_fg_contract.cpp](tests/native_fsr4_fg_contract.cpp) +- [x] [tests/native_fsr4_fg_state.cpp](tests/native_fsr4_fg_state.cpp) +- [x] [tests/native_sr_fsr4_state.cpp](tests/native_sr_fsr4_state.cpp) +- [x] [tests/native_sr_fsr4_vulkan.cpp](tests/native_sr_fsr4_vulkan.cpp) + +**Rust review findings (13)** + +- [x] **Duplication | Medium | Compute DXGI present-count deltas the same way on both FSR paths.** The Vulkan/D3D12 FSR4 bridge always subtracts the previous count with wrapping arithmetic, while the D3D12 generation owner at runtime/orchestrator/src/d3d12_generation/fsr.rs:684 distinguishes a low-valued counter reset from a rollover. Both native callbacks read IDXGISwapChain::GetLastPresentCount (runtime/vulkan/fsr4-fg/bridge.cpp:340 and runtime/backends/fsr/src/fsr_generation.cpp:287). A decrease from 100 to 1 therefore reports over four billion presents on the bridge and one on the D3D12 path. Use one tested delta function with explicit reset and rollover cases when publishing presentation statistics. [runtime/orchestrator/src/fsr4_fg_bridge.rs:653](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fsr4_fg_bridge.rs#L653) + +- [x] **Duplication | Medium | Share the external-image input copy sequence between Vulkan SR and FG.** FSR4 SR emits producer-to-transfer-source, discard-or-acquire shared target, copy, restore producer and release target to external GENERAL. Vulkan-to-DX12 FG builds the same five steps in runtime/orchestrator/src/vulkan_dx12_fg.rs:384 for prepare at :978 and HUD-less at :1012. SR computes access/family masks separately in runtime/orchestrator/src/native_sr_fsr4_vulkan.cpp:105, while FG qualifies the transfer for a format-converting blit and uses equal families for the first target barrier. Use one tested planner for these external copies, retaining explicit format-conversion and first-use family choices and leaving SR output continuation separate. [runtime/orchestrator/src/vulkan_fsr4_sr.rs:258](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_fsr4_sr.rs#L258) + +- [x] **Altitude | Medium | Reset FSR4 SR history across a missing source and record the decision once.** The split owner accepts any frame_id greater than last_frame but derives dispatch.reset only from history.valid, the explicit reset flag and resource generation. If a frame is skipped without an explicit reset, the SDK reuses older history as consecutive. record_inputs also writes only the incoming flag, so captures can disagree with the first-frame or generation-change reset sent to the SDK. Compute one continuity decision against the last successful source and use it for input captures, SDK dispatch and output metadata. [runtime/orchestrator/src/vulkan_fsr4_sr.rs:373](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_fsr4_sr.rs#L373) + +- [x] **Altitude | Medium | Retain the standalone FSR3 swapchain when creation rollback refuses destruction.** After wsi_create succeeds, a failed replacement-function query or incomplete table calls wsi_destroy and discards its result before wsi_release frees the capsule. The explicit destroy operation keeps that same capsule on failure. Preserve a cleanup owner or return a documented retry handle on this constructor path, and exercise a failed rollback in the fake platform. [runtime/vulkan/fsr3/owner.rs:673](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/fsr3/owner.rs#L673) + +- [x] **Altitude | Medium | Retire the old interpolation link before replacing an FSR3 swapchain.** Fsr3SwapchainRuntime.Recreate forwards directly to this operation. It replaces the swapchain's handle while the paired FgContext still refers to the old chain. The in-file fixture demonstrates that disable and destroy then refuse until another frame evaluates, so closing immediately after resize has no cleanup path. Disable, drain and unlink the old pair before recreation, or keep both generations explicitly retireable. [runtime/vulkan/fsr3/owner.rs:710](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/fsr3/owner.rs#L710) + +- [x] **Duplication | Medium | Avoid a second wait for the same standalone FSR3 present queue during retirement.** For a matching linked chain, prepare_destroy calls fg_disable at :808, which waits for queued presents at :1014 and clears UI registration. prepare_destroy then issues the same wait again at :813; full destruction at :883 and :888 repeats this sequence. The in-file fixture at :1942 explicitly expects both calls, and runtime/vulkan/fsr3/bridge.cpp:229 dispatches the SDK WaitForPresents operation for each. Return a drained-chain result from the checked unlink operation and reuse it within the serialized retirement attempt, retaining the independent wait when no matching chain was drained. [runtime/vulkan/fsr3/owner.rs:813](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/fsr3/owner.rs#L813) + +- [x] **Altitude | Medium | Enforce exclusive interpolation ownership on both sides of the FSR3 pairing.** Proxy evaluation checks the incoming FgContext's former swapchain but unconditionally overwrites the destination swapchain's active_fg. Two independently created FG contexts can therefore both retain the same swapchain pointer. Retiring the presenter unlinks only the last context, leaving the first with a dangling owner for fg_disable. Reject an occupied destination or retire its existing context before installing the new pair, and exercise two contexts in the fixture. [runtime/vulkan/fsr3/owner.rs:1103](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/fsr3/owner.rs#L1103) + +- [x] **Duplication | Medium | Generate the FSR4 SR bridge call records for both Rust owners.** The standalone SR bridge hand-declares BridgeCreate, BridgeFrame and BridgeInfo at :68, :84 and :110 and consumes them in create, evaluate and info at :774, :968 and :822. Across the same C ABI the orchestrator sends the generated layouts from runtime/orchestrator/src/vulkan_fsr4_sr_abi.rs:13, :60 and :143 through runtime/orchestrator/src/vulkan_fsr4_sr.rs:98 and :424. The standalone assertions at :226 check only selected offsets, so a same-size field swap can survive there. Generate the three dependency-free records in one include usable by both builds and keep the different legacy managed frame local. [runtime/vulkan/fsr4/owner.rs:68](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/fsr4/owner.rs#L68) + +- [x] **Altitude | Low | Populate the FSR4 Present status from every outcome of the bridge operation.** rsf_core_fsr4fg_present initializes status.result to success and Bridge::present fills it only after the normal submission path. Validation, wait, command recording and terminal failures therefore return an error alongside a status claiming success. vulkan_fsr4_fg.rs:289 passes both results onward and vulkan_dx12_fg.rs:1235 reconstructs the failure by preferring the return code. Finalize the valid status structure in the bridge entry point on all exits so direct bridge callers receive a coherent snapshot. [runtime/orchestrator/src/fsr4_fg_bridge.rs:923](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/fsr4_fg_bridge.rs#L923) + +- [x] **Duplication | Low | Convert FidelityFX runtime directories once for the Vulkan bridge owners.** Both FG probe and create (:73 and :127) reserve a 32768-unit stack buffer and call the conversion leaf at runtime/orchestrator/src/native_fg_fsr4_vulkan.cpp:11. SR create at runtime/orchestrator/src/vulkan_fsr4_sr.rs:479 instead validates UTF-8, reserves an owned vector, encodes UTF-16 and appends NUL for the same bridge input. Use one fallible helper producing an owned terminated UTF-16 directory, specify the shared length and empty-path contract, and map allocation and invalid-input errors at each public API. FG's 64-KiB stack buffers and conversion-only native callback can then be removed. [runtime/orchestrator/src/vulkan_fsr4_fg.rs:73](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_fsr4_fg.rs#L73) + +- [x] **Simplicity | Low | Use SDK binding presence to admit standalone FSR3 operations.** open stores the process-wide SDK exactly once, after all five exports resolve. swapchain_create still probes three separate fields of the all-null fallback, and fg_destroy documents an unreachable missing-destroy branch for a live context. Keep the fallback at rsf_core_fsr3_sdk for its native callers, use SDK.get() once in operations available before open, and use the bound table for live owners. Preserve the existing null-argument return codes and native has-context/has-effect checks. This makes the all-or-none invariant explicit without changing the C table layout. [runtime/vulkan/fsr3/owner.rs:612](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/fsr3/owner.rs#L612) + +- [x] **Duplication | Low | Allocate D3D12 local completion values consistently in the FSR4 bridges.** The FSR4 SR bridge increments its local fence after submitting GPU work at :659 and again on the recovery path at :695, then treats UINT64_MAX as device removal when waiting at :492. Its FG counterpart at runtime/orchestrator/src/fsr4_fg_bridge.rs:445 explicitly refuses that reserved value before signalling. Share a checked local completion-value allocator across the two bridges and use it on normal and recovery signals, leaving their separate shared-fence ordering and error-retention policies intact. [runtime/vulkan/fsr4/owner.rs:659](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/fsr4/owner.rs#L659) + +- [x] **Simplicity | Low | Build the FSR4 dispatch directly from the caller frame.** The public evaluation copies textures, dimensions, camera and fence values into LegacyFrame, passes motion scale and pre-exposure separately, then submit copies them again into Dispatch. Let each ABI entry construct the dispatch plus ready/done values once, and have the shared submit step fill slot and sharpness after allocator admission. Preserve public zero-far conversion, legacy delta and exposure defaults, and the recovery signal on refusal. This keeps two small input conversions at the ABI boundary and removes a temporary record from every public evaluation. [runtime/vulkan/fsr4/owner.rs:987](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/fsr4/owner.rs#L987) + + + +### V06 · XeSS Vulkan bridges + +Port XeSS Vulkan requirements, frame generation and present/capture handling for the integrated and standalone bridge. + +**Coordinate shared edits** + +- Capture publication after a submitted command or queue is retired ([G07](#g07), [V02](#v02), [V04](#v04), [V05](#v05)). +- Shared Vulkan resource state, provider selection and queue retirement ([V01](#v01), [V02](#v02), [V03](#v03), [V04](#v04), [V05](#v05)). + +**Port files (12)** + +- [x] [runtime/orchestrator/include/rescaleframe/native_xess_vulkan_requirements.h](runtime/orchestrator/include/rescaleframe/native_xess_vulkan_requirements.h) +- [x] [runtime/orchestrator/src/native_fg_xess_vulkan.cpp](runtime/orchestrator/src/native_fg_xess_vulkan.cpp) (converted to the C11 leaf `native_fg_xess_vulkan.c`; Rust selects the V03 importer, see [rust-vulkan-xess-fg-v06.md](docs/research/rust-vulkan-xess-fg-v06.md)) +- [x] [runtime/orchestrator/src/native_fg_xess_vulkan.h](runtime/orchestrator/src/native_fg_xess_vulkan.h) +- [x] [runtime/orchestrator/src/native_fg_xess_vulkan_platform.h](runtime/orchestrator/src/native_fg_xess_vulkan_platform.h) (C declarations only) +- [x] [runtime/orchestrator/src/native_fg_xess_vulkan_present.cpp](runtime/orchestrator/src/native_fg_xess_vulkan_present.cpp) (converted to the C11 leaf `native_fg_xess_vulkan_present.c`: bridge exports and the public dispatch seam) +- [x] [runtime/orchestrator/src/native_xess_vulkan.cpp](runtime/orchestrator/src/native_xess_vulkan.cpp) (ported to `vulkan_sr/xess/native.rs`; the C11 leaf `native_xess_vulkan.c` keeps the public exports, SDK selection and SDK layout assertions) +- [x] [runtime/orchestrator/src/native_xess_vulkan.h](runtime/orchestrator/src/native_xess_vulkan.h) (C declarations only) +- [x] [runtime/vulkan/xess-fg/bridge.cpp](runtime/vulkan/xess-fg/bridge.cpp) (converted to the C11 leaf `bridge.c` for the integrated and standalone builds; the standalone MinGW DLL links `session.rs` without crates, so its COM calls stay native) +- [x] [runtime/vulkan/xess-fg/bridge_api.h](runtime/vulkan/xess-fg/bridge_api.h) +- [x] [runtime/vulkan/xess-fg/capture_api.h](runtime/vulkan/xess-fg/capture_api.h) +- [x] [runtime/vulkan/xess-fg/diagnostic-capture.h](runtime/vulkan/xess-fg/diagnostic-capture.h) (C declarations only; callbacks and readback leaves moved into `bridge.c`) +- [x] [runtime/vulkan/xess-fg/session_abi.h](runtime/vulkan/xess-fg/session_abi.h) (C declarations only) + +**Fixtures (3)** + +- [x] [tests/native_fg_xess_vulkan_interop.cpp](tests/native_fg_xess_vulkan_interop.cpp) +- [x] [tests/native_fg_xess_vulkan_present.cpp](tests/native_fg_xess_vulkan_present.cpp) +- [x] [tests/native_xess_vulkan.cpp](tests/native_xess_vulkan.cpp) (ported to `tests/vulkan-fg/src/xess_input_range.rs` with the C11 CPU launcher) + +**Rust review findings (7)** + +- [x] **Duplication | Medium | Share the public XeSS FG Present record and status between Rust producer and consumer.** XessSubmission::present at :450 fills BridgeFrame and reads BridgeStatus. The selected callback at runtime/orchestrator/src/native_fg_xess_vulkan_present.cpp:20 forwards both unchanged at runtime/vulkan/xess-fg/bridge.cpp:943 to runtime/vulkan/xess-fg/session.rs:950, which decodes separate manual IntegratedFrame and IntegratedStatus declarations at :60 and :118. Both sides maintain the same matrices, resources, fence ordering and result fields from runtime/vulkan/xess-fg/bridge_api.h:35. Generate these two public records once for both Rust builds and retain the conversion to the distinct legacy frame with its extra UI resource. [runtime/orchestrator/src/vulkan_xess_fg.rs:54](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/orchestrator/src/vulkan_xess_fg.rs#L54) + +- [x] **Duplication | Medium | Use the generated GameSDK frame layout for XeSS diagnostic capture.** Capture::source at :327 copies a hand-written 480-byte frame layout with seven unnamed identity words and a 420-byte tail. RsfXessBridgeCaptureSource at runtime/vulkan/xess-fg/bridge.cpp:472 passes the actual GameSDK struct generated at sdk/game/src/lib.rs:157, and native publication expects that complete struct inside the readback record at runtime/vulkan/xess-fg/diagnostic-capture.h:33. Extract a dependency-free generated frame/camera binding for both builds or generate this projection from the header, preserving opaque padding while removing hand-maintained field positions and tail size. [runtime/vulkan/xess-fg/capture.rs:50](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/xess-fg/capture.rs#L50) + +- [x] **Boundaries | Medium | Give environment-only diagnostic options overlay controls.** AGENTS.md Rule 2 requires every option the runtime or an integration reads, diagnostic ones included, to have a live overlay control that saves it. These Rust owners read options only from process environment variables at construction and expose no overlay-service option: XeSS-FG capture reads RSF_VULKAN_FRAME_CAPTURE_DIR, RSF_FRAME_CAPTURE_FIRST, RSF_FRAME_CAPTURE_COUNT and RSF_XESS_DIAGNOSTIC_PROBE (capture.rs:242-257); the shared capture config reads the same first/count pair (runtime/orchestrator/src/frame_capture_vk.rs:131-141); D3D12 capture reads RSF_FRAME_CAPTURE_DIR and RSF_FRAME_CAPTURE_RESET_SR (runtime/orchestrator/src/frame_capture12.rs:122-126); Vulkan timing reads RSF_VULKAN_TIMING_FILE (runtime/orchestrator/src/vulkan_timing.rs:101); AC7 reads RSF_AC7_PIXEL_DIAGNOSTICS (games/ac7/src/renderer.rs:84). Each requires restarting the game with a changed environment to try, which Rule 2 exists to avoid, and none appears in the panel. Move these into the shared settings store and declare them through the overlay service (runtime-owned ones as runtime options, the AC7 flag as an adapter host option), with a restart-required flag where an owner truly reads once, and keep the environment only as an override if still needed. [runtime/vulkan/xess-fg/capture.rs:242](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/xess-fg/capture.rs#L242) + +- [x] **Duplication | Medium | Use one timeline-pair admission rule before queuing a failed bridge handoff.** Legacy XeSS Present at runtime/vulkan/xess-fg/bridge.cpp:939 reaches present_frame, which rejects ready == 0 at session.rs:619, yet the separate recovery guard at :715 accepts ready=0 and a fresh positive done. recover_handoff then queues a wait for zero and signals that done value despite lacking producer readiness. The FSR4 SR recovery at runtime/vulkan/fsr4/owner.rs:681 and FG handoff at runtime/orchestrator/src/fsr4_fg_bridge.rs:462 both reject zero ready explicitly. Extract a checked recovery-pair predicate and use it across the bridges, preserving their own error codes and valid failed-frame release paths. [runtime/vulkan/xess-fg/session.rs:715](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/xess-fg/session.rs#L715) + +- [x] **Altitude | Medium | Attach XeSS timing samples and denominators to their presenting session.** Sessions and the native GPU callback accumulate into one static batch, which survives destruction or recreation. Present phases are recorded before handoff, ID, Present and status errors are returned, but end_present increments the denominator only on success. Failed work therefore raises the next successful batch's average, potentially in a different session. Pass a session-owned timing accumulator to the callback and count each phase's accepted samples, or commit a complete per-frame measurement with its result. [runtime/vulkan/xess-fg/timing.rs:140](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/xess-fg/timing.rs#L140) + +- [x] **Simplicity | Low | Read each XeSS capture setting independently.** read_variable returns true for 32 or more UTF-16 units without changing the buffer. Config reuses that buffer for first frame, count and probe. For example, a count of 1 followed by an overlong probe setting enables probe-only mode and suppresses readbacks. Return an optional bounded value per lookup, preserving the numeric parser, count clamp and exact probe match for supported inputs. Treat oversized values like missing values so each setting uses its own default. This removes dependence on the preceding setting and changes only malformed-input handling. [runtime/vulkan/xess-fg/capture.rs:249](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/xess-fg/capture.rs#L249) + +- [x] **Simplicity | Low | Describe an aliased HUD-less fallback texture once.** The shared Vulkan presenter passes buffer.shared.dx12_resource for both color and HUD-less when generation is disabled. present_resources_match describes each separately to compare it to the same expected BGRA8 extent; record_present_inputs already handles the alias when issuing transitions. Validate color once, then accept HUD-less immediately on pointer equality or describe and validate it when distinct. One pointer comparison removes a repeated native texture query on pass-through frames without changing the resource-role tags. [runtime/vulkan/xess-fg/session.rs:531](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/runtime/vulkan/xess-fg/session.rs#L531) + +## Games + + + +### A01 · AC7 carrier and renderer lifecycle + +Port startup, renderer admission and retirement, including how a refused install is reported. + +**Coordinate shared edits** + +- Carrier entry, game recognition and existing forwarding exports ([L01](#l01), [W01](#w01)). + +**Port files (8)** + +- [x] [games/ac7/include/rescaleframe/ac7_carrier.h](games/ac7/include/rescaleframe/ac7_carrier.h) +- [x] [games/ac7/include/rescaleframe/ac7_hooks.h](games/ac7/include/rescaleframe/ac7_hooks.h) +- [x] [games/ac7/include/rescaleframe/ac7_memory.h](games/ac7/include/rescaleframe/ac7_memory.h) +- [x] [games/ac7/include/rescaleframe/ac7_native_renderer.h](games/ac7/include/rescaleframe/ac7_native_renderer.h) +- [x] [games/ac7/src/ac7_platform.h](games/ac7/src/ac7_platform.h) +- [x] [games/ac7/src/ac7_sites.h](games/ac7/src/ac7_sites.h) +- [x] [games/ac7/src/native_renderer.cpp](games/ac7/src/native_renderer.cpp) (Rust `native_renderer.rs` and `native_renderer/`; C11 leaf `native_renderer_platform.c`) +- [x] [games/ac7/src/plugin.cpp](games/ac7/src/plugin.cpp) + +**Fixtures (2)** + +- [x] [tests/ac7_native_graph.cpp](tests/ac7_native_graph.cpp) (Rust `tests/ac7_native_graph.rs`, C11 launcher `tests/ac7_native_graph.c`) +- [x] [tests/ac7_session.cpp](tests/ac7_session.cpp) + +**Rust review findings (9)** + +- [x] **Boundaries | Medium | Expose the AC7 carrier's startup toggles as adapter host options.** rsf_ac7_carrier_install_decrypted reads RSF_ENABLE_JITTER, RSF_JITTER_RVA, RSF_JITTER_ALL_VIEWS, RSF_TRANSLUCENT_VELOCITY(_RVA), RSF_FULL_TRANSLUCENCY(_RVA) and RSF_MOTION_CAPTURE (carrier.rs:278-316), and rsf_ac7_carrier_override_start_extent reads RSF_DLSS_OUTPUT_WIDTH/HEIGHT (:367-379), through the proxy's read_number, which only consults the process environment and the proxy INI (loader/proxy/src/dinput8_proxy.c:241-280). They are read once when the decrypted image is installed and are not published as AC7 host options, so the overlay neither shows nor saves them. AGENTS.md Rule 2 requires every option an integration reads to have a live overlay control declared through the overlay service host_options. Declare these as AC7 adapter host options (flagged restart-required where a patch is only applied at install) and persist them through the shared settings store; keep the RVA overrides as developer-only if they must remain. [games/ac7/src/carrier.rs:278](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/carrier.rs#L278) + +- [x] **Altitude | Medium | Pass the admitted Present extent into automatic startup.** on_present passes rsf_bridge_present_extent to try_auto_start. Rust reads the dimensions, discards them, consumes STARTUP_ATTEMPTED and invokes a parameterless callback. That callback, start_dlss (dinput8_proxy.c:1135), reads observer status again and can refuse after the attempt has been spent. Pass the admitted extent to a start-at-extent operation. The manual start path can obtain its own snapshot before calling the same operation. [games/ac7/src/carrier.rs:357](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/carrier.rs#L357) + +- [x] **Duplication | Medium | Share the GameSDK call-header validator across adapters.** AC7 prepare validates both args and host at games/ac7/src/lib.rs:219 and :224. Fallout 4 repeats the same unsafe two-word check at games/fallout4/src/session.rs:79 for its prepare at :355 and :360. Unity Mono performs the same reads at games/unity-mono/src/lifecycle.rs:115 but returns Result to its prepare at :153. A change to short-header handling or error precedence currently needs independent changes across plugins. Put one validator for known versioned GameSDK call types beside the Rust SDK bindings, read size before version, and preserve each exported result code and the separate size-only probe contract. [games/ac7/src/lib.rs:170](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/lib.rs#L170) + +- [x] **Altitude | Medium | Distinguish a prepared renderer from one retained only for cleanup.** When hook installation fails with a guard still held, renderer::prepare returns a pinned, quiescing renderer and false. Lifecycle::prepare saves the pointer but drops the preparation result, so GameSDK status reports prepared=1 and start forwards the request to a renderer that must refuse it. The refusals_match_the_former_plugin test explicitly expects that status. Track a cleanup-only state separately, retain its handle for stop, and report prepared and admit start only after successful preparation. [games/ac7/src/lifecycle.rs:223](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/lifecycle.rs#L223) + +- [x] **Simplicity | Low | AC7 Ops re-unwraps leaves that publish already proved present.** `Ops(rsf_ac7_platform)` keeps the five `Option` leaves after `Ops::complete` (lib.rs:117) has required all of them, yet every `Leaves` method repeats `self.0..ok_or(Threw)?` (lib.rs:131-158), mapping an impossible missing leaf onto the native-exception result. Build `Ops` once from the table with plain fn pointers (`struct Ops { prepare: PrepareFn, start: StartFn, ... }`, constructed by `Some(Ops { prepare: table.prepare?, ... })` in `rsf_ac7_publish_api`) and drop `complete` and the five `ok_or` branches. Behavior is unchanged because publish refuses an incomplete table before `OPS` is set; the tradeoff is one small named struct instead of reusing the bindgen table type. [games/ac7/src/lib.rs:107](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/lib.rs#L107) + +- [x] **Duplication | Low | Reuse the AC7 synthetic image setup in renderer, site and patch tests.** Renderer Fake::new plants the hook, helper and depth bytes at games/ac7/src/renderer/tests.rs:48 exactly as site admission tests do at games/ac7/src/sites/tests.rs:12. It then seeds velocity and scene precision as games/ac7/src/patches/tests.rs:21 does at a nonzero module base. This duplicates which tables make up each admissible test image, so adding a guard family requires editing both admission and transaction fixtures. Put two base-aware seed methods on the existing test-only fake_code::Image. Compose both for renderer tests and just the relevant one for the narrower suites, keeping independent expected-RVA and failure assertions. [games/ac7/src/renderer/tests.rs:48](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/renderer/tests.rs#L48) + +- [x] **Simplicity | Low | AC7 NativeCode keeps validated Option leaves and re-checks them per call.** `NativeCode::new` (sites.rs:34) only returns `Some` when `matches` and `write` are present, but `NativeCode` still wraps the raw `&rsf_ac7_code_leaves`, so `Code::matches` and `Code::write` (sites.rs:41-52) repeat `let Some(..) = self.0.matches else { return false }` on every compare and write. renderer.rs compounds it: `NativeLeaves` stores a copied `rsf_ac7_code_leaves` with the two leaves wrapped back into `Some(...)` (renderer.rs:328-333) and `NativeLeaves::code()` rebuilds `NativeCode::new(&self.code)` as an `Option` for every `matches`/`write`/`log` (renderer.rs:387-408). Store the unwrapped pointers once (`struct NativeCode { matches: MatchesFn, write: WriteFn, log: rsf_game_log_fn, user: *mut c_void }`) and let `NativeLeaves` hold a `NativeCode` directly, with `log_to` setting its log/user. This removes three dead failure branches per call path and the per-call Option reconstruction without changing refusals, since both constructors still reject incomplete tables. Same pattern as the AC7 Ops entry for lib.rs. [games/ac7/src/sites.rs:27](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/sites.rs#L27) + +- [x] **Altitude | Low | Make exact-build admission accept a read-only code view.** rsf_ac7_build_admit only compares live bytes and logs mismatches, but NativeCode::new rejects its callback table unless a write function is present. The actual Rust ABI test at sites/tests.rs:119 supplies a dummy refusing writer and explicitly asserts that removing it fails admission. Separate read/compare capability from the patch writer, validate only the callbacks used at each entry point and keep mandatory write validation on mutation paths. [games/ac7/src/sites.rs:36](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/sites.rs#L36) + +- [x] **Duplication | Low | Check the AC7 target initializer fingerprint once during admission.** Target initialization serves two roles: native_renderer.cpp calls it at games/ac7/src/native_renderer.cpp:2110 and HOOK_SITES also identifies it as hook 23 at games/ac7/src/sites.rs:143. HELPERS repeats exactly the same address and 16 bytes at :216. admit walks both arrays at :256 and :276 before installing hooks, so every successful preparation makes the same guarded read twice. The assertion at games/ac7/src/sites/tests.rs:128 counts table lengths and therefore accepts the duplication. Keep the entry in the hook table, document the direct call there, and check uniqueness across both tables in the admission test. [games/ac7/src/sites.rs:216](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/sites.rs#L216) + + + +### A02 · AC7 render scopes, views and scene effects + +Port scoped render commands, view data, UI, scene colour, contact shadows and TrueSky resource handling. + +**Coordinate shared edits** + +- Borrowed view and constant-buffer identity across render, capture and velocity ([A03](#a03), [A05](#a05), [G02](#g02)). + +**Port files (15)** + +- [x] [games/ac7/include/rescaleframe/ac7_render_scope.h](games/ac7/include/rescaleframe/ac7_render_scope.h) +- [x] [games/ac7/include/rescaleframe/ac7_scene_color.h](games/ac7/include/rescaleframe/ac7_scene_color.h) +- [x] [games/ac7/include/rescaleframe/ac7_ui_rules.h](games/ac7/include/rescaleframe/ac7_ui_rules.h) +- [x] [games/ac7/include/rescaleframe/ac7_view.h](games/ac7/include/rescaleframe/ac7_view.h) +- [x] [games/ac7/src/ac7_scope_owner.h](games/ac7/src/ac7_scope_owner.h) +- [x] [games/ac7/src/cloud_depth_platform.h](games/ac7/src/cloud_depth_platform.h) +- [x] [games/ac7/src/contact_shadow.cpp](games/ac7/src/contact_shadow.cpp) +- [x] [games/ac7/src/contact_shadow.h](games/ac7/src/contact_shadow.h) +- [x] [games/ac7/src/render_scope.cpp](games/ac7/src/render_scope.cpp) (deleted; the exception leaves are C11 SEH in `render_scope_entry.c`) +- [x] [games/ac7/src/scene_color.cpp](games/ac7/src/scene_color.cpp) +- [x] [games/ac7/src/truesky_depth.cpp](games/ac7/src/truesky_depth.cpp) +- [x] [games/ac7/src/truesky_depth.h](games/ac7/src/truesky_depth.h) +- [x] [games/ac7/src/truesky_motion.cpp](games/ac7/src/truesky_motion.cpp) +- [x] [games/ac7/src/truesky_motion.h](games/ac7/src/truesky_motion.h) +- [x] [games/ac7/src/ui_rules.cpp](games/ac7/src/ui_rules.cpp) + +**Fixtures (4)** + +- [x] [tests/ac7_render_scope.cpp](tests/ac7_render_scope.cpp) +- [x] [tests/ac7_ui_rules.cpp](tests/ac7_ui_rules.cpp) +- [x] [tests/ac7_view.cpp](tests/ac7_view.cpp) +- [x] [tests/ac7_view_fixture.h](tests/ac7_view_fixture.h) + +**Rust review findings (8)** + +- [x] **Duplication | Medium | Share fallible allocation for Rust-owned FFI handles.** AC7 allocates and initializes nonzero-sized Scopes and Ticket objects at games/ac7/src/render_scope.rs:286 and :346. Vulkan FSR3 repeats the unsafe allocation at runtime/vulkan/fsr3/owner.rs:331 for swapchains and FG contexts at :640 and :946, returning NonNull instead of a raw pointer. RDR2 capture creation at games/rdr2/src/capture_state.rs:112 uses a third generic implementation at :117 that omits the nonzero-size guard. Current callers allocate concrete nonzero types. Use one small fallible allocation helper returning Option>, with one documented size contract, and convert to raw handles and existing error codes in the owning exports. This removes three separate implementations of the allocator preconditions. [games/ac7/src/render_scope.rs:135](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/render_scope.rs#L135) + +- [x] **Altitude | Medium | Queue point-in-time scope markers in one operation.** retire_renderer_uniforms (native_renderer.cpp:814-822), the native SR submission at line 982 and velocity finalization at line 1716 open and immediately close a leased ticket. No engine work occurs between those calls. Open transfers ownership and increments outstanding, but close can refuse after the first marker was published. These callers then discard the open ticket, preventing idle and lease retirement. Add an enqueue operation for these callers that admits and links both markers together before transferring ownership. Keep separate open/close for scopes spanning genuine engine work. [games/ac7/src/render_scope.rs:380](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/render_scope.rs#L380) + +- [x] **Altitude | Medium | Bind each queued scope ticket to its originating command list.** The ticket stores its owner and markers but omits the native list used by open. Full-frame begin and end arrive in separate hooks (native_renderer.cpp:575-598) and end supplies its own list. Close accepts any recording list, even though the ticket lifetime assumes that both markers execute in order. Store the recording-list identity in the ticket, validate it on close and preserve the ticket for retirement on mismatch. [games/ac7/src/render_scope.rs:394](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/render_scope.rs#L394) + +- [x] **Altitude | Medium | Track cloud motion relay installation independently of the full-grid transition.** The per-sky-render apply callback returns immediately once cloud resolution is installed or refused. install_motion returns no outcome and may leave its slot empty after a transient allocation or write refusal. If depth installation reaches either terminal state, no later sky render retries the independent composite draw observer, so the renderer can keep running without cloud motion depth. Give motion its own installed, retryable or refused outcome, and use the full-grid state only to gate the depth and resolution work. [games/ac7/src/truesky.rs:353](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/truesky.rs#L353) + +- [x] **Altitude | Medium | Report a full-target view separately from player-camera identity.** read_view labels a zero-origin view filling its own buffer as is_main_view, and ac7_view.h describes that as the camera the player sees. The compatibility bridge treats it as camera admission at dlss_bridge.c:914, yet lines 2359-2367 document a separate translucency upload passing the same test and previously causing every evaluation to fail. Expose the actual rectangle fact, and have the adapter establish primary-camera identity from the corresponding scene pass, view and family before selecting backend inputs. [games/ac7/src/view.rs:177](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/view.rs#L177) Blocked: the rectangle fact is `fills_target` and the native SR path already admits by view, family and frame. The compatibility callers `on_pass` (loader/proxy/src/dlss_bridge.c:910) and `on_view_constants` (:2381) receive only the frame tap's retained PS buffer (runtime/orchestrator/src/frame_tap.rs), which carries no native session, frame, view or family. Their only producer (`hooked_postprocess`/`make_plan` in native_renderer.cpp) runs only after native activation, which suppresses `on_pass`. Closing this needs a G02 frame-tap receipt with an upload generation and an AC7 producer that runs in compatibility mode, with its stage and slot confirmed in a game run (docs/research/ac7-render-scope-port-a02.md). **Done (tree check):** `games/ac7/src/view.rs:180-205` exposes the rectangle fact as `fills_target`; `is_main_view`, `on_pass` and `on_view_constants` appear nowhere in the tree (D1 removed the compatibility renderer from `loader/proxy/src/dlss_bridge.c`, now 922 lines). + +- [x] **Duplication | Low | Reuse the compile-time ASCII widening used by the Windows adapters.** TrueSky converts its NUL-terminated module name at games/ac7/src/truesky.rs:40 using the same byte-to-u16 loop that games/ac7/src/carrier.rs:27 uses for DLL, executable and window-class pointers. Godot repeats it at integrations/godot/native/window.rs:29 for a length-delimited class comparison at :108. Share one const helper for ASCII bytes which preserves exactly the input length, including a terminator only when supplied, and keep the names in their owning integrations. This gives all three callers the same ASCII and length contract. [games/ac7/src/truesky.rs:29](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/truesky.rs#L29) + +- [x] **Duplication | Low | Reuse one IEEE CRC-32 implementation for binary fingerprints.** AC7 checks its effect bytes at games/ac7/src/truesky.rs:168 using a slice fold. RDR2 computes the same reflected polynomial, initial value and final complement in games/rdr2/src/capture_state/recordings.rs:180; games/rdr2/src/native_capture.cpp:104 calls that loop for both pixel and vertex shader bytecode. Fixes or faster implementations currently need to preserve identical persisted hash values in two places. Share a pure crc32_ieee(&[u8]) function with the existing checksum utilities, retaining the RDR2 pointer/length contract and AC7 file-size check in their adapters. The existing CRC-32C function uses a different polynomial. [games/ac7/src/truesky.rs:159](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/truesky.rs#L159) + +- [x] **Duplication | Low | Generate the numeric draw and layout classes consumed across the AC7 UI ABI.** The seven draw and four layout result values at games/ac7/src/ui.rs:7 and :15 repeat the cast macros at games/ac7/include/rescaleframe/ac7_ui_rules.h:33 and :72. Although tools/generate-rust-bindings.py:113 requests both families, games/ac7/src/ui_abi.rs:19 emits only their u32 aliases. The classifier returns its private numbers and the native dispatch at loader/proxy/src/dlss_bridge.c:534 switches on the header values; changing one side can silently route a different layout. Express those values as bindgen-readable integer constants while retaining the u32 return ABI, regenerate, and consume the generated constants in the classifiers. [games/ac7/src/ui.rs:7](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/ui.rs#L7) + + + +### A03 · AC7 F9 motion capture + +Port the F9 capture boundary and reconcile the observation, record, session and artifact findings. + +**Coordinate shared edits** + +- Borrowed view and constant-buffer identity across render, capture and velocity ([A02](#a02), [A05](#a05), [G02](#g02)). + +**Port files (6)** + +- [x] [games/ac7/include/rescaleframe/ac7_motion_capture.h](games/ac7/include/rescaleframe/ac7_motion_capture.h) +- [x] [games/ac7/src/motion_capture.cpp](games/ac7/src/motion_capture.cpp) +- [x] [games/ac7/src/motion_capture_observations.h](games/ac7/src/motion_capture_observations.h) +- [x] [games/ac7/src/motion_capture_records.h](games/ac7/src/motion_capture_records.h) +- [x] [games/ac7/src/motion_capture_session.h](games/ac7/src/motion_capture_session.h) +- [x] [games/ac7/src/motion_capture_trampolines.cpp](games/ac7/src/motion_capture_trampolines.cpp) (typed Unreal calls, SEH and native callbacks; now the C11 leaf `motion_capture_trampolines.c` with `__try`/`__finally` scope restoration) + +**Fixtures (2)** + +- [x] [tests/ac7_capture_io.cpp](tests/ac7_capture_io.cpp) +- [x] [tests/ac7_motion_capture.cpp](tests/ac7_motion_capture.cpp) + +**Rust review findings (7)** + +- [x] **Duplication | Medium | Use the observer binding for AC7 input-layout elements.** The observer publishes the generated rsf_observer_layout_element at runtime/orchestrator/src/d3d11_observer_abi.rs:12 and :40. The native capture callback passes that exact pointer through at games/ac7/src/motion_capture.cpp:886, but the Rust consumer at games/ac7/src/motion_capture_observations.rs:234 interprets it as a handwritten five-field struct. The velocity cache also takes this mirror at games/ac7/src/velocity_pass_cache.rs:348. Reordering two of the first four u32 fields could silently change capture and velocity classification while the manual size and last-offset assertions still pass. Generate the narrow observer element binding once in a shared ABI module and import it on both sides, leaving snapshot ownership and cache limits local. [games/ac7/src/motion_capture_observations.rs:51](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/motion_capture_observations.rs#L51) + +- [x] **Altitude | Medium | Bind the contact-light before/after pair to its draw.** begin_lighting_pair arms a single interval-wide flag before the before-draw record exists. draw_capture consumes it for either contact shader hash, without checking the originating context, draw or target. motion_capture.cpp:542 even omits the draw index on the lighting row. If two matching callbacks interleave, the second draw can consume the first draw's after sample, and the artifacts cannot establish which draw changed the pixels. Carry the same draw identity through both callbacks and complete only the matching recorded pair. [games/ac7/src/motion_capture_observations/colour.rs:130](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/motion_capture_observations/colour.rs#L130) + +- [x] **Altitude | Medium | Snapshot shader observations before writing capture files.** Publisher::finish keeps the global observations mutex from before formatting engine records until after the final session.json write, including each of up to 4,096 shader file writes. The shader creation hook in motion_capture.cpp:869 needs the same mutex even between armed captures, so file I/O can block shader creation. Snapshot ordered shader handles, counters and readback totals under the lock, using shared immutable bytecode storage to avoid copying the payloads, then publish from that snapshot after releasing the lock. [games/ac7/src/motion_capture_records/artifacts.rs:427](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/motion_capture_records/artifacts.rs#L427) + +- [x] **Duplication | Medium | Keep one AC7 site description for capture and renderer admission.** The F9 root table records the postprocess and widget queue addresses and guard bytes at games/ac7/src/motion_capture_records/root_hooks.rs:25 and :42. Renderer admission at games/ac7/src/renderer.rs:153 checks independently maintained entries at games/ac7/src/sites.rs:132 and :136. Standalone capture uses its table from games/ac7/src/motion_capture.cpp:397 and skips these hooks when the native owner is active. The addresses agree today, but the postprocess checks cover 18 versus 16 bytes and widget queue covers 15 versus 16. Define each address and longest verified byte sequence once in AC7, retaining the consumer-specific prefix lengths, ownership flags and detour order so a site update reaches both paths. [games/ac7/src/motion_capture_records/root_hooks.rs:25](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/motion_capture_records/root_hooks.rs#L25) + +- [x] **Altitude | Medium | Retain root-hook ownership until removal succeeds.** Capture shutdown calls the void remove callback and unconditionally clears REGISTRATION. The actual callback (motion_capture.cpp:393, ac7_hooks.h:9) discards the results of both DisableHook and RemoveHook. An unsuccessful removal leaves no tracked target for a retry, and install similarly reports RolledBack without evidence of complete removal. Have the native batch return the targets still owned, preserve their registration until retired, and report partial teardown to the caller. [games/ac7/src/motion_capture_records/root_hooks.rs:176](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/motion_capture_records/root_hooks.rs#L176) + +- [x] **Simplicity | Low | AC7 draw commit takes a fallible row closure that every caller pre-builds.** `commit(capture, row: impl FnOnce() -> Result)` defers row construction until admission under the records lock, but all four callers (draws.rs:257, draws/before.rs:156, draws/geometry.rs:171, draws/ordinary.rs:178) format the row first and pass `|| Ok(row)`, so the closure, the inner `?` and the `fmt::Result` return are dead generality. Change it to `fn commit(capture, row: Bytes) -> bool` (admit, `try_reserve`, push) and have the exports return `write_x(...).is_ok() && commit(capture, row)`. Behavior is identical because formatting already happens before the lock; the only tradeoff is losing a lazy-build option nobody uses. [games/ac7/src/motion_capture_records/draws.rs:108](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/motion_capture_records/draws.rs#L108) + +- [x] **Altitude | Low | Keep Windows stream formatting out of JSON sampler records.** write_lod reproduces unquoted Windows stream tokens such as inf and nan(ind) for nonfinite sampler limits. When a sampled descriptor contains one, the draw writer reports success but tools/analyze-ac7-motion-capture.py:16 rejects the row with json.loads and aborts analysis of the capture. Give the JSON float writer responsibility for nonfinite values, using null as write_float already does while preserving six significant digits for finite sampler LODs. [games/ac7/src/motion_capture_records/draws/before.rs:63](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/motion_capture_records/draws/before.rs#L63) + + + +### A04 · AC7 velocity shader transforms + +Finish the shader container and stage transforms, keeping emitted bytecode and shader inputs traceable. + +**Coordinate shared edits** + +- Shader transform outputs consumed by the velocity pass ([A05](#a05)). + +**Port files (4)** + +- [x] [games/ac7/src/shader_bytes.h](games/ac7/src/shader_bytes.h) +- [x] [games/ac7/src/velocity_container.h](games/ac7/src/velocity_container.h) +- [x] [games/ac7/src/velocity_shader.cpp](games/ac7/src/velocity_shader.cpp) +- [x] [games/ac7/src/velocity_shader.h](games/ac7/src/velocity_shader.h) + +**Fixtures (1)** + +- [x] [tests/ac7_velocity_shader.cpp](tests/ac7_velocity_shader.cpp) + +**Rust review findings (7)** + +- [x] **Duplication | Medium | Share the GPU history hash, record layout and lookup across AC7 velocity shaders.** The native geometry helper compiled at games/ac7/src/velocity_geometry.rs:638 and the domain helper compiled at games/ac7/src/velocity_tessellation.rs:723 independently implement the same FNV mix, 32-probe limit, 64-byte record addressing and nearest unambiguous clip selection at velocity_geometry.rs:753 and games/ac7/src/velocity_tessellation.rs:760. The GPU table writer at games/ac7/src/velocity_pass.cpp:63 independently repeats the hash and field offsets. A one-sided change can turn populated records into misses that look like ordinary fallback motion. Package shared HLSL source for the hash, record offsets and common lookup, with the writer and all readers embedding it at compilation. Keep emission ordinals, tessellation corner keys, beam interpolation and the t0/t127 bindings with their respective stages. [games/ac7/src/velocity_geometry.rs:753](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_geometry.rs#L753) + +- [x] **Duplication | Medium | Share the geometry and domain helper-instruction rewrite.** The domain program builds its helper instructions at games/ac7/src/velocity_tessellation.rs:646 using the same opcode filtering, output declaration rewrite, raw resource handling, temporary-register rebasing and output mapping as the native geometry transform at games/ac7/src/velocity_geometry.rs:433 and :555. Only the helper input operands have stage-specific meanings: domain point/corner/control point versus geometry vertex/temporary. A change to handling a declaration or an invalid register currently needs to be repeated. Put the common instruction loop in velocity_stage with a callback for input remapping, preserving each stage's separate placement of the rewritten code. [games/ac7/src/velocity_tessellation.rs:518](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_tessellation.rs#L518) + +- [x] **Altitude | Medium | Keep intermediate shader signatures inside the Rust stage linker.** Renderer::make_variant passes the hull output signature directly to the domain transform (velocity_pass.cpp:246-248). Rust calls a native append callback per hull output, velocity_shader.cpp copies the names into owning C++ strings, then semantic_views constructs another vector and Rust reimports the same entries for domain linkage. Provide one tessellation-link operation returning both hull programs, the domain program and the final metadata needed for stream output. Only finished products need cross into the D3D owner. [games/ac7/src/velocity_tessellation.rs:656](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_tessellation.rs#L656) + +- [x] **Altitude | Medium | Classify SM5 declarations consistently before splitting shader bodies.** Instruction.declaration covers only opcodes 88 through 106. velocity_geometry.rs recognizes native raw and structured resource declarations when checking slot 127, but native_declaration adds only stream and instance-count opcodes. A permitted native raw or structured resource on another slot goes through native_body after its initial executable MOV, so the resulting shader can fail D3D creation. Have the shared decoder classify the supported declaration opcodes and keep stage-specific phase placement in the stage linker. [games/ac7/src/velocity_tokens.rs:121](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_tokens.rs#L121) + +- [x] **Duplication | Medium | Use the common DXBC stage reader and writer for AC7 vertex transforms.** The vertex transform calls a private Stage reader at games/ac7/src/velocity_vertex.rs:391 and reassembles its shader, ISGN and OSGN at :402. games/ac7/src/velocity_stage.rs:42 and :64 already implement the same typed stage read/write for the geometry path at games/ac7/src/velocity_geometry.rs:262. The vertex reader adds a 32-register limit, and the pixel writer at games/ac7/src/velocity_pixel.rs:380 preserves the original output signature. Use the common reader with a vertex-local register check and OSGN-only selection, then reuse write_stage for vertex. Factor chunk substitution beneath write_stage so the pixel path can replace only code and inputs. Keep unaffected chunks byte-identical and preserve allocation failures. [games/ac7/src/velocity_vertex.rs:135](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_vertex.rs#L135) + +- [x] **Duplication | Low | Share traversal of the DXBC chunk offset table.** The AC7 velocity signature reader calls chunks at games/ac7/src/velocity_container.rs:200. Its read_container implementation validates the offset-table size, reads each offset at 32 + 4*i, computes the table end and delegates to chunk_at. The synthetic patch service called at runtime/orchestrator/src/shader_patch.rs:770 repeats the same traversal in runtime/orchestrator/src/shader_patch/dxbc.rs:47. Both already import runtime/graphics/src/dxbc_chunks.rs:14, but that helper checks only one chunk. Extend it with a checked iterator yielding offset and borrowed chunk from the declared container slice. Keep AC7's trailer acceptance and 32-chunk limit, and the service's exact-length, hash and refusal diagnostics at their call sites. [games/ac7/src/velocity_container.rs:114](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_container.rs#L114) + +- [x] **Duplication | Low | Reuse the velocity-stage compiler callback adapter for pixel shaders.** The pixel transform called at games/ac7/src/velocity_shader.cpp:93 initializes pointer/size outputs, calls the compiler, checks the container length, and borrows the result at games/ac7/src/velocity_pixel.rs:417. games/ac7/src/velocity_stage.rs:130 already implements that exact pointer and lifetime contract for geometry and tessellation, including its use at games/ac7/src/velocity_geometry.rs:595. The pixel path then parses chunks, which can stay pixel-local. Import CompileHelper and call compile_bytecode for the pixel helper so all three paths apply future callback or size-contract changes together. [games/ac7/src/velocity_pixel.rs:417](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_pixel.rs#L417) + + + +### A05 · AC7 velocity pass and history + +Port the velocity pass and consolidate variant publication, frame history and stream or commit decisions. + +**Coordinate shared edits** + +- Borrowed view and constant-buffer identity across render, capture and velocity ([A02](#a02), [A03](#a03), [G02](#g02)). +- Shader transform outputs consumed by the velocity pass ([A04](#a04)). + +**Port files (7)** + +- [x] [games/ac7/include/rescaleframe/ac7_velocity_pass.h](games/ac7/include/rescaleframe/ac7_velocity_pass.h) +- [x] [games/ac7/src/velocity_commit.h](games/ac7/src/velocity_commit.h) +- [x] [games/ac7/src/velocity_history.h](games/ac7/src/velocity_history.h) +- [x] [games/ac7/src/velocity_pass.cpp](games/ac7/src/velocity_pass.cpp) +- [x] [games/ac7/src/velocity_pass_cache.h](games/ac7/src/velocity_pass_cache.h) +- [x] [games/ac7/src/velocity_renderer.h](games/ac7/src/velocity_renderer.h) +- [x] [games/ac7/src/velocity_stream.h](games/ac7/src/velocity_stream.h) + +**Rust review findings (7)** + +- [x] **Altitude | Medium | Commit model record capacity after native allocation succeeds.** begin_model charges draw.records to the frame before Renderer::model (velocity_pass.cpp:324-331) attempts to grow the GPU history buffer. If raw_buffer fails, that draw returns without storing anything, but its charge survives. Later draws in the same frame may request larger allocations or hit RECORD_LIMIT for work that never ran. Split frame rotation from record reservation and finalize or cancel the reservation when native buffer preparation reports its outcome. [games/ac7/src/velocity_history.rs:335](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_history.rs#L335) + +- [x] **Altitude | Medium | Apply the same view identity to velocity accumulation and commit.** begin_view returns SAME_FRAME solely from the native frame and the session/history lookup. Renderer::view (velocity_pass.cpp:345) then accepts a matching depth resource without comparing view_key or family_key. Two views sharing history, depth and frame can contribute to one motion target, but commit_view still attributes it exclusively to the first view/family. Include view and family in same-frame admission, or allocate separate accumulation slots for simultaneous views while retaining their shared temporal-history identity. [games/ac7/src/velocity_history.rs:337](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_history.rs#L337) + +- [x] **Duplication | Medium | Retain one shader bytecode allocation for AC7 capture and velocity.** The same D3D11 creation callback passes the identical byte span to both consumers at loader/proxy/src/dlss_bridge.c:642 and :643. With capture enabled, games/ac7/src/motion_capture_observations.rs:141 copies the full payload for ordered F9 shader artifacts while games/ac7/src/velocity_pass_cache.rs:173 independently copies it for variant construction. Each cache permits 64 MiB of bytecode, so overlapping observations can occupy twice the payload memory. Fan out one fallibly allocated immutable payload to both consumers, keeping their separate retention budgets, invalidation, artifact ordinals and the full-span versus declared-container hash conventions. The variant builder can retain this payload during its unlocked callback instead of copying all stages again at velocity_pass_cache.rs:247. [games/ac7/src/velocity_pass_cache.rs:166](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_pass_cache.rs#L166) + +- [x] **Altitude | Medium | Include beam-layout classification in velocity variant identity.** Renderer::variant passes g.strides[0] from the bound vertex buffer. The input-layout object can be rebound with a different stride. prepare caches successes and refusals before it computes beam_layout(request.stride, elements), even though make_variant passes that flag into the vertex shader transform. A first draw can therefore determine the wrong beam transformation or refusal for later draws. Compute the beam-layout decision before lookup and include it in VariantKey. [games/ac7/src/velocity_pass_cache.rs:234](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_pass_cache.rs#L234) + +- [x] **Altitude | Medium | Preserve the reason for variant build failure before caching it.** admit records REFUSED as a permanent negative entry for the renderer generation. Renderer::make_variant (velocity_pass.cpp:279,293) returns that same result for unsupported bytecode and D3D shader or stream-output creation failures, including recoverable resource failures. A single failed allocation can thus suppress later eligible draws after the device recovers. Return distinct deterministic refusal and retryable native failure outcomes from the builder and cache only the former. [games/ac7/src/velocity_pass_cache.rs:320](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_pass_cache.rs#L320) + +- [x] **Altitude | Medium | Reject a built slot when its renderer generation has retired.** record silently drops a late result when the native variant list has been reset, but admit still returns its slot as a successful result. reset_discards_slots_and_late_results explicitly expects slot zero in this case. Renderer::variant at velocity_pass.cpp:228 checks only the vector length, which cannot establish that a recycled index names the just-built variant. Validate generation before returning a slot and keep the owning renderer live until the draw has finished using it. [games/ac7/src/velocity_pass_cache.rs:323](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_pass_cache.rs#L323) + +- [x] **Altitude | Medium | Invalidate the old shader identity even when its replacement is too large to capture.** dlss_bridge.c:642-643 forwards the same creation notification to the F9 observer and the velocity cache. Both wrappers return before invalidating the address when the new bytecode exceeds 1 MiB. If D3D reuses a same-stage shader address, later draws can select the prior object's velocity variant and F9 can report its prior hash. Treat object creation as an unconditional lifetime boundary, removing the previous observation before deciding whether to retain the replacement payload. [games/ac7/src/velocity_pass_cache.rs:337](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/ac7/src/velocity_pass_cache.rs#L337) + + + +### N01 · Anomaly startup and observation + +Port bootstrap, profile admission and observer lifetime. Attribute each guarded read and callback to its owner. + +**Coordinate shared edits** + +- Anomaly session startup, quiesce and callback retirement ([N02](#n02), [N03](#n03), [N04](#n04), [N06](#n06), [N08](#n08)). + +**Port files (19)** + +- [x] [games/anomaly/src/bootstrap_platform.cpp](games/anomaly/src/bootstrap_platform.cpp) (native profile and stage table; replaced by the C11 leaf `bootstrap_platform.c`) +- [x] [games/anomaly/src/bootstrap.cpp](games/anomaly/src/bootstrap.cpp) +- [x] [games/anomaly/src/build_profile.h](games/anomaly/src/build_profile.h) (removed: no C++ user remains; native, geometry, SR and motion records are Rust-owned and named by the native_profile.rs build index) +- [x] [games/anomaly/src/engine_guards.h](games/anomaly/src/engine_guards.h) (C declarations only) +- [x] [games/anomaly/src/engine_slots.h](games/anomaly/src/engine_slots.h) +- [x] [games/anomaly/src/native_hook_ops.h](games/anomaly/src/native_hook_ops.h) (C declarations only) +- [x] [games/anomaly/src/native_hooks.cpp](games/anomaly/src/native_hooks.cpp) (replaced by the C11 leaf `native_hooks_platform.c`) +- [x] [games/anomaly/src/native_hooks.h](games/anomaly/src/native_hooks.h) (C declarations only) +- [x] [games/anomaly/src/native_memory.h](games/anomaly/src/native_memory.h) +- [x] [games/anomaly/src/native_observer.h](games/anomaly/src/native_observer.h) +- [x] [games/anomaly/src/native_observer_platform.cpp](games/anomaly/src/native_observer_platform.cpp) (replaced by the C11 leaf `native_observer_platform.c`) +- [x] [games/anomaly/src/native_observer_platform.h](games/anomaly/src/native_observer_platform.h) +- [x] [games/anomaly/src/native_profile.h](games/anomaly/src/native_profile.h) (generated projection from the Rust profile owner) +- [x] [games/anomaly/src/plugin.cpp](games/anomaly/src/plugin.cpp) +- [x] [games/anomaly/src/runtime_module.h](games/anomaly/src/runtime_module.h) +- [x] [games/anomaly/temporal/frame_plan.h](games/anomaly/temporal/frame_plan.h) +- [x] [games/anomaly/temporal/history.h](games/anomaly/temporal/history.h) +- [x] [games/anomaly/temporal/math.h](games/anomaly/temporal/math.h) +- [x] [games/anomaly/temporal/planning.h](games/anomaly/temporal/planning.h) + +**Fixtures (6)** + +- [x] [tests/anomaly_bootstrap.cpp](tests/anomaly_bootstrap.cpp) +- [x] [tests/anomaly_build_select.h](tests/anomaly_build_select.h) (C declarations only) +- [x] [tests/anomaly_lifecycle.cpp](tests/anomaly_lifecycle.cpp) +- [x] [tests/anomaly_native_hook_leaves.cpp](tests/anomaly_native_hook_leaves.cpp) (now the C11 launcher `anomaly_native_hook_leaves.c` with the two native targets; the Rust fixture reads the SR bank and detour order from `sr_profile.rs`) +- [x] [tests/anomaly_native_hooks.cpp](tests/anomaly_native_hooks.cpp) +- [x] [tests/anomaly_plugin.cpp](tests/anomaly_plugin.cpp) + +**Rust review findings (8)** + +- [x] **Duplication | Medium | Use the same FG capture settings decoder for the Anomaly panel and scheduler.** The panel re-reads the start, count and interval keys with its own defaults and clamps at games/anomaly/src/adapter_options.rs:190, :198 and :206. The scheduler separately decodes the same keys at games/anomaly/src/fg_stage/options.rs:32, and Capture::claim consumes those values at :77. For a stored -1, both cast to u32, but the panel clamps start/interval to i32::MAX while the scheduler uses u32::MAX. Decode persisted values once into CaptureSettings using a documented range representable by the panel, and derive both its getters and the scheduler configuration from it, preserving count and interval limits. [games/anomaly/src/adapter_options.rs:190](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/adapter_options.rs#L190) + +- [x] **Duplication | Medium | Use the generated plugin-session options type in both Rust callers.** Anomaly constructs its own 128-byte options record in prepare_observation at games/anomaly/src/bootstrap.rs:407, while the callback host builds a second manual mirror at runtime/orchestrator/src/callback_host.rs:97 and :1034. Both target plugin_session.h and repeat its ABI version. The public Rust SDK already exports the matching generated type and version at sdk/game/src/plugin_session_abi.rs:7 and :9 with checks for every field offset. Reuse these definitions for both calls and their test callbacks; currently a header update can leave either manual type stale while the generated layout checks still pass. [games/anomaly/src/bootstrap.rs:69](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/bootstrap.rs#L69) + +- [x] **Altitude | Medium | Keep input-hook installation separate from the stages-configured flag.** With the FG bridge installed, install_input can attach the DirectInput observer successfully and then fail the guarded engine input hook. The function returns no outcome, and orchestrate immediately marks all stages configured. A retry after a session or overlay refusal skips both hooks, leaving input observation partial for that process with only a log explaining why. Return the per-hook result, retain completed steps and retry only the unfinished hook when cold startup is retried. [games/anomaly/src/bootstrap.rs:296](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/bootstrap.rs#L296) + +- [x] **Duplication | Medium | Share partial-pivot matrix inversion while preserving adapter tolerances.** Anomaly's SR and FG camera builders at games/anomaly/src/sr_pass.rs:103 and games/anomaly/src/fg_stage/camera.rs:34 call frame, which performs four inversions. Its local implementation at games/anomaly/src/camera.rs:120 duplicates the augmented-matrix pivot selection, normalization, and elimination in sdk/game/src/camera_math.rs:5 used by AC7 at games/ac7/src/view.rs:111. Anomaly checks all inputs for finiteness and uses a 1e-300 pivot floor, reciprocal multiplication and a zero-factor skip; the SDK uses 1e-12 and division. Consolidate the elimination in the SDK with explicit numeric policies and reference-vector tests for near-singular inputs before migrating either caller. [games/anomaly/src/camera.rs:120](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/camera.rs#L120) + +- [x] **Altitude | Medium | Reuse the verified executable identity across cold startup and session preparation.** bootstrap::enter synchronously hashes the entire running executable to choose a profile, then calls Runtime session prepare. Observer::prepare calls identify, which invokes running_build and hashes the same file again before checking the mapped image. This duplicates file I/O before DirectInput creation. Share the verified build identity for the same process image across these calls, preserving the independent mapped-site checks and full verification for standalone plugin entry. [games/anomaly/src/native_observer.rs:62](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/native_observer.rs#L62) + +- [x] **Altitude | Low | Read each variable-length instruction guard as one range.** Image::matches_hex checks the range as a whole and then calls the native exception-guarded copy leaf once per byte. Motion and SR stage startup invoke this for prologues, call setups and reconstruction guards, even though Read already accepts a length and fixed-size sites use a single copy. Decode the expected span, read the bounded live span once and compare slices, preserving the existing first-failing-site report. [games/anomaly/src/engine_guards.rs:109](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/engine_guards.rs#L109) + +- [x] **Duplication | Low | Give Windows module-path lookups one explicit terminator contract.** Project Wingman's carrier at games/project-wingman/src/carrier.rs:31 and RDR2's worker at games/rdr2/src/runtime_worker.rs:64 each allocate 32,768 WCHARs, call GetModuleFileNameW, reject truncation and return an unterminated Vec. Their callers use those slices for deployment paths at :70 and :284 respectively. Anomaly repeats the same lookup at games/anomaly/src/executable.rs:13 but retains a trailing NUL for the prepare call at games/anomaly/src/bootstrap.rs:388 and strips it again to hash the executable. Use a shared bounded Win32 lookup returning an owned path with explicit terminated and unterminated accessors. Keep per-game selection and file naming local. [games/anomaly/src/executable.rs:13](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/executable.rs#L13) + +- [x] **Duplication | Low | Consolidate the raw UTF-16 scans at Anomaly configuration boundaries.** Cold startup at games/anomaly/src/bootstrap.rs:196 and overlay setup at games/anomaly/src/overlay.rs:881 use ini::path, which scans for NUL, rejects empty paths and returns the terminator. The FG options reader at games/anomaly/src/fg_stage/options.rs:211, motion configuration at games/anomaly/src/motion/stage/options.rs:45 and SR configuration at games/anomaly/src/sr_stage.rs:2701 independently walk the same borrowed pointer format, excluding the terminator. This spreads the unsafe pointer contract across four implementations. Use a shared slice-until-NUL primitive usable by standalone Rust builds, with wrappers retaining each caller's null/empty handling and explicit terminator inclusion where Win32 needs it. [games/anomaly/src/ini.rs:12](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/ini.rs#L12) + + + +### N02 · Anomaly input and overlay + +Port the input hooks and overlay integration, including the handoff between gameplay input and overlay capture. + +**Coordinate shared edits** + +- Anomaly session startup, quiesce and callback retirement ([N01](#n01), [N03](#n03), [N04](#n04), [N06](#n06), [N08](#n08)). + +**Port files (9)** + +- [x] [games/anomaly/src/input_hooks.cpp](games/anomaly/src/input_hooks.cpp) +- [x] [games/anomaly/src/input_hooks.h](games/anomaly/src/input_hooks.h) +- [x] [games/anomaly/src/input_profile.h](games/anomaly/src/input_profile.h) +- [x] [games/anomaly/src/overlay_hooks.cpp](games/anomaly/src/overlay_hooks.cpp) +- [x] [games/anomaly/src/overlay_hooks.h](games/anomaly/src/overlay_hooks.h) +- [x] [games/anomaly/src/overlay_input_gate.h](games/anomaly/src/overlay_input_gate.h) +- [x] [games/anomaly/src/overlay_platform.h](games/anomaly/src/overlay_platform.h) +- [x] [games/anomaly/src/overlay_service.cpp](games/anomaly/src/overlay_service.cpp) +- [x] [games/anomaly/src/overlay_service.h](games/anomaly/src/overlay_service.h) + +**Fixtures (5)** + +- [x] [tests/anomaly_input_hooks.cpp](tests/anomaly_input_hooks.cpp) +- [x] [tests/anomaly_overlay_api.cpp](tests/anomaly_overlay_api.cpp) +- [x] [tests/anomaly_overlay_hooks.cpp](tests/anomaly_overlay_hooks.cpp) +- [x] [tests/anomaly_overlay_input_gate.cpp](tests/anomaly_overlay_input_gate.cpp) +- [x] [tests/anomaly_overlay_visibility.cpp](tests/anomaly_overlay_visibility.cpp) + +**Rust review findings (4)** + +- [x] **Altitude | Medium | Report consumed input from the gate operation that identified it.** hook_get_device_data (overlay_hooks.cpp:147-150) calls Rust to read and filter the device, carries a hardware boolean back to C++, then re-enters Rust with data/count pointers, flags and HRESULT to determine whether to notify. The second call locks the device registry again to rediscover the kind even though the first call held the originating entry and knew the consumed hardware count. Produce the notification decision and kind during the read, release the lock, then invoke the observer once. Preserve peek, loss and synthetic-release handling. [games/anomaly/src/input.rs:483](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/input.rs#L483) + +- [x] **Boundaries | Medium | Give the Anomaly overlay diagnostics INI keys adapter option rows.** AGENTS.md Rule 2 requires every option an integration reads, diagnostic ones included, to have a live overlay control. The Anomaly overlay start reads OverlayKeyPoll at overlay.rs:936 and OverlayCapture, OverlayCaptureFrames (1-16), OverlayCaptureStride (1-600) and OverlayCaptureCycles (1-8) at overlay.rs:473-485 straight from the adapter INI, and only at start. None of them is registered through rsf_anomaly_overlay_option_add: adapter_options.rs:62-125 registers the SR stage, bridge, F10 capture and FG capture rows, and the shared service only sees REGISTRY. To try a panel capture, a user has to edit the INI and restart the game. Register them as restart-marked toggle/number rows next to the FG capture rows, or re-read them when the option changes. OverlayCaptureDir is a path, so it is the only one the number/toggle option kinds cannot express. [games/anomaly/src/overlay.rs:473](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/overlay.rs#L473) + +- [x] **Altitude | Medium | Return the actual adapter-option apply and save result.** The shared service uses option_changed's return value to update its state and log applied or refused. Anomaly wraps every setter as void and returns 1 for any known index. For example, set_scope_hold changes live state only if its INI write succeeds, so a read-only configuration yields an applied log even though neither live nor saved state changed. Make the adapter setter return its outcome and pass it through to the existing runtime callback. [games/anomaly/src/overlay.rs:1149](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/overlay.rs#L1149) + +- [x] **Duplication | Low | Reuse the local timestamp formatter for Anomaly capture directories.** The overlay capture root at games/anomaly/src/overlay.rs:494 and FG capture root at games/anomaly/src/fg_stage/options.rs:154 both append a timestamp from GetLocalTime with the same six fields and YYYYMMDD-HHMMSS formatting. The implementations at overlay.rs:1215 and games/anomaly/src/fg_stage/options.rs:233 differ only in zero initialization. Move the timestamp formatter into one adapter-local capture utility and keep the two root names and custom-directory handling local. A naming or precision change then applies consistently to both capture mechanisms. [games/anomaly/src/overlay.rs:1215](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/overlay.rs#L1215) + + + +### N03 · Anomaly geometry + +Port geometry admission, observation and retirement together with their contract fixtures. + +**Coordinate shared edits** + +- Anomaly session startup, quiesce and callback retirement ([N01](#n01), [N02](#n02), [N04](#n04), [N06](#n06), [N08](#n08)). + +**Port files (8)** + +- [x] [games/anomaly/src/geometry_feed.cpp](games/anomaly/src/geometry_feed.cpp) +- [x] [games/anomaly/src/geometry_feed.h](games/anomaly/src/geometry_feed.h) (deleted; the 64-byte capture record is the C `rsf_anomaly_geometry_snapshot` in `native_geometry_platform.h`) +- [x] [games/anomaly/src/geometry_profile.h](games/anomaly/src/geometry_profile.h) (generated projection from the Rust profile owner `geometry_profile.rs`; the native leaf no longer reads it, and its `constexpr` records remain only for `build_profile.h`, `tests/anomaly_sr_profile.cpp` and the evidence scripts) +- [x] [games/anomaly/src/geometry_registry_platform.h](games/anomaly/src/geometry_registry_platform.h) +- [x] [games/anomaly/src/geometry_retirement.h](games/anomaly/src/geometry_retirement.h) (deleted; its key adapter had only the removed C++ facade and fixture as callers) +- [x] [games/anomaly/src/native_geometry.cpp](games/anomaly/src/native_geometry.cpp) (C++ removed; C11 leaf `native_geometry_platform.c`, SEH `__try/__finally` scope guards around the 17 detours) +- [x] [games/anomaly/src/native_geometry.h](games/anomaly/src/native_geometry.h) (C declarations only) +- [x] [games/anomaly/src/native_geometry_platform.h](games/anomaly/src/native_geometry_platform.h) (C declarations only) + +**Fixtures (2)** + +- [x] [tests/anomaly_geometry_hooks.cpp](tests/anomaly_geometry_hooks.cpp) (C++ removed; C11 fixture `tests/anomaly_geometry_hooks.c`) +- [x] [tests/anomaly_geometry_tests.cpp](tests/anomaly_geometry_tests.cpp) (C++ removed; C11 fixture `tests/anomaly_geometry_tests.c`, history through the Rust oracle C API) + +**Rust review findings (3)** + +- [x] **Altitude | Medium | Capture skinned palettes as bounded spans instead of two native callbacks per bone.** On each captured skinned draw, write_palette asks platform.bone for one matrix, validates and transposes it, then calls writer.bone to push the matrix into a C++ vector already reserved by writer.begin. With the admitted 1,024-bone limit this can cross the FFI boundary 2,048 times for one palette. Have the native reader supply a bounded batch of guarded matrices and the storage owner lend a destination span, or publish one completed palette. Preserve all-or-nothing validity if any matrix fails. [games/anomaly/src/native_geometry.rs:483](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/native_geometry.rs#L483) + +- [x] **Duplication | Low | Use one X-Ray matrix conversion for geometry and motion.** Geometry capture transposes and widens world/bone Fmatrix values after an affine check at games/anomaly/src/native_geometry.rs:395 and :489. Motion transposes and widens with the same indexing at games/anomaly/src/motion.rs:808. Its Rust camera reader at games/anomaly/src/motion/stage/draw.rs:45 calls that C export through MaybeUninit to obtain a matrix. Use a game-local pure function returning the transposed f64 array, have the C export write its result for native callers, and call it directly in the Rust readers. Keep the finite/affine check on geometry only so perspective camera matrices remain supported. [games/anomaly/src/native_geometry.rs:395](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/native_geometry.rs#L395) + +- [x] **Duplication | Low | Share Anomaly's nullable-empty FFI slice conversion.** GuardProfile's accessors at games/anomaly/src/native_geometry_abi.rs:154 use the same unsafe zero-count branch and from_raw_parts construction as games/anomaly/src/motion.rs:268 for borrowed palettes and deformation constants. The motion and SR guard readers manually repeat the branch for unique guards at games/anomaly/src/engine_guards/motion.rs:51 and games/anomaly/src/engine_guards/sr.rs:58. All permit NULL only with zero elements; guard profiles live for the module while draw inputs are callback-scoped. Centralize the conversion and document the nonempty pointer, length and lifetime preconditions; keep the slices tied to their respective enclosing borrows. [games/anomaly/src/native_geometry_abi.rs:167](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/native_geometry_abi.rs#L167) + + + +### N04 · Anomaly motion and foliage + +Port motion draw hooks, target ownership and foliage history. Use the draw and device fixtures to trace binding restoration. + +**Coordinate shared edits** + +- Anomaly session startup, quiesce and callback retirement ([N01](#n01), [N02](#n02), [N03](#n03), [N06](#n06), [N08](#n08)). +- Motion history, shader identity and published frame resources ([N05](#n05), [N07](#n07), [N08](#n08)). + +**Port files (16)** + +- [x] [games/anomaly/src/motion_bridge.cpp](games/anomaly/src/motion_bridge.cpp) (deleted with the C++ device fixtures) +- [x] [games/anomaly/src/motion_constants.h](games/anomaly/src/motion_constants.h) (deleted with the C++ device fixtures) +- [x] [games/anomaly/src/motion_d3d11.cpp](games/anomaly/src/motion_d3d11.cpp) +- [x] [games/anomaly/src/motion_d3d11.h](games/anomaly/src/motion_d3d11.h) +- [x] [games/anomaly/src/motion_device_platform.h](games/anomaly/src/motion_device_platform.h) +- [x] [games/anomaly/src/motion_foliage.cpp](games/anomaly/src/motion_foliage.cpp) +- [x] [games/anomaly/src/motion_foliage.h](games/anomaly/src/motion_foliage.h) +- [x] [games/anomaly/src/motion_history.h](games/anomaly/src/motion_history.h) +- [x] [games/anomaly/src/motion_policy.h](games/anomaly/src/motion_policy.h) +- [x] [games/anomaly/src/motion_profile.h](games/anomaly/src/motion_profile.h) (deleted; the per-build record is `motion_profile.rs`, read by the stage, the guard check and the evidence scripts) +- [x] [games/anomaly/src/motion_stage.cpp](games/anomaly/src/motion_stage.cpp) (C++ removed; C11 leaf `motion_stage_platform.c` with the create_shader, G-buffer window and draw detours, `__try/__finally` (MSVC) or cleanup-handler (GCC) draw and replay scopes and the SEH includer. Rust lends it the build's engine addresses from `sr_profile.rs` and `native_profile.rs`; geometry and SR jitter go through their C entries) +- [x] [games/anomaly/src/motion_stage.h](games/anomaly/src/motion_stage.h) (C declarations only: the published frame-target read, enabled and report) +- [x] [games/anomaly/src/motion_stage_platform.h](games/anomaly/src/motion_stage_platform.h) (C declarations only, `rsf_anomaly_motion_platform` ABI 13) +- [x] [games/anomaly/src/motion_target.cpp](games/anomaly/src/motion_target.cpp) +- [x] [games/anomaly/src/motion_target.h](games/anomaly/src/motion_target.h) +- [x] [games/anomaly/src/motion_target_platform.h](games/anomaly/src/motion_target_platform.h) + +**Fixtures (8)** + +- [x] [tests/anomaly_foliage_shader_device.cpp](tests/anomaly_foliage_shader_device.cpp) +- [x] [tests/anomaly_motion_contract.cpp](tests/anomaly_motion_contract.cpp) +- [x] [tests/anomaly_motion_device.cpp](tests/anomaly_motion_device.cpp) (Rust `motion/device_fixture/core_device.rs`, C11 launcher) +- [x] [tests/anomaly_motion_far_device.cpp](tests/anomaly_motion_far_device.cpp) (Rust `motion/device_fixture/far_device.rs`, C11 launcher) +- [x] [tests/anomaly_motion_hooks_native.cpp](tests/anomaly_motion_hooks_native.cpp) (native detour fixture driver; now the C11 launcher `tests/anomaly_motion_hooks_native.c` over the geometry C API; Rust names the flush site from `geometry_profile.rs`) +- [x] [tests/anomaly_motion_hooks.cpp](tests/anomaly_motion_hooks.cpp) +- [x] [tests/anomaly_motion_tess_chain_device.cpp](tests/anomaly_motion_tess_chain_device.cpp) (Rust `motion/device_fixture/tess_chain_device.rs`, C11 launcher) +- [x] [tests/anomaly_motion_tess_device.cpp](tests/anomaly_motion_tess_device.cpp) + +**Rust review findings (12)** + +- [x] **Duplication | Medium | Use the geometry producer's draw kinds and verdicts in motion history selection.** Stage::draw passes facts.verdict to CoreDrawInput at games/anomaly/src/motion/stage/draw.rs:302. The decision logic compares it with local literal aliases at games/anomaly/src/motion.rs:880; the registry already returns the named ABI codes defined at games/anomaly/src/geometry_registry_abi.rs:23, :25 and :31. The adjacent rigid/skinned/single-bone literals at motion.rs:875 also repeat games/anomaly/src/native_geometry_abi.rs:14, which the snapshot classifier already imports. Use those same constants in the history decision, converting the registry's i32 constants to the existing u8 representation in one place. This keeps classification and history admission synchronized if codes change. [games/anomaly/src/motion.rs:875](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion.rs#L875) + +- [x] **Altitude | Medium | Distinguish an unreadable render option from observed multisampling.** open_window maps both a failed options_word3 read and a successfully observed DX10_MSAA bit to MULTISAMPLED, then increments msaa_frames. A target_facts read failure takes another path that does not increment target_failed. Diagnostics can therefore attribute missing motion to enabled MSAA without that fact ever being observed, or omit the actual descriptor failure. Carry distinct option-read, descriptor-read, multisampled and target-allocation outcomes through admission and report the actual refusal. [games/anomaly/src/motion/stage.rs:494](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion/stage.rs#L494) + +- [x] **Duplication | Medium | Rotate Anomaly model and foliage histories from one frame identity.** The stage constructs a FrameIdentity for model history at games/anomaly/src/motion/stage.rs:525 and immediately passes the same four scalar values through the foliage C entry at :535. games/anomaly/src/motion.rs:367 and games/anomaly/src/motion/foliage.rs:100 separately implement same-frame reuse, rollover and discontinuity handling using the same follows predicate. A change made on just one path can pair model and foliage data with different predecessor frames. Construct the identity once and share the rotation decision or current/previous frame container, while preserving foliage's map-capacity recycling and the model retirement watermarks; keep the scalar C entry as an adapter for its native callers. [games/anomaly/src/motion/stage.rs:535](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion/stage.rs#L535) + +- [x] **Duplication | Medium | Use one motion frame-target description between Anomaly motion and FG.** Motion produces FrameTarget at games/anomaly/src/motion/stage.rs:587 and returns it through games/anomaly/src/motion_stage.cpp:399. The six facts are copied straight back to Rust at games/anomaly/src/fg_stage_platform.cpp:61 using the generated FG type at games/anomaly/src/fg_stage_abi.rs:882. The two 24-byte representations differ only in the order of the final main and written flags; size checks cannot catch swapping them. Define the common payload in a game-local C header and import its generated Rust type in both owners, retaining the existing platform callback for fixtures. Coordinate the private ABI versions when aligning the fields. [games/anomaly/src/motion/stage/abi.rs:193](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion/stage/abi.rs#L193) + +- [x] **Duplication | Medium | Use the range-aware option builder for Anomaly motion controls.** Motion's entry helper duplicates the descriptor construction in games/anomaly/src/adapter_options.rs:35, but hardcodes minimum=0 and infers a toggle only from the upper bound. The registration at games/anomaly/src/motion/stage/options.rs:156 therefore advertises zero as a valid capture interval even though its setter at :259 immediately saves at least one. Both call games/anomaly/src/overlay.rs:155. Share the range-based construction, accept the motion pack's stable mutable label pointer as well as static labels, and register interval as 1..=i32::MAX. This fixes the displayed range without changing capture timing or persistence. [games/anomaly/src/motion/stage/options.rs:95](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion/stage/options.rs#L95) + +- [x] **Altitude | Medium | Keep the motion pack's opaque handle opaque to the draw stage.** Platform::open_pack returns a void handle and a PackInfo containing only the manifest. During device creation Pack::constant_ops casts the handle directly to the private Rust RuntimePack type. That works only because motion_stage.cpp currently forwards the exact allocation from open_runtime_pack, a dependency neither the platform signature nor its size/version check expresses. Include the constant operations in PackInfo while opening the pack, or retain a typed RuntimePack directly when Rust owns both sides. [games/anomaly/src/motion/stage/shaders.rs:294](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion/stage/shaders.rs#L294) + +- [x] **Altitude | Medium | Invalidate window readiness when the engine replaces the position surface.** window::begin overwrites position_rtv and position_surface but computes fresh using only frame, view, reset generation and context. A second window in the same frame can therefore inherit target_ok after changing surface. Stage::open_window validates the descriptor, resizes and clears the motion target only if fresh, so the new surface can be paired with old motion data or extent. Track the surface and relevant view identity in the readiness decision and revalidate when either changes. [games/anomaly/src/motion/window.rs:54](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion/window.rs#L54) + +- [x] **Altitude | Medium | Distinguish no binding from a binding that cannot be inspected.** bind_close returns NONE when the backend pointer is null even if cache_may_hold_motion is still set. WindowFacts::read accepts a null backend, and Stage::open_window treats every result other than FAULT as permission to continue to device replacement, which can release the old RTV. Return an unresolved cleanup result when the previous engine cache may still borrow the RTV, and retain its owner until the original cache is verified clear. [games/anomaly/src/motion_target.rs:161](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion_target.rs#L161) + +- [x] **Duplication | Low | Reuse the Anomaly host-log callback wrapper in motion and FG.** games/anomaly/src/motion/stage.rs:131 and games/anomaly/src/fg_stage.rs:48 both store rsf_game_log_fn plus a user address and implement identical borrowed CStr delivery and fallible CString conversion for owned messages. Motion logs guard failures through it at :352 and FG logs missing runtime entries at :122. The motion copy additionally derives Default for its initially empty logger. Move this small wrapper to one adapter-local module and reuse it in both stages so the user-pointer conversion, interior-NUL handling, and callback lifetime contract have one implementation. [games/anomaly/src/motion/stage.rs:131](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion/stage.rs#L131) + +- [x] **Duplication | Low | Use one Anomaly frame-dump directory resolver for SR and motion.** Motion configures DumpApi at games/anomaly/src/motion/stage/capture.rs:76, selecting RSF_DUMP_DIR or LOCALAPPDATA/ReScaleFrame/Anomaly at :58. SR repeats the resolution at games/anomaly/src/sr_stage.rs:715 for capture setup at :1301, but filters out environment values of length 32,768 or greater. With the same environment the two owners of the same frame-dump service can select different destinations. Move resolution to frame_dump.rs, choose one documented length rule, and retain mode-specific capture admission and failure messages. [games/anomaly/src/motion/stage/capture.rs:58](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion/stage/capture.rs#L58) + +- [x] **Altitude | Low | Keep matrix validation failures distinct from bone-count refusals.** decide_core already rejects a skinned palette over CORE_MAX_BONES. The subsequent pack_core can still fail for an unusable WVP or bone matrix, but upload_core translates every false result to TooManyBones, even for a rigid draw with no bones. Return a typed packing refusal from the Rust implementation and preserve its reason in the draw counters, retaining the boolean wrapper for native callers that need only success or failure. [games/anomaly/src/motion/stage/draw.rs:326](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion/stage/draw.rs#L326) + +- [x] **Simplicity | Low | Anomaly motion device and binder tables unwrap bindgen Option leaves on every use.** The private `rsf_anomaly_motion_device_platform` and `rsf_anomaly_motion_bind_platform` are bindgen structs of `Option` leaves that are never validated, so each use is an `unwrap()`: motion_device.rs:76-78, 89, 105, 108, 128-131, 281, 294; motion_target.rs:42, 54, 145, 183; motion/stage.rs:629-630 and motion/stage/shaders.rs:452, 480-481 for `device.release/retain`. The neighbouring private motion-stage table (motion/stage/abi.rs:114-167) already declares plain `unsafe extern "C" fn` fields and is admitted once by size and version in `checked_platform`. Declare these two tables the same way (or mark the leaves non-nullable in the bindgen header), so the Rust side calls `(p.release)(x)` directly; a missing native leaf then fails at the C++/Rust contract instead of as a panic inside an `extern "C"` call, and ~20 unwraps disappear. Related to the Anomaly FG table entry for fg_stage.rs. [games/anomaly/src/motion_device.rs:76](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/motion_device.rs#L76) + + + +### N05 · Anomaly shader loading and temporal patches + +Port shader loading, reflection and interception. Track shader-language assets separately from their host code. + +**Coordinate shared edits** + +- Motion history, shader identity and published frame resources ([N04](#n04), [N07](#n07), [N08](#n08)). + +**Port files (9)** + +- [x] [games/anomaly/src/engine_shader_includes.cpp](games/anomaly/src/engine_shader_includes.cpp) (guarded native engine includes) +- [x] [games/anomaly/src/runtime_shaders.cpp](games/anomaly/src/runtime_shaders.cpp) +- [x] [games/anomaly/src/runtime_shaders.h](games/anomaly/src/runtime_shaders.h) +- [x] [games/anomaly/src/shader_d3d.cpp](games/anomaly/src/shader_d3d.cpp) +- [x] [games/anomaly/src/shader_d3d.h](games/anomaly/src/shader_d3d.h) +- [x] [games/anomaly/src/shader_loader.cpp](games/anomaly/src/shader_loader.cpp) (deleted; include opening moved to `shader_loader/d3d.rs`, fixture marshalling moved to `tests/anomaly_motion_shader_facade.h`) +- [x] [games/anomaly/src/shader_loader.h](games/anomaly/src/shader_loader.h) (deleted; its C++ fixture types live in `tests/anomaly_motion_shader_facade.h` until N04 retires the three device fixtures) +- [x] [games/anomaly/src/shader_loader_platform.h](games/anomaly/src/shader_loader_platform.h) (C11 declarations only) +- [x] [tools/anomaly_shader_constants.h](tools/anomaly_shader_constants.h) + +**Fixtures (1)** + +- [x] [tests/anomaly_temporal_shader_device.cpp](tests/anomaly_temporal_shader_device.cpp) + +**Rust review findings (2)** + +- [x] **Duplication | Medium | Share shader-family IDs between Anomaly manifest admission, draws and reports.** Manifest admission at games/anomaly/src/shader_loader/manifest.rs:150 assigns the row position in FAMILIES as its numeric family. Draw decisions use separately assigned constants at games/anomaly/src/motion.rs:870, while replacement logs and counter reports index a second name table at games/anomaly/src/motion/stage/shaders.rs:29 and games/anomaly/src/motion/stage/report.rs:244. An insertion or reorder can misclassify draws or relabel counts even if both tables still compile. Define stable explicit family IDs with one name/stage mapping, retain the special diagnostic label 'other' for the zero bucket, and size counters from the same definition. [games/anomaly/src/shader_loader/manifest.rs:8](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/shader_loader/manifest.rs#L8) + +- [x] **Altitude | Medium | Capture a complete reflection description at the native boundary.** D3DShaderReflector::reflect already owns the COM reflector, output vectors and counts, but calls Rust solely to drive indexes. Rust calls C++ for each signature, binding, buffer begin, variable and buffer finish. The callback protocol also treats unreadable signature rows as a successful enumeration, so compatibility checks receive shortened signatures without a completeness flag. Have the reflection owner return a complete snapshot or an explicit incomplete result in one operation, then perform compatibility checks on the snapshot. [games/anomaly/src/shader_loader/reflection.rs:47](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/shader_loader/reflection.rs#L47) + + + +### N06 · Anomaly SR stage and reconstruction + +Port the live SR stage, D3D11 pass and reconstruction, including refusing a frame and releasing partial resources. + +**Coordinate shared edits** + +- Anomaly session startup, quiesce and callback retirement ([N01](#n01), [N02](#n02), [N03](#n03), [N04](#n04), [N08](#n08)). +- SR target publication, swap rollback and engine-owned texture fields ([N07](#n07)). + +**Port files (11)** + +- [x] [games/anomaly/src/sr_d3d11.cpp](games/anomaly/src/sr_d3d11.cpp) (removed; Rust registers the table and the C11 leaf `sr_d3d11_platform.c` keeps the default view, state snapshot, the C++ exception boundary on foreign logs and the SDK layout checks) +- [x] [games/anomaly/src/sr_d3d11.h](games/anomaly/src/sr_d3d11.h) (removed with its C++ facades) +- [x] [games/anomaly/src/sr_d3d11_platform.h](games/anomaly/src/sr_d3d11_platform.h) (C declarations only) +- [x] [games/anomaly/src/sr_pass.h](games/anomaly/src/sr_pass.h) (removed; no users outside sr_stage.cpp) +- [x] [games/anomaly/src/sr_plan.h](games/anomaly/src/sr_plan.h) +- [x] [games/anomaly/src/sr_profile.h](games/anomaly/src/sr_profile.h) (generated projection from the Rust profile owner `sr_profile.rs`; `tools/generate-anomaly-sr-profile.py --check` runs as CTest `anomaly_sr_profile_projection`) +- [x] [games/anomaly/src/sr_reconstruction.h](games/anomaly/src/sr_reconstruction.h) +- [x] [games/anomaly/src/sr_settings.h](games/anomaly/src/sr_settings.h) +- [x] [games/anomaly/src/sr_stage.cpp](games/anomaly/src/sr_stage.cpp) (now the C11 leaf `sr_stage_platform.c` (five trampolines, `__try/__finally` or cleanup handler around the sun-cascade original, SEH calls to set_P, SetMipLODBias and GetCBuffer, the C++ exception boundary on log sinks, the hook set); `sr_stage/native.rs` builds the production table over `sr_profile.rs` and `native_profile.rs` and hosts the swap owner) +- [x] [games/anomaly/src/sr_stage.h](games/anomaly/src/sr_stage.h) (C declarations only) +- [x] [games/anomaly/src/sr_stage_platform.h](games/anomaly/src/sr_stage_platform.h) (C declarations only) + +**Fixtures (9)** + +- [x] [tests/anomaly_sr_hook_bridge.cpp](tests/anomaly_sr_hook_bridge.cpp) (now the C11 launcher `anomaly_sr_hook_bridge.c`; the Rust fixture installs the production table over the `sr_profile.rs` records) +- [x] [tests/anomaly_sr_runtime_api_bridge.cpp](tests/anomaly_sr_runtime_api_bridge.cpp) (actual Runtime import and fixture entry) +- [x] [tests/anomaly_sr_hooks.cpp](tests/anomaly_sr_hooks.cpp) +- [x] [tests/anomaly_sr_pass.cpp](tests/anomaly_sr_pass.cpp) +- [x] [tests/anomaly_sr_plan.cpp](tests/anomaly_sr_plan.cpp) +- [x] [tests/anomaly_sr_profile.cpp](tests/anomaly_sr_profile.cpp) (now the C11 launcher `anomaly_sr_profile.c`; the Rust contract projects the native, geometry, SR and motion records itself) +- [x] [tests/anomaly_sr_reconstruction.cpp](tests/anomaly_sr_reconstruction.cpp) +- [x] [tests/anomaly_sr_roundtrip.cpp](tests/anomaly_sr_roundtrip.cpp) +- [x] [tests/anomaly_sr_runtime_api.cpp](tests/anomaly_sr_runtime_api.cpp) + +**Rust review findings (18)** + +- [x] **Altitude | Medium | Report whether failed constant correction restored all engine state.** A failed vector or dirty-byte write triggers restoration of every touched slot. Slot::restore discards the result of both native writes, and sr_swap.rs:1125 receives the same false for untouched data and a partially corrected live buffer. Return distinct clean-refusal and incomplete-rollback outcomes, retain enough state to verify or retry restoration while the staging buffers are valid, and surface incomplete restoration to the swap owner. [games/anomaly/src/sr_reconstruction.rs:85](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_reconstruction.rs#L85) + +- [x] **Duplication | Medium | Resolve Anomaly's vendor runtime directories once for SR and FG.** SR configuration at games/anomaly/src/sr_stage.rs:932 calls its own three-key directory resolver. FG repeats the SRStreamlineDir, SRFidelityFXDir and SRXeSSDir mapping and the adjacent ReScaleFrame subdirectory fallbacks in games/anomaly/src/fg_stage/options.rs:136 and :156. FG converts path units to a lossy String, then re-encodes them to reuse the SR normalization routine at :224. Both stages depend on the same package layout. Extract a shared UTF-16 resolver with an injected INI reader, then let SR keep PathBuf and convert once at FG's UTF-8 boundary. Leave the FG capture directory's verbatim-path behavior separate. [games/anomaly/src/sr_stage.rs:374](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage.rs#L374) + +- [x] **Boundaries | Medium | Give the remaining Anomaly SR keys overlay rows.** AGENTS.md Rule 2 requires every option an integration reads to have a live overlay control. A restart-only option still needs a control that says so and saves the value. Ini::options reads several numeric and toggle keys from the [Anomaly] INI with no row in the shared panel: SRScale (sr_stage.rs:455, :397, re-read only after a device reset at :1416), SRStageCaptureStart/Count/Interval (:459-465), SRCutDistance and SRCutAngle (:474-475) and SRRequireSignature (:476). register_live_options at :2711 adds only colour transport, exposure, first-person zero, jitter, mip bias and mip offset. adapter_options.rs:62-125 adds only SRStage and SRStageCapture. The cut thresholds decide when Stage 4/5 resets history, and SRScale sets the Stage 2/3 render size. Today both can be tuned only by editing the INI and forcing a device reset or a restart. The adapter registers 25 of the RSF_OVERLAY_SERVICE_OPTION_LIMIT (32) rows, which leaves room for these seven. [games/anomaly/src/sr_stage.rs:455](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage.rs#L455) + +- [x] **Altitude | Medium | Make native guard availability part of SR stage admission.** The generic leaf! fallback treats a missing pointer-returning callback as null. verify_guards has the opposite convention: null means every guard passed. Stage::register accepts the raw platform table, so a partially populated table can reach installation without the required guard check. Require the guard callback when binding the platform or use a typed outcome that distinguishes unavailable verification, a failed site and verified success. [games/anomaly/src/sr_stage.rs:1145](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage.rs#L1145) + +- [x] **Duplication | Medium | Share the frame-dump admission transaction between Anomaly SR and motion.** SR capture_arm and games/anomaly/src/motion/stage/capture.rs:102 independently abandon unfinished captures, poll DumpApi, raise a scheduled request, check requested, begin the record and spend the scheduled budget only after acceptance. SR increments from world frames and suppresses scheduled requests during loading; motion counts native main-frame/generation identities and requires a written target. Keep those predicates and the distinct resource metadata with each stage, but give their existing frame_dump::DumpApi one operation taking the record and scheduled flag and returning whether a request was accepted. Preserve manual F10 requests when scheduling is false and share acceptance/retry fixtures. [games/anomaly/src/sr_stage.rs:1599](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage.rs#L1599) + +- [x] **Altitude | Medium | Pass the seam operation directly between its two Rust owners.** controller_seam wraps the locked State in a raw cookie. sr_stage.cpp:447 stores it in a shared Host field, invokes the C++ SwapController facade, re-enters Rust Swap::seam, then calls back through Host::upscale or round_trip into Rust to reconstruct the mutable State reference. Correctness depends on an undocumented-in-types synchronous call stack and clearing the cookie before it expires. Let Swap::seam accept a scoped Rust operation borrowing the stage state, and retain native leaves for the engine and D3D operations it performs. [games/anomaly/src/sr_stage.rs:1784](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage.rs#L1784) + +- [x] **Altitude | Medium | Publish the actual bilinear fallback result.** temporal_seam increments the driver's bilinear count before draw_pass(UPSCALE) returns. A reinsertion refusal also sets the status text to 'bilinear fallback drawn' before attempting that draw. If state capture or the fallback pass fails, the swap owner reports no world image while driver diagnostics report a fallback draw. Submit one fallback outcome including its initiating reason after draw_pass returns and distinguish attempted, succeeded and failed recovery. [games/anomaly/src/sr_stage.rs:1944](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage.rs#L1944) + +- [x] **Boundaries | Medium | Let the Runtime choose and default the Anomaly SR backend.** AGENTS.md Rule 3 gives the orchestrator the choice of SR backend and every other vendor policy. The Anomaly adapter makes that choice itself. Ini::options at sr_stage.rs:479-492 sanitizes the shared SRBackend key with an adapter fallback of DLSS (BACKEND_DLSS) whatever the GPU. Stage::choices at :2572-2610 decides which vendors are offered by probing vendor file names (sl.interposer.dll plus nvngx_dlss.dll, amd_fidelityfx_upscaler_dx12.dll plus amd_fidelityfx_loader_dx12.dll, libxess.dll) in the adapter-resolved vendor directories. When the saved backend is not offered, it substitutes its own order: DLSS, XeSS, FSR3, FSR4. RSF_ANOMALY_SR_ADAPTER_BACKENDS (sr_stage_abi.rs:27 = 58) also leaves out RSF_SR_AUTO. The Runtime already owns this policy in rsf_gpu_select_sr_backend (runtime/orchestrator/src/lib.rs:385): it prefers DLSS on NVIDIA, XeSS on Intel and FSR3 otherwise. Concrete effect: on an AMD GPU with the full vendor package installed, Anomaly Stage 5 defaults to DLSS, which only fails once the pipeline starts, while every Runtime-hosted game picks FSR3. Report the installed vendor directories as facts, offer Auto, and take the default and fallback from the Runtime. [games/anomaly/src/sr_stage.rs:2572](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage.rs#L2572) + +- [x] **Duplication | Medium | Derive the overlay mip-bias range from the SR option bounds.** The SRMipBias parser at games/anomaly/src/sr_stage.rs:431 uses clamp_mip_offset at games/anomaly/src/sr_stage/math.rs:68, whose generated limits are -2.0 and +1.0 at games/anomaly/src/sr_stage_abi.rs:11. The live overlay separately hardcodes minimum=-20, maximum=0 and divisor=10, so a supported +0.5 can be read from the INI but cannot be selected in the panel. Generate the integer panel bounds from the same constants and scale factor, and use that factor for getter/setter conversion. Cover both endpoints and a positive value through the descriptor. [games/anomaly/src/sr_stage.rs:2769](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage.rs#L2769) + +- [x] **Altitude | Medium | Keep pending GPU query results distinct from terminal failures.** The timer_clock and timer_timestamp callbacks in sr_stage.cpp:490-500 collapse every HRESULT other than S_OK into false. Ring::collect interprets false as still pending and never frees the slot. A permanently failed query eventually leaves the cursor stuck on that slot and all subsequent timing intervals skipped until device replacement. Return ready, pending or failed; recycle or recreate failed queries and count their samples as skipped. [games/anomaly/src/sr_stage/gpu_timer.rs:70](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage/gpu_timer.rs#L70) + +- [x] **Duplication | Medium | Exercise the production Win32 INI callbacks in the SR package test.** The disk-backed Windows fixture at games/anomaly/src/sr_stage/tests.rs:1191 installs its own GetPrivateProfileIntW/StringW wrappers. Production registers games/anomaly/src/ini.rs:67 and :77 at games/anomaly/src/sr_stage.cpp:597. The copies already widen names differently: the test decodes UTF-8, while production widens individual bytes. All current test keys are ASCII, so it can pass after a production callback regression. Expose the two real leaves within the crate and point this fixture's platform table at them, keeping the in-memory reader for scenarios that intentionally inject fake INI responses. [games/anomaly/src/sr_stage/tests.rs:1151](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage/tests.rs#L1151) + +- [x] **Altitude | Low | Create only the depth state required by temporal preparation.** Pass::new has already acquired the rasterizer and blend state that Pass::draw uses for all draws. Compiler::temporal calls States::new again just for no_depth, crossing the device boundary to create two extra states and immediately dropping them. Failure to create either unused state disables the temporal path. Request the no-depth state directly and keep the existing shared rasterizer and blend leases. [games/anomaly/src/sr_d3d11/passes.rs:118](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_d3d11/passes.rs#L118) + +- [x] **Altitude | Low | Store the creating device in the temporal target cache key.** sr_stage.rs:1984 calls TemporalTargets::matches while preparing a temporal frame. The owner stores both extents and format but omits the device passed to new, so each lookup crosses FFI to get the device from its own color texture and releases the returned COM reference. Retain the creating device identity alongside the other key fields for the lifetime of these textures and match it directly. [games/anomaly/src/sr_d3d11/targets.rs:661](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_d3d11/targets.rs#L661) + +- [x] **Duplication | Low | Read swap counter buckets with the same constants used to increment them.** The SR stage declares six skip and six restore indices by hand at games/anomaly/src/sr_stage.rs:63 and :69, then reports those array elements at :2456 and :2465. The swap controller uses the generated constants at games/anomaly/src/sr_swap_abi.rs:11 and :18 when recording skips and restoring the seam at games/anomaly/src/sr_swap.rs:872 and :1054. If ABI bucket assignments change, counts can silently appear under the wrong labels. Import the generated constants for reporting and convert to usize only at the indexing boundary. [games/anomaly/src/sr_stage.rs:63](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage.rs#L63) + +- [x] **Simplicity | Low | Anomaly SR stage state is an Option that every accessor lazily recreates.** `Stage::state` is `Mutex>>` only so `Stage::new` can be `const`; nothing ever stores `None` again, yet eleven call sites (`with`, `install`, `quiesce`, `prepare`, `seam`, `combine_end`, `frame_end`, `report` and others, e.g. sr_stage.rs:855, 1119, 1215, 1359, 1693, 1794, 2183, 2232, 2393) repeat `guard.get_or_insert_with(Default::default)` before touching it. `install` also drops the guard and immediately re-locks it (sr_stage.rs:1213-1215) with nothing in between. Make the field `LazyLock>` (`LazyLock::new` is const) or `Mutex` built by a const-friendly `State::new`, so accessors use `self.lock()` directly and `install` keeps one guard. Same behavior: the first access still creates the default state; the tradeoff is none beyond losing the never-used ability to drop the boxed state. [games/anomaly/src/sr_stage.rs:692](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage.rs#L692) + +- [x] **Quality | Low | Reset the GPU timing report baseline when the D3D11 device changes.** Timer::begin resets accumulated milliseconds and sample counts when the device changes (sr_stage/gpu_timer.rs:122), but report retains the previous device totals. After a report with one swapped sample, the first report on a replacement device with no samples prints n=18446744073709551615; if enough new samples arrive first, even the computed average can use milliseconds from the wrong device. Reset or generation-tag the timing baseline together with the ring. The test named report_emits_deltas_and_survives_a_timer_reset has no query leaves and never switches device: exercise the replacement after a nonzero sample and assert the count and average. [games/anomaly/src/sr_stage.rs:2478](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage.rs#L2478) + +- [x] **Duplication | Low | Share the Halton sample calculation used by Anomaly and Skyrim.** Anomaly generates centered base-2/base-3 pixel jitter at games/anomaly/src/sr_stage/math.rs:112 and Skyrim converts the same sequence into signed projection offsets at games/skyrim-se/src/resolution.rs:228. Their digit loops at math.rs:85 and games/skyrim-se/src/resolution.rs:123 differ in precision, and only the externally callable Anomaly path handles bases below two. Put the radical-inverse calculation in a shared math module, preserve the existing arithmetic precision or verify the float differences with sequence vectors, and keep indexing, phase counts and projection signs with each adapter. [games/anomaly/src/sr_stage/math.rs:85](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage/math.rs#L85) + +- [x] **Altitude | Low | Keep mapped row data inside the mapping guard.** map returns a Copy Layout containing the mapped pointer and row pitch both inside Mapping and as an independent tuple element. The burst writer consumes Mapping with is_some_and, which unmaps the texture, then continues using the independent Layout for dimensions. Those dimensions stay valid, but the same object still exposes an expired row pointer. Return pointer-free descriptor metadata separately and expose mapped rows only through a borrow of Mapping. [games/anomaly/src/sr_stage/staging.rs:160](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_stage/staging.rs#L160) + + + +### N07 · Anomaly SR swap, jitter and temporal history + +Port swap ownership, projection jitter, temporal history and tonemap routing. Address engine references before releasing twin resources. + +**Coordinate shared edits** + +- Motion history, shader identity and published frame resources ([N04](#n04), [N05](#n05), [N08](#n08)). +- SR target publication, swap rollback and engine-owned texture fields ([N06](#n06)). + +**Port files (7)** + +- [x] [games/anomaly/src/sr_jitter.h](games/anomaly/src/sr_jitter.h) (removed; the published jitter types are C declarations in `sr_stage_platform.h` and the units are documented in `sr_stage.h`) +- [x] [games/anomaly/src/sr_swap.cpp](games/anomaly/src/sr_swap.cpp) +- [x] [games/anomaly/src/sr_swap.h](games/anomaly/src/sr_swap.h) (C declarations only: world slot order and the Rust engine layout entry) +- [x] [games/anomaly/src/sr_swap_platform.h](games/anomaly/src/sr_swap_platform.h) +- [x] [games/anomaly/src/sr_temporal.cpp](games/anomaly/src/sr_temporal.cpp) +- [x] [games/anomaly/src/sr_temporal.h](games/anomaly/src/sr_temporal.h) +- [x] [games/anomaly/src/sr_tonemap.h](games/anomaly/src/sr_tonemap.h) + +**Fixtures (6)** + +- [x] [tests/anomaly_sr_jitter_reference.h](tests/anomaly_sr_jitter_reference.h) (independent native projection oracle) +- [x] [tests/anomaly_sr_jitter.cpp](tests/anomaly_sr_jitter.cpp) +- [x] [tests/anomaly_sr_jitter_device.cpp](tests/anomaly_sr_jitter_device.cpp) +- [x] [tests/anomaly_sr_swap.cpp](tests/anomaly_sr_swap.cpp) +- [x] [tests/anomaly_sr_temporal_device.cpp](tests/anomaly_sr_temporal_device.cpp) +- [x] [tests/anomaly_temporal_tests.cpp](tests/anomaly_temporal_tests.cpp) + +**Rust review findings (9)** + +- [x] **Altitude | High | Retain twin resources while any engine field may still reference them.** Swap::restore records a write fault if restoring CRT/CTexture fields or globals fails, but unconditionally closes the window and increments its restore counter. Shutdown then skips further restoration on that closed window and calls release_twins, while an engine field may still hold the old borrowed surface or view. Track incomplete restoration separately from closed, retain the twin leases until all affected fields are verified restored and return that cleanup outcome to quiesce. [games/anomaly/src/sr_swap.rs:843](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_swap.rs#L843) + +- [x] **Duplication | Medium | Run the projection-jitter conformance cases against the Rust implementation.** Main and first-person world swaps call the Rust jitter_projection in games/anomaly/src/sr_swap.rs:95, while the numerical and device fixtures call a distinct C++ implementation at games/anomaly/src/sr_jitter.h:97. In tests/anomaly_sr_jitter.cpp:110 the expected value and jitter_engine_projection both call temporal::jitter_projection on the same transposed input, so that comparison cannot detect disagreement in Rust. Keep the C++ implementation as an independent oracle for the existing swap integration tests, and run the actual Rust function against the perspective, orthographic and refusal vectors, using a narrow test entry or Rust unit tests. The device fixture at tests/anomaly_sr_jitter_device.cpp:217 can then exercise the production transform as well. [games/anomaly/src/sr_swap.rs:95](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_swap.rs#L95) + +- [x] **Altitude | Medium | Invalidate the engine's texture-cache ranges as ranges.** Each Stage 2 exchange and restoration sends 86 guarded write calls across FFI to invalidate RCache. The a_failed_exchange_rolls_every_write_back fixture confirms that 84 of these clear individual pointer slots in six contiguous ranges. The native write leaf already accepts a byte length. Clear each verified range with a bounded zero-filled span, preserving neighboring fields, handling partial failures and keeping table layout policy in the adapter. [games/anomaly/src/sr_swap.rs:576](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_swap.rs#L576) + +- [x] **Quality | Medium | Roll back a world swap when clearing the engine binding caches fails.** After exchanging the targets and dimensions, prepare calls invalidate_caches. A guarded write failure records a refusal there, but prepare continues, increments swapped and returns true for this frame. The engine can reuse an old SRV or constants table while rendering with the twin targets and reduced viewport. Return the cache invalidation result and close the exchange before allowing the engine to draw. Add a fixture that refuses a backend cache write during prepare. [games/anomaly/src/sr_swap.rs:1030](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_swap.rs#L1030) + +- [x] **Quality | Medium | Preserve the already rendered world when sun-camera recovery closes the swap.** A sun-begin or sun-end failure closes the world window after geometry has drawn into reduced targets. close_with_output restores pointer bindings and viewport, then the later seam sees open=false and skips the only transfer from twins to engine targets. World colour, position and depth produced before the failure are therefore missing from subsequent passes. Preserve the twins through the seam or perform a verified transfer before resuming stock drawing. sun_refusal_returns_the_frame_to_output_size checks memory and viewport restoration only; assert the recovery transfer and its inputs as well. [games/anomaly/src/sr_swap.rs:1164](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_swap.rs#L1164) + +- [x] **Quality | Medium | Restore the first-person camera after a partial rmNear jitter update.** The registered rmNear callback can write the jittered first-person projection successfully and then fail to write the full transform or upload the projection. fault only disables later swaps. The current first-person draw resumes with engine matrices or cached projection from different updates. Save the original first-person pair before mutation, attempt to restore both and the uploaded projection on any failure, and cover failure on the second write and upload in the fixture. [games/anomaly/src/sr_swap.rs:1227](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_swap.rs#L1227) + +- [x] **Duplication | Medium | Give the Anomaly SR stage and swap controller the same frame-facts and counters types.** Two independent C headers define the same 152-byte frame facts and 352-byte counters, yielding games/anomaly/src/sr_swap_abi.rs:116 and :373 and games/anomaly/src/sr_stage_abi.rs:333 and :513. At games/anomaly/src/sr_stage.cpp:412 the bridge copies every frame field into FrameFacts before games/anomaly/src/sr_swap.cpp:110 passes it on to Rust; at sr_stage.cpp:466 it copies every counter back, mostly by positional aggregate initialization. A new member can remain silently zero on one path. Use one game-local C declaration per payload with typedefs for the existing names, import the shared generated types in both Rust modules and pass/copy each struct directly. [games/anomaly/src/sr_swap_abi.rs:116](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_swap_abi.rs#L116) + +- [x] **Duplication | Medium | Use the SR settings binding throughout Anomaly's temporal driver.** The temporal driver manually declares the four fields already generated at games/anomaly/src/sr_stage_abi.rs:40 and copies options.initial field by field at games/anomaly/src/sr_temporal.rs:758. Live updates take another route: games/anomaly/src/sr_stage.cpp:548 copies the same fields into C++ SrSettings and games/anomaly/src/sr_temporal.cpp:93 sends them back to Rust as the manual Settings record. A later field can disappear on either route. Use the common C record/binding for transport and retain the temporal driver's nonzero defaults, equality and admission behavior through explicit helpers. [games/anomaly/src/sr_temporal.rs:145](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_temporal.rs#L145) + +- [x] **Quality | Low | Report the current Anomaly exposure and first-person motion settings.** The Stage 5 report reads exposure_auto and first_person_zero from the copy set by rsf_anomaly_sr_configure. The live overlay setters update the stage atomics in sr_stage.rs:1043-1050, and subsequent draws use those atomics while reports keep printing the startup settings. Read the live snapshot when generating the report or propagate changes to the reporting owner. Assert the reported values after toggling each control. [games/anomaly/src/sr_temporal.rs:1125](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/sr_temporal.rs#L1125) + + + +### N08 · Anomaly frame generation + +Port FG configuration, window and input ownership, and the generation-stage calls and fixtures. + +**Coordinate shared edits** + +- Anomaly session startup, quiesce and callback retirement ([N01](#n01), [N02](#n02), [N03](#n03), [N04](#n04), [N06](#n06)). +- Motion history, shader identity and published frame resources ([N04](#n04), [N05](#n05), [N07](#n07)). + +**Port files (7)** + +- [x] [games/anomaly/src/fg_inputs.cpp](games/anomaly/src/fg_inputs.cpp) +- [x] [games/anomaly/src/fg_inputs_platform.h](games/anomaly/src/fg_inputs_platform.h) +- [x] [games/anomaly/src/fg_policy.h](games/anomaly/src/fg_policy.h) +- [x] [games/anomaly/src/fg_policy_platform.h](games/anomaly/src/fg_policy_platform.h) +- [x] [games/anomaly/src/fg_stage.h](games/anomaly/src/fg_stage.h) +- [x] [games/anomaly/src/fg_stage_platform.cpp](games/anomaly/src/fg_stage_platform.cpp) +- [x] [games/anomaly/src/fg_stage_platform.h](games/anomaly/src/fg_stage_platform.h) + +**Fixtures (2)** + +- [x] [tests/anomaly_fg_device.cpp](tests/anomaly_fg_device.cpp) +- [x] [tests/anomaly_fg_policy.cpp](tests/anomaly_fg_policy.cpp) + +**Rust review findings (8)** + +- [x] **Altitude | Medium | Distinguish a constant-buffer allocation failure from a permanent shader refusal.** Pipeline::create collapses shader creation and constant-buffer allocation into None. Owner::run turns either into a latched Shader result until device replacement. The refused_constant_buffer_releases_shader_and_latches_on_same_device test clears the simulated allocation failure and confirms that no later dispatch runs. Return the failing operation from pipeline creation, report resource failures as Resources and allow allocation to retry on the same device. [games/anomaly/src/fg_inputs.rs:212](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/fg_inputs.rs#L212) + +- [x] **Altitude | Medium | Count tag eligibility separately from completed tagging.** Policy::ui_boundary increments tagged before fg_stage checks that a live swapchain, immediate context or backbuffer exists. Even a frame refused by the first live_chain check increments the published tagged counter without making a final-scene pass call. The stage already exposes runtime_tagged from actual runtime status. Name the adapter counter eligible_at_ui_boundary or increment an accepted-pass counter only after both pass notifications succeed, and use the runtime count for completed tags. [games/anomaly/src/fg_policy.rs:164](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/fg_policy.rs#L164) + +- [x] **Simplicity | Medium | Anomaly FG keeps validated Option tables and unwraps them at every call.** `Tables::bind` (fg_stage.rs:77-105) rejects any missing present/FG leaf, but `Tables` stores the raw bindgen structs, so roughly twenty call sites re-open the Option with `.unwrap()`: `fg.set_log/options` and `present.install` (386-388), `is_owner` (407), `cpu` (429), `pass` (450), `bind_source` (454), `inputs_ready` (463), `capture` (535), `dump_inputs` (559), `status` (585), `has_owner/backend/backend_choices` (595-597, 848, 1165-1167), `present_event` (716). The same pattern covers the native `rsf_anomaly_fg_platform` (`sr_owns_depth`, `engine_depth_view`, `depth_texture`, `motion_target`, `immediate_context`, `backbuffer`, `output_window` at 474-506, 1004-1054) and `rsf_anomaly_input_platform` inside fg_inputs.rs (`describe/device/same_device/motion_view/dispatch` unwraps at 146-250 next to `?` checks of the other leaves at 45-48 and 102-104), except those platform tables are never validated at all, so a short native table would panic across `extern "C"`. Build one `Bindings` struct of plain fn pointers at install (from `Tables::bind`, the platform and its `inputs` table, failing install if any is missing) and call fields directly. This removes the unwrap noise and the mixed `?`/`unwrap` styles, and turns the unchecked platform leaves into a single install-time refusal; behavior for complete tables is unchanged. [games/anomaly/src/fg_stage.rs:71](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/fg_stage.rs#L71) + +- [x] **Altitude | Medium | Accept FG input resources without requiring a DLSS SR frame.** Anomaly's SR-off input pass produces depth and motion for the selected FG backend. To call the generic D3D11 FG table, the adapter constructs a 488-byte rsf_dlss_frame with unused SR quality, preset, color and exposure fields; camera and identity travel separately in the GameSDK pass. This couples an FG producer to the DLSS SR ABI version and offers two places for dimensions or camera facts to disagree. Add a versioned, vendor-neutral FG resource descriptor to the runtime capture service and adapt existing SR-frame callers at the runtime boundary. [games/anomaly/src/fg_stage.rs:521](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/fg_stage.rs#L521) + +- [x] **Altitude | Medium | Keep inferred frame closure out of simulation timing events.** When the next CInput::OnFrame arrives with a different native frame and the previous source never rendered, stage_input_begin emits SIMULATION_END for the old source. Stage::cpu stamps that event with QPC at the new input callback. This gives the latency consumer a simulation-end time that was never observed and can include the whole loading or idle interval. Close the bookkeeping with the skipped-frame fact, and let the runtime mark simulation end unavailable unless a verified end callback supplied it. [games/anomaly/src/fg_stage.rs:877](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/fg_stage.rs#L877) + +- [x] **Duplication | Medium | Share X-Ray window identification across the overlay and FG bridge.** The FG bridge callback registered at games/anomaly/src/fg_stage.rs:364 checks HWND validity, current process ID and exact _XRAY_1.5 class before attaching its subclass. games/anomaly/src/overlay.rs:1181 duplicates all three checks and the class name for the overlay paths at :1094 and :1121. A class or admission-rule update must otherwise stay synchronized to prevent the overlay and presentation bridge from selecting different windows. Use one game-local predicate; keep subclass registration and borderless correction exclusively in the FG callback. [games/anomaly/src/fg_stage/window.rs:23](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/fg_stage/window.rs#L23) + +- [x] **Altitude | Medium | Tie the cached subclass registration to the window lifetime.** accept_window skips SetWindowSubclass whenever the HWND equals the last successfully subclassed value. The subclass never clears that value on WM_NCDESTROY. If X-Ray recreates its window and Windows reuses the handle, the presentation bridge accepts the new window without its message observer or placement correction. Clear the matching registration when the window dies, or query the actual subclass association instead of relying on a process-wide last HWND. [games/anomaly/src/fg_stage/window.rs:42](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/fg_stage/window.rs#L42) + +- [x] **Simplicity | Low | Anomaly FG options round-trip INI values through the native config and several string encodings.** `Options::read` fills an `rsf_anomaly_fg_config` (the C struct for the native `rsf_anomaly_fg_configure` path, with its pointer fields left null) only so `admit` can copy the same fields back out (options.rs:119-135, 173-207). The directory values then travel PathBuf -> `encode_wide` Vec -> lossy String (146) -> `encode_utf16` Vec -> `sr_stage::plain_directory` -> lossy String (225-226) -> CString (229), while `from_native` goes wide -> String -> UTF-16 -> String again. Have both entry points produce a small Rust `Settings` value (or call `admit` with typed arguments) instead of the C struct, and keep each directory as UTF-16 until one final `plain_directory` + UTF-8 CString conversion. Same outputs, one fewer mirrored struct and three fewer encoding passes per directory. [games/anomaly/src/fg_stage/options.rs:115](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/anomaly/src/fg_stage/options.rs#L115) + + + +### F01 · Fallout 4 startup and CPU ownership + +Port session creation, CPU event routing and worker handoff. Address the worker name collision first. + +**Coordinate shared edits** + +- World and Present identity shared by CPU admission, pass publication and recovery ([F02](#f02), [F03](#f03)). +- Steam chain installation and cold device creation ([S01](#s01), [I01](#i01)). + +**Port files (8)** + +- [x] [games/fallout4/src/cpu_events.cpp](games/fallout4/src/cpu_events.cpp) (C++ deleted; the ten detour shells and the PeekMessageA thunk are now the C11 leaf `cpu_events.c`, which runs each exit in a `__finally` and delivers through the shared foreign-exception filter in `native_guard.h`) +- [x] [games/fallout4/src/cpu_events.h](games/fallout4/src/cpu_events.h) +- [x] [games/fallout4/src/cpu_events_platform.h](games/fallout4/src/cpu_events_platform.h) +- [x] [games/fallout4/src/fallout4_platform.h](games/fallout4/src/fallout4_platform.h) +- [x] [games/fallout4/src/host_boundary.cpp](games/fallout4/src/host_boundary.cpp) (typed creation call and foreign exception guards; C++ deleted, now the C11 leaf `host_boundary.c` with `__try` guards filtered to the C++ exception code, and the creation call keeps its uncaught noexcept outcome) +- [x] [games/fallout4/src/native_creation.cpp](games/fallout4/src/native_creation.cpp) +- [x] [games/fallout4/src/native_creation.h](games/fallout4/src/native_creation.h) +- [x] [games/fallout4/src/plugin.cpp](games/fallout4/src/plugin.cpp) + +**Rust review findings (11)** + +- [x] **Quality | High | Fix the worker name collision that prevents the Fallout 4 adapter from compiling.** Inside native_cycle the local worker variable at line 459 has type usize and shadows the module function worker(). The join-retry branch calls worker(), which therefore tries to call an integer. This affects the module included by the Fallout 4 crate even when the branch never executes. Rename the address to worker_address or qualify the lock helper as self::worker(). Identified by source inspection. [games/fallout4/src/cpu_events.rs:511](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/cpu_events.rs#L511) + +- [x] **Altitude | Medium | Give every native CPU callback an unwind-safe retirement guard.** raw_enter increments ENTERED and RAW_WRITERS, but observe_raw in cpu_events.cpp:56-63 calls raw_exit only after the native original returns normally. The idle and poll shells likewise leave Rust counters and TLS scopes open on a C++ unwind. If the engine catches that exception outside the detour, later input attribution and quiescence can remain blocked. Use native RAII for unconditional cleanup as observe_swap already does, keeping normal-return observation separate from cancellation cleanup. [games/fallout4/src/cpu_events.rs:1695](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/cpu_events.rs#L1695) + +- [x] **Duplication | Medium | Use one Fallout 4 CPU identity for worker handoff and render validation.** The worker ticket's session, source, submission, begin QPC and frequency repeat the generated record at games/fallout4/src/cpu_abi.rs:21. games/fallout4/src/cpu_events.rs:2959 copies all five fields out, :2946 copies them back, and :2747 repeats their equality test. The resolution producer performs this round trip at games/fallout4/src/resolution.rs:483 and :487. Use the generated record as the Rust identity with ZERO and equality support, retaining separate checks for rendered state and nonzero source/submission. Adding an identity field would then automatically reach the handoff and comparison paths. [games/fallout4/src/cpu_events/handoff.rs:10](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/cpu_events/handoff.rs#L10) + +- [x] **Duplication | Medium | Share Fallout 4's exact-build renderer address definitions.** CPU handoff reads the renderer pointer and checks its expected object in games/fallout4/src/cpu_events.rs:495 using the RVAs at games/fallout4/src/cpu_events/native.rs:53. Resolution repeats both literals at games/fallout4/src/resolution.rs:124, as do depth-domain reads at games/fallout4/src/depth_domains.rs:758 and :1287. The creation hook at games/fallout4/src/creation.rs:31 shares the pointer RVA but legitimately permits a cold null owner. Keep the verified RVAs and native member offsets in one Fallout 4 build-layout module and import them at each consumer, retaining cold-owner behavior and each probe's guarded read order. [games/fallout4/src/cpu_events/native.rs:53](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/cpu_events/native.rs#L53) + +- [x] **Duplication | Medium | Bind Fallout 4 CPU hook targets to their verified entry bytes.** hook_target at games/fallout4/src/cpu_events.rs:100 reads HOOK_RVAS, while guards at games/fallout4/src/cpu_events/native.rs:269 independently repeat the entry addresses. PlayerControls is listed at :18 and its identical nine-byte guard is copied at :339 and :370, so start at games/fallout4/src/cpu_events.rs:3238 checks the same entry twice. Updating only the target table can verify one address and pass a different one to the hook creator. Keep each hook's address with its byte expectation in a single indexed descriptor; reference that descriptor wherever a separate notification preflight needs it and keep caller-site guards distinct. [games/fallout4/src/cpu_events/native.rs:339](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/cpu_events/native.rs#L339) + +- [x] **Simplicity | Medium | Fallout 4 and remaining Anomaly leaf tables are validated complete, then every call re-handles a missing leaf.** Same pattern as the AC7 and Anomaly FG/motion entries, in tables not yet listed. Fallout 4: Ops is documented as "every entry is present" after Ops::complete (lib.rs:89), yet all 13 wrappers re-handle None via ok_or(Threw), is_some_and or an E_FAIL arm (lib.rs:105-229), and creation.rs:290/303/333 wraps already non-Option Begin/End/Bind back in Some(..) to pass them through; cpu_events.rs:76 complete() then hook_created/peek_thunk/finish_render_scope/deliver/create/remove re-check (105-118, 651, 3225, 3283); depth_domains.rs:443 and render_inputs.rs:433 Leaves::complete gate every FFI entry (depth_domains.rs:1798, render_inputs.rs:1667), yet each leaf wrapper falls back to zero facts or a skipped call. Anomaly: sr_swap.rs:1249 platform_valid proves 10 leaves, then read/write/set_viewport/upload/mip/make/drop/round_trip/upscale/correct silently return false when None (273-323, 592, 950, 1060, 1080, 1124); sr_temporal.rs:91 validate_api proves 12 leaves, then 10 sites .expect("validated ..."). The dead branches also blur intent: a missing leaf in sr_swap reads as an engine write fault. Simpler: convert once at publish/create into a struct of plain extern fn pointers, as render_hooks.rs:266 (Fallout 4) already does, and call them directly. Tradeoff: tests that build partial tables must supply every leaf (sr_swap/tests.rs and the Fallout 4 fakes already do). [games/fallout4/src/lib.rs:75](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/lib.rs#L75) + +- [x] **Duplication | Medium | Centralize the unsafe Win32 typed-export lookup used by Rust adapters.** Fallout 4 resolves host functions at games/fallout4/src/session.rs:248 through a safe generic helper at :93 that accepts a raw name pointer and arbitrary pointer-sized Copy return type. RDR2 uses equivalent GetProcAddress and transmute_copy logic at games/rdr2/src/runtime_worker.rs:159 for the session prepare call at :174. Anomaly adds a NUL check at games/anomaly/src/runtime_module.rs:63, and Unity Mono already accepts &CStr at games/unity-mono/src/mono.rs:88. Use one unsafe resolver over a borrowed live HMODULE and &CStr, documenting the required function signature; keep each adapter's symbol list, ownership and missing-export behavior local. Size assertions alone cannot verify the ABI of the resolved function. [games/fallout4/src/session.rs:93](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/session.rs#L93) + +- [x] **Altitude | Medium | Verify the Fallout 4 executable once per preparation transaction.** A successful Session::prepare invokes the full executable hash four times: directly, through verify_with_inputs, again through render_hooks::prepare and finally through cpu_events::prepare. Each invokes file_sha256 on the running executable before startup can proceed. Pass an exact-build admission result to the three subsystem preparation functions and keep live byte, owner and cold-device checks at their respective use sites. [games/fallout4/src/session.rs:213](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/session.rs#L213) + +- [x] **Simplicity | Low | Fallout 4 worker ticket transitions take proof flags production always passes as true, plus ignored inputs.** reserve(constructed), arm(native_valid), begin, bind, consumed, complete and join each take a bool that only short-circuits to false; every production call in cpu_events.rs passes the literal true (1275, 1356, 1501, 1551, 1589, 2529, 2715) because the caller already folded its proof into the preceding && chain. Only handoff/tests.rs passes false. protects_bound also takes _revision and _queued that it ignores, so bound_current_valid (cpu_events.rs:894) reads QUEUE_SEQUENCE into a value nobody compares, and predecessor_raw is stored under allow(dead_code) and never read. Simpler: drop the bool and unused parameters and the dead field; callers already refuse before calling, and tests express a failed proof by not calling the transition. Tradeoff: the Rust signatures stop matching the ported worker_handoff.h test vocabulary. [games/fallout4/src/cpu_events/handoff.rs:176](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/cpu_events/handoff.rs#L176) + +- [x] **Duplication | Low | Make the Fallout 4 log-message constructor return a C string.** message strips interior NULs and appends a terminator, but returns Vec. CPU diagnostics in games/fallout4/src/cpu_events.rs:196, cold-creation reporting in games/fallout4/src/creation.rs:312 and DPI reporting in games/fallout4/src/dpi.rs:166 each rescan the constructed bytes with CStr::from_bytes_with_nul before invoking the same host log. Return an owned CString or provide an Ops helper accepting the formatted String so the conversion happens once. Preserve DPI's propagation of a native log failure and the other callers' best-effort behavior. [games/fallout4/src/lib.rs:275](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/lib.rs#L275) + +- [x] **Quality | Low | Send Fallout 4 cold-prepare refusals to the requesting host.** Session::prepare routes executable mismatch, cold-owner mismatch, render-guard failure and hook-init failure through refuse before create_host installs self.services. On first prepare self.services.log is null, so the C++ log leaf silently skips the reason even when args.host provided a logger. Pass the current prepare host to the refusal logger and keep the stored reason available through status. [games/fallout4/src/session.rs:122](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/session.rs#L122) + + + +### F02 · Fallout 4 render inputs and resolution + +Port camera, depth domains, render-input selection and resolution recovery with the matching fixtures. + +**Coordinate shared edits** + +- World and Present identity shared by CPU admission, pass publication and recovery ([F01](#f01), [F03](#f03)). + +**Port files (13)** + +- [x] [games/fallout4/src/camera.h](games/fallout4/src/camera.h) +- [x] [games/fallout4/src/depth_domains.cpp](games/fallout4/src/depth_domains.cpp) (C++ deleted; the receipt formatters are the C11 leaf `depth_domains.c`) +- [x] [games/fallout4/src/depth_domains.h](games/fallout4/src/depth_domains.h) +- [x] [games/fallout4/src/depth_domains_platform.h](games/fallout4/src/depth_domains_platform.h) +- [x] [games/fallout4/src/native_input_state.h](games/fallout4/src/native_input_state.h) +- [x] [games/fallout4/src/render_inputs.cpp](games/fallout4/src/render_inputs.cpp) (C++ deleted; the reader receipts, slot accessor and lease transfer are the C11 leaf `render_inputs.c`) +- [x] [games/fallout4/src/render_inputs.h](games/fallout4/src/render_inputs.h) (only C declarations now: the `NativeInputs` lease holds raw COM pointers and moves through `rsf_fallout4_native_inputs_release` and `_move`) +- [x] [games/fallout4/src/render_inputs_platform.h](games/fallout4/src/render_inputs_platform.h) +- [x] [games/fallout4/src/resolution.cpp](games/fallout4/src/resolution.cpp) (C++ deleted; the guarded Runtime calls and the receipt text are the C11 leaf `resolution.c`) +- [x] [games/fallout4/src/resolution.h](games/fallout4/src/resolution.h) +- [x] [games/fallout4/src/resolution_platform.h](games/fallout4/src/resolution_platform.h) +- [x] [games/fallout4/src/screen.cpp](games/fallout4/src/screen.cpp) (C++ deleted; the two menu query guards are the C11 leaf `screen.c`) +- [x] [games/fallout4/src/screen.h](games/fallout4/src/screen.h) + +**Fixtures (2)** + +- [x] [tests/fallout4_camera.cpp](tests/fallout4_camera.cpp) +- [x] [tests/fallout4_input_state.cpp](tests/fallout4_input_state.cpp) + +**Rust review findings (10)** + +- [x] **Duplication | Medium | Resolve the Fallout 4 TLS render context consistently across producers.** Temporal sample at games/fallout4/src/depth_domains.rs:741 and raster recovery at :1271 both read the TLS index, block, context and global fallback. Resolution independently repeats the address walk at games/fallout4/src/resolution.rs:361. Raster and resolution reject a null slot array explicitly; the temporal path can attempt to read index*8 from a null base before failing. Extract common checked index/block resolution and context fallback, retaining the depth paths' extra TLS device-context read and preserving the ordering and diagnostic stages. Each sampling point must still take a fresh snapshot. [games/fallout4/src/depth_domains.rs:741](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/depth_domains.rs#L741) + +- [x] **Duplication | Medium | Use the same projection-to-pixel jitter conversion for Fallout 4 camera and depth admission.** The camera builder checks that only projection elements 8 and 9 vary at games/fallout4/src/camera.rs:259 and converts those differences to signed half-viewport pixel offsets at :284. Depth composition repeats both operations at games/fallout4/src/depth_domains.rs:1733 and :1736 to validate the submitted camera. A change to either axis convention or viewport scaling can therefore make valid camera frames fail depth admission. Share the pure projection comparison and pixel conversion while keeping separate native snapshots, the camera's magnitude bound, the depth comparison tolerance and stage-specific refusal reporting. [games/fallout4/src/depth_domains.rs:1736](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/depth_domains.rs#L1736) + +- [x] **Duplication | Medium | Exercise the production snapshot comparators in the Fallout 4 fixture.** games/fallout4/src/render_inputs.rs:544 and :556 decide which owner and camera fields invalidate the actual render lease at :1193, :1494 and :1628. games/fallout4/src/native_input_state.h:16 and :20 duplicate those decisions for tests/fallout4_input_state.cpp:24, whose poisoned-padding and per-element cases can pass when the production predicate regresses. Keep the C++ receipt layout and its assertions, move the additional per-field cases into the existing Rust test at render_inputs.rs:1839 and, if retaining a native padding fixture, pass its input to the actual Rust comparisons through a fixture shim. [games/fallout4/src/render_inputs.rs:556](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_inputs.rs#L556) + +- [x] **Quality | Medium | Recheck the temporal colour and motion records before publishing their lease.** read_inputs reads the colour and motion records and acquires their texture references, then rechecks State, which contains only the slot numbers. If a record is replaced in place during acquisition, the unchanged slot numbers pass and the temporal path can submit previous resources or write the old colour target. The raster recovery reader already rereads the actual records at the same mapped slots. Apply that comparison to the temporal reader and cover replacement with unchanged slot numbers; this is a source-level failure condition, not a game observation. [games/fallout4/src/render_inputs.rs:1199](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_inputs.rs#L1199) + +- [x] **Duplication | Medium | Share the colour, motion and depth lease checks across Fallout 4 input readers.** The temporal and raster entry points called at games/fallout4/src/render_inputs.cpp:240 and :253 independently assemble the same colour/motion/depth slot triples, resolve the three SRVs and validate their associated colour RTV and extents at games/fallout4/src/render_inputs.rs:1066 and :1413. The raster path intentionally restricts depth to R24, checks sample quality and requires the auxiliary surfaces, while the temporal path also admits R32 and reports individual refusal stages. A changed motion format or colour-RTV rule currently needs two edits. Share the leased-view bundle and its validation result, pass the depth/quality requirements explicitly, and leave history, auxiliary admission and reporting in their respective callers. [games/fallout4/src/render_inputs.rs:1413](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_inputs.rs#L1413) + +- [x] **Quality | Medium | Give a retained Fallout 4 resolution scope a recovery path after the frame advances.** end_output and finish_source require FrameOwner::frame_size_current to match the original native frame even on a cleanup retry. If a restore write fails at source retirement and the frame counter advances, the retry returns before clearing any pending work or decrementing OWNERS. render_admit_world rejects every new world while resolution_busy is true, and render_hooks::stop also refuses. Distinguish a same-frame write retry from a superseded frame: revalidate individual owners and written values at a safe boundary and retire writes that are proved superseded. Exercise a restore failure followed by frame advancement. [games/fallout4/src/resolution.rs:708](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/resolution.rs#L708) + +- [x] **Duplication | Medium | Publish the SDK screen-class constants once for Rust adapters.** sdk/game/include/rescaleframe/game_frame.h:58 defines the wire values. games/fallout4/src/screen.rs:16 repeats four ordinals for the classifier at :437, games/unity-mono/src/package_state.rs:55 repeats MENU and FLIGHT for :661, and games/rdr2/src/renderer.rs:42 repeats UNKNOWN and FLIGHT for :337. The producers choose screens for different reasons, but all write the same numeric field, so a stale literal silently names another screen. Expose the typed C macros through the shared rsf-game-sys bindings or a checked constant shim and import those values in each adapter. [games/fallout4/src/screen.rs:16](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/screen.rs#L16) + +- [x] **Duplication | Low | Test the motion-scale conversion that Fallout 4 actually submits.** The native fixture and the unit test at games/fallout4/src/camera.rs:675 call the exported function at :425, which derives two negated crop scales itself. The production SR input builder at games/fallout4/src/render_inputs.rs:1332 calls a different conversion at games/fallout4/src/camera.rs:394. Both use raster_transform, but a sign or axis correction can land in just one and leave the tests green. Have the export delegate to motion_to_uv after clearing its output, preserving the existing null and refusal behavior. [games/fallout4/src/camera.rs:425](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/camera.rs#L425) + +- [x] **Altitude | Low | Retain the validated depth maps with the temporal snapshot.** capture computes near, world and projection maps, including matrix inversions and forward-W bounds, solely to call is_none and discard them. make later revalidates the live source against that same immutable snapshot and repeats math(snapshot) before using the maps. Store the derived maps with an admitted temporal snapshot and consume them after the live-source checks. Keep the raster-only recovery path and all execution-time identity checks independent. [games/fallout4/src/depth_domains.rs:1612](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/depth_domains.rs#L1612) + +- [x] **Duplication | Low | Use one bitwise raster identity check for camera history.** games/fallout4/src/camera.rs:194 compares all four viewport float bit patterns and the integer crop to decide whether camera history is valid at camera.rs:330. games/fallout4/src/render_inputs.rs:585 repeats the predicate on the same CameraRaster type to decide history reset at render_inputs.rs:1256 and same-frame admission at render_inputs.rs:1298. A future raster field or signed-zero change must currently reach both predicates to keep reprojection and reset decisions consistent. Put the bitwise comparison on CameraRaster and keep the signed-zero fixture exercising that shared operation. [games/fallout4/src/render_inputs.rs:585](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_inputs.rs#L585) + + + +### F03 · Fallout 4 render hook transactions + +Port hook lifetime, render scopes, imagespace, publication and rollback in their actual callback order. + +**Coordinate shared edits** + +- World and Present identity shared by CPU admission, pass publication and recovery ([F01](#f01), [F02](#f02)). + +**Port files (3)** + +- [x] [games/fallout4/src/render_hooks.cpp](games/fallout4/src/render_hooks.cpp) (C++ deleted; the eight detours, the thread-local World with its COM leases and the guarded Runtime calls are the C11 leaf `render_hooks.c`) +- [x] [games/fallout4/src/render_hooks.h](games/fallout4/src/render_hooks.h) +- [x] [games/fallout4/src/render_hooks_platform.h](games/fallout4/src/render_hooks_platform.h) + +**Rust review findings (12)** + +- [x] **Duplication | Medium | Derive render callback return addresses from the call sites verified at startup.** games/fallout4/src/render_hooks.rs:138 independently lists the three calls into imagespace and the Effects call. Seams admit raw caller addresses using four separately maintained literals at games/fallout4/src/render_hooks/imagespace.rs:27 and :29. The same split occurs for DR/prepass in games/fallout4/src/render_hooks/producer.rs:35 versus the producer call guard table at games/fallout4/src/render_hooks.rs:111. All of these guards require a five-byte rel32 CALL. Name the call descriptors once and use their computed return RVA both in callback admission and guard fixtures; preserve each caller's separate world, argument and owner checks. [games/fallout4/src/render_hooks/imagespace.rs:27](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks/imagespace.rs#L27) + +- [x] **Altitude | Medium | Carry Effects-call admission through the matching return.** before_effects rejects a call whose manager differs from the verified engine manager. The native shell always invokes after_effects, which checks only the return address and range arguments before reporting, retiring the current recovery token and draining auxiliaries. The effects_return test passes manager zero and expects a drain. Return a call-scoped admission receipt from entry and use it at exit, including the explicit cleanup policy needed for an already-owned matching source. [games/fallout4/src/render_hooks/imagespace.rs:233](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks/imagespace.rs#L233) + +- [x] **Duplication | Medium | Pass one screen classification record between the Fallout 4 classifier and publisher.** games/fallout4/src/screen.rs:122 and games/fallout4/src/render_hooks/publication.rs:87 manually define the same five-field NativeScreen ABI and separately initialize its unknown camera sentinel. The native bridge at games/fallout4/src/render_hooks.cpp:277 simply forwards the classifier result into the publication callback's current and leased outputs. Updating either Rust declaration can change camera/fact interpretation while preserving the existing size and final-offset checks. Declare this game-local screen result once, use it on both Rust boundaries, and share the constructor for empty or refused values. [games/fallout4/src/render_hooks/publication.rs:87](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks/publication.rs#L87) + +- [x] **Altitude | Medium | Return one framebuffer lease with the facts it validates.** The HUD-less publisher calls read_framebuffer, framebuffer and framebuffer_extent separately. Each native leaf reads or overwrites the implicit world.hudless field. FrameLease holds only a callback table, so its Drop clears whichever framebuffer is in that field, and refusal reporting performs another lookup. Have acquisition return the captured identity, extent and owned lease together, and scope release to that acquisition. Preserve partial read diagnostics as part of the same result. [games/fallout4/src/render_hooks/publication.rs:486](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks/publication.rs#L486) + +- [x] **Duplication | Medium | Generate the reduced-frame transaction ABI once for the host and caller.** Fallout 4's Request and Surface at games/fallout4/src/render_hooks/recovery.rs:98 and :69 and its operation/result flags at :22 reproduce the host's request at runtime/orchestrator/src/d3d11_host_abi.rs:174, flags at :28 and surface at runtime/orchestrator/src/auxiliary_sr_abi.rs:27. games/fallout4/src/render_hooks.cpp:172 forwards the request to the very host that interprets the operation at runtime/orchestrator/src/d3d11_host.rs:1646. A changed flag or same-sized field reordering could make one side release resources the other still holds. Generate the public d3d11_host.h request, surface and constants into a shared Rust ABI module; keep native lease management and the five Fallout 4 surface roles in the adapter. [games/fallout4/src/render_hooks/recovery.rs:98](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks/recovery.rs#L98) + +- [x] **Duplication | Medium | Share the output-owner record between Fallout 4 recovery and resolution.** Resolution preflight writes the context, manager and three triangle identities at games/fallout4/src/resolution.rs:452 using the local OutputOwner declared at :76. games/fallout4/src/render_hooks.cpp:165 forwards that same object to recovery, which independently declares its layout at games/fallout4/src/render_hooks/recovery.rs:134 and compares it at SEAL and FINISH. Both size checks allow the context and manager fields to be interchanged undetected. Use one game-local repr(C) type for both Rust callers and the same C header declaration for the native bridge, retaining the existing default and whole-record equality. [games/fallout4/src/render_hooks/recovery.rs:134](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks/recovery.rs#L134) + +- [x] **Altitude | Medium | Make retirement report whether the host released the recovery token.** call returns true for RSF_OK even when RETIRE or CANCEL omits NEXT_REDUCTION_ALLOWED and retains the token and its lease. The refused_retire_retains_token_and_retries_without_finish fixture explicitly expects true with the token still live. Imagespace exit tests only the return value when deciding whether to report pending recovery. Represent released, still owned and failed separately, or make retire return true only once its ownership obligation is gone. [games/fallout4/src/render_hooks/recovery.rs:406](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks/recovery.rs#L406) + +- [x] **Simplicity | Medium | Fallout 4 render hooks mirror one native World through five partial ABI views.** scope.rs World, producer.rs World, publication.rs World, imagespace.rs World and recovery.rs Facts are each a separate repr(C) projection of the same render_hooks.cpp World, each with its own fill leaf (scope_world, producer_world, publication_world, imagespace_world, recovery facts at render_hooks.cpp:246-385), its own NativeXWorld struct in render_hooks_platform.h, its own size/offset assert block, and its own Leaves::world() that hand-writes a zeroed literal including a five-field CpuIdentity. Most fields recur (cpu, pass, frame_pass, context, inputs, published, frame_open, submission_open, auxiliary_open, refused), and the inputs-then-pass-else-frame_pass choice is re-spelled in imagespace.rs:61, producer.rs:166 and scope.rs:285. Simpler: one NativeWorld view (the union of these fields, about 20) with one fill leaf and one assert block, passed to every seam; a World::state() helper used everywhere. Tradeoff: each seam can see fields it does not use, and the single view grows when any seam needs a new fact, but a new or renamed World field changes one struct pair instead of up to five. [games/fallout4/src/render_hooks/scope.rs:54](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks/scope.rs#L54) + +- [x] **Duplication | Low | Share the bounded instruction-byte reader used by Fallout 4 hook admission.** CPU hook preflight at games/fallout4/src/cpu_events/native.rs:82 and render hook preflight at games/fallout4/src/render_hooks.rs:150 independently call ReadProcessMemory, check the returned byte count and compare the prefix. The former accepts an RVA and a maximum of 16 bytes; the latter accepts an absolute address, up to 32 bytes for entries, and enforces a separate 16-byte guard limit at :168. A single exact-span reader/comparator with explicit call-site limits avoids independently maintaining short-read and bounds behavior. Keep the per-hook expected bytes, address selection and independent verification points in their existing owners. [games/fallout4/src/render_hooks.rs:150](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks.rs#L150) + +- [x] **Duplication | Low | Define the resolution-report stage IDs once for all Fallout 4 seams.** The imagespace module assigns four ResolutionStage numbers at games/fallout4/src/render_hooks/imagespace.rs:36, publication assigns two at games/fallout4/src/render_hooks/publication.rs:38, and scope assigns source-retired at games/fallout4/src/render_hooks/scope.rs:33. Their common reporting callback at games/fallout4/src/render_hooks.cpp:296 casts the integers back to the enum in games/fallout4/src/resolution.h:6. Native static assertions check the native ordinals but do not check the separately typed Rust literals. Define a C-compatible stage enumeration once and import its generated constants into the Rust producers and reporter, preserving the numeric reporting ABI. [games/fallout4/src/render_hooks/imagespace.rs:36](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks/imagespace.rs#L36) + +- [x] **Quality | Low | Report a failed output restore in the Fallout 4 resolution receipt.** When end_output returns false, leave_imagespace calls refuse and immediately emits UI_RESTORED with RSF_OK. publication_report_state forwards that result to the resolution log, so the recorded result contradicts the failed cleanup. Carry the restore outcome through to the receipt and update imagespace_exit_refuses_a_failed_output_end_on_the_frame_pass, which explicitly expects the success bit on failure. [games/fallout4/src/render_hooks/imagespace.rs:188](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks/imagespace.rs#L188) + +- [x] **Duplication | Low | Share the baseline recovery callback table across Fallout 4 render-seam tests.** Imagespace tests at games/fallout4/src/render_hooks/imagespace/tests.rs:185, producer tests at games/fallout4/src/render_hooks/producer/tests.rs:217, publication tests at games/fallout4/src/render_hooks/publication/tests.rs:276 and scope tests at games/fallout4/src/render_hooks/scope/tests.rs:230 each construct a full RecoveryLeaves table. Even the identical unused adopt, lease and preflight callbacks are reimplemented in each file. These fixtures exercise different callers and record different events for same_source, raster_current or refusal. Provide one test-only baseline for the common callbacks and override the observed or deliberately unreachable slots in each fixture, so extending RecoveryLeaves does not require four sets of unrelated stubs. [games/fallout4/src/render_hooks/imagespace/tests.rs:185](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/fallout4/src/render_hooks/imagespace/tests.rs#L185) + + + +### R01 · RDR2 startup, settings and input + +Port ASI startup, attach, settings and Runtime session workers with their input and configuration boundaries. + +**Coordinate shared edits** + +- ASI and renderer session ownership and submitted capture resources ([R02](#r02), [R03](#r03)). + +**Port files (9)** + +- [x] [games/rdr2/src/asi_entry.cpp](games/rdr2/src/asi_entry.cpp) +- [x] [games/rdr2/src/asi_platform.h](games/rdr2/src/asi_platform.h) +- [x] [games/rdr2/src/attach_entry.cpp](games/rdr2/src/attach_entry.cpp) +- [x] [games/rdr2/src/engine_settings.h](games/rdr2/src/engine_settings.h) +- [x] [games/rdr2/src/engine_settings_policy.h](games/rdr2/src/engine_settings_policy.h) +- [x] [games/rdr2/src/native_settings.cpp](games/rdr2/src/native_settings.cpp) +- [x] [games/rdr2/src/native_settings.h](games/rdr2/src/native_settings.h) +- [x] [games/rdr2/src/runtime_setup.h](games/rdr2/src/runtime_setup.h) +- [x] [games/rdr2/src/runtime_worker_native.h](games/rdr2/src/runtime_worker_native.h) + +**Fixtures (1)** + +- [x] [tests/rdr2_engine_settings.cpp](tests/rdr2_engine_settings.cpp) + +**Rust review findings (9)** + +- [x] **Duplication | Medium | Validate loaded PE headers once for both RDR2 modules.** games/rdr2/src/asi.rs:334 and games/rdr2/src/platform.rs:202 read the DOS signature, NT displacement, timestamp and SizeOfImage through equivalent guarded memory callbacks. The ASI uses checked_add_signed and accepts a negative displacement if the resulting address remains representable, while the plugin rejects a negative displacement before addition. ASI ForceD3D12 at asi.rs:356 also needs the NT address for sections, whereas renderer admission at games/rdr2/src/renderer.rs:706 needs only the facts. Share a checked header reader parameterized by the memory callback that returns both the validated NT address and image facts, leaving expected fingerprints and section checks at their callers. [games/rdr2/src/asi.rs:334](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/asi.rs#L334) + +- [x] **Boundaries | Medium | Give the RDR2 startup and diagnostic INI keys saved overlay controls.** arm() and attach() read [RDR2] Enable, ForceD3D12, NativeCapture, CameraProbe, CameraProbeDirectory, CameraReference, CameraReferenceLibrary, FrameProbe, FrameProbeLibrary, FrameProbePrefix, Census, CensusDirectory, CensusFlags and TraceD3D12 through GetPrivateProfile* leaves. runtime_worker.rs:228 and :287-302 add NativeSettingsProbe, NativeSettingsProbePath, DumpModule and DumpDirectory. None of these keys has an overlay row through the overlay service, and the shared settings store does not own them, so each change needs an INI edit and a restart. Rule 2 explicitly covers diagnostic and experimental options: a restart-only option still needs a control that says so and saves the value. Describe these keys as restart-required adapter options through the overlay service, persisted in the shared settings store, and have the ASI read the stored values at the next start. [games/rdr2/src/asi.rs:452](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/asi.rs#L452) + +- [x] **Quality | Medium | Retry RDR2 adapter detection after a failed DXGI query.** The settings hook caches (adapter index, vendor) even when the native adapter_vendor leaf returns zero because factory creation, enumeration or GetDesc1 failed. Subsequent loads/applies for that index skip detection permanently and pin the FSR2 carrier even on NVIDIA after DXGI becomes available. Keep the immediate fallback, but only cache a successful vendor identity or retry a cached zero. Test a failed lookup followed by a successful lookup for the same index. [games/rdr2/src/engine_settings.rs:205](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/engine_settings.rs#L205) + +- [x] **Altitude | Medium | Publish a quality selection only after both pending settings collections accept it.** pin_pending publishes SELECTION, invokes own twice and unconditionally returns true. own returns silently on an unrecognized collection version. The quality tick then marks PENDING_INITIALIZED and can request reconfiguration with only one or neither collection updated; later ticks skip the unchanged request. Validate both collections and prepare their changes together, report refusal to the tick, and publish the selection only on successful application. [games/rdr2/src/engine_settings.rs:424](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/engine_settings.rs#L424) + +- [x] **Quality | Medium | Retain a refused RDR2 plugin session that still owns cleanup.** Both ASI startup and explicit attachment use run_session. It discards the local session pointer on every non-OK prepare. plugin_session.h permits BUSY with a nonnull inactive session and requires retrying quiesce/stop. Losing that handle can permanently block another attachment or preparation for the module. Keep the returned owner and drain it before releasing it or allowing another start; likewise account for start failure after a successful prepare. [games/rdr2/src/runtime_worker.rs:258](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/runtime_worker.rs#L258) + +- [x] **Duplication | Low | Keep a single set of engine quality and refresh test vectors.** games/rdr2/src/engine_settings/tests.rs:14, :45 and :105 and tests/rdr2_engine_settings.cpp:9, :18 and :49 repeat the same capability lists, four vendors, five quality expectations and 31550000/262912 refresh repair. Both reach the Rust policies at games/rdr2/src/engine_settings.rs:33, :60 and :100. The native test also independently checks byte offsets and the C++ default-argument bridge. Keep those ABI checks and one call per export in native code, and maintain the complete vendor/quality/refresh matrix in a single fixture shared with Rust, so a future measured mode only needs one expected vector. [games/rdr2/src/engine_settings/tests.rs:14](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/engine_settings/tests.rs#L14) + +- [x] **Altitude | Low | Report settings-probe RVAs only for observed addresses in the game image.** The settings-value and row detours turn unreadable pointers into zero and subtract the image base with wrapping arithmetic. The JSON can therefore name a very large vtable_rva or getter_rva for a failed read, or mislabel an address in another DLL as an RDR2 offset. Keep the optional addresses through serialization, emit a module-relative offset only after checking the image bounds, and distinguish external addresses from unreadable ones. [games/rdr2/src/native_settings.rs:170](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/native_settings.rs#L170) + +- [x] **Duplication | Low | Share the Windows carriers' tick-prefixed file logger.** games/rdr2/src/runtime_worker.rs:46 and games/project-wingman/src/carrier.rs:51 both use a process-local path, a mutex, append-open, GetTickCount64, raw message bytes and a newline. The host callback adapters at runtime_worker.rs:58 and carrier.rs:63 also repeat the same null check and CStr conversion. Parameterize one small logger by its path with one instance in each carrier so future line-format or write fixes apply to both. Keep each adapter's filename, initialization timing and messages local. [games/rdr2/src/runtime_worker.rs:46](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/runtime_worker.rs#L46) + +- [x] **Simplicity | Low | RDR2 run_session branches on an Option mode argument at seven points to serve two callers.** run_session takes asi: Option<(HMODULE, &rsf_rdr2_runtime_leaves)> only to tell the ASI start from the research attach start, then tests it at lines 177, 188, 216, 222, 247, 255 and 259: three refusals log only in ASI mode, the native settings probe and ScriptHook start run only in ASI mode, the log prefix differs, and the exit code is prepared/started in ASI mode but 1/0 in attach mode. Simpler: a shared helper that resolves exports, fingerprints, fills the probe and services, creates the host and runs prepare/start, returning Result<(), Refusal> with the refusal text and raw result; rsf_rdr2_asi_start_runtime and rsf_rdr2_attach_start_runtime each log and map that result and run their own extras (settings probe between create and prepare is the one ordering point, passed as an optional hook closure). Tradeoff: the settings probe must still run between host creation and prepare, so the ASI caller supplies that step as a callback rather than inline code. [games/rdr2/src/runtime_worker.rs:165](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/runtime_worker.rs#L165) + + + +### R02 · RDR2 camera, renderer and presentation + +Port camera and renderer facts, frame routing and presentation observation. Repair the private-field fixture construction first. + +**Coordinate shared edits** + +- ASI and renderer session ownership and submitted capture resources ([R01](#r01), [R03](#r03)). + +**Port files (9)** + +- [x] [games/rdr2/src/camera_probe.cpp](games/rdr2/src/camera_probe.cpp) +- [x] [games/rdr2/src/camera_probe.h](games/rdr2/src/camera_probe.h) +- [x] [games/rdr2/src/native_platform.cpp](games/rdr2/src/native_platform.cpp) +- [x] [games/rdr2/src/native_platform.h](games/rdr2/src/native_platform.h) +- [x] [games/rdr2/src/plugin.cpp](games/rdr2/src/plugin.cpp) +- [x] [games/rdr2/src/render_camera.h](games/rdr2/src/render_camera.h) +- [x] [games/rdr2/src/social_club.cpp](games/rdr2/src/social_club.cpp) +- [x] [games/rdr2/src/social_club_guard.cpp](games/rdr2/src/social_club_guard.cpp) (MSVC SEH around Social Club COM call) +- [x] [games/rdr2/src/social_club.h](games/rdr2/src/social_club.h) + +**Fixtures (1)** + +- [x] [tests/rdr2_camera.cpp](tests/rdr2_camera.cpp) + +**Rust review findings (12)** + +- [x] **Quality | High | Construct the RDR2 renderer fixture without accessing private ResourceFacts padding.** The sr_pass test uses struct update syntax on platform::ResourceFacts from the sibling renderer module. That construction requires access to every omitted field, including platform-private _reserved, and prevents compilation of the RDR2 Rust unit tests. Start from ResourceFacts::default() and assign its crate-visible fields, or provide a constructor in platform. Identified from Rust field visibility; tests were not run. [games/rdr2/src/renderer/tests.rs:73](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/renderer/tests.rs#L73) + +- [x] **Altitude | Medium | Preserve failure to identify the worker TLS slot in the camera capture.** Snapshot::read_worker replaces a failed TLS index read with zero and continues through slot 0. If that slot and its view field are readable, the capture marks unrelated bytes as valid_view. tools/analyze-rdr2-camera-probe.py:21 accepts the record when the parameters are also readable. Require a successfully read in-range index and a non-null slots base before following the pointer chain; leave valid_view clear on failure. [games/rdr2/src/camera_probe.rs:105](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/camera_probe.rs#L105) + +- [x] **Quality | Medium | Report camera-capture write failures before consuming the whole burst.** The upscaler callback ignores fs::write and always advances the index and decrements remaining. A nonexistent camera output directory or a full disk can consume all 64 requested records with no usable camera evidence and no indication of failure. Check the write result, distinguish failed attempts from saved records, and report the path and error once or end the burst with an explicit failure. [games/rdr2/src/camera_probe.rs:266](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/camera_probe.rs#L266) + +- [x] **Altitude | Medium | Derive FSR camera flags from the observed context creation.** The FSR dispatch adapter always sets the normalized flags to NGX_DEPTH_INVERTED. sample consequently accepts inverted depth and process marks motion unjittered for every FSR context. The fsr_create hook already receives the actual context flags but logs only the first four calls. Store the relevant translated flags for each successful creation, invalidate replaced contexts and decline unsupported or unobserved conventions instead of publishing fixed camera facts. [games/rdr2/src/renderer.rs:491](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/renderer.rs#L491) + +- [x] **Quality | Medium | Keep a forced FSR history reset local to the fallback dispatch.** After an RSF frame, the FSR fallback casts the const dispatch description to mutable and sets its reset byte, then returns without restoring it. A reused description can keep resetting native history, and writing a read-only description would fault. Use a writable copy covering the verified full 2.2 description, including its tail, for this call. Test that native FSR receives the forced reset, caller bytes stay intact and extension fields survive. [games/rdr2/src/renderer.rs:501](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/renderer.rs#L501) + +- [x] **Duplication | Medium | Centralize the history transition when either RDR2 upscaler falls back.** The DLSS path at games/rdr2/src/renderer.rs:412 and FSR path at :495 both set native_gap after a host replacement, require a native reset on the next fallback, log a changed result, clear the gap after native success and invalidate the RSF frame. The history test at games/rdr2/src/renderer/tests.rs:36 checks only its initial state. Put that transition on History and cover replacement, failed fallback, successful retry and next-frame invalidation once. Keep the NGX status mask versus FFX_OK test, native argument writes and logging text at their respective call sites. [games/rdr2/src/renderer.rs:508](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/renderer.rs#L508) + +- [x] **Altitude | Medium | Revalidate the queue and swapchain that qualify an RDR2 SR pass.** attach_present stops reading the game's active swapchain after its first attachment and attach_queue ignores every later candidate. process admits SR whenever both stored addresses are nonzero. If an engine reconfiguration replaces either object, evaluation can be accepted while submission or Present is observed only on the retired object. Track the active pair and its generation, fall back on mismatch, and require matching observations before admitting SR on the replacement. [games/rdr2/src/renderer.rs:599](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/renderer.rs#L599) + +- [x] **Altitude | Medium | Observe RDR2 input independently of the host's pacing decision.** The sleep detour calls input_thread only when process_latency accepts the sleep. That call is the only place that installs the window/controller observers and assigns INPUT_SOURCE. If the optional sleep service is absent or declines ownership, native pacing proceeds but the adapter never installs the observers on that path, and controller_received drops unkeyed reads. Establish input observation from the verified game-thread event regardless of sleep ownership; use the callback result only to decide whether to forward native sleep. [games/rdr2/src/scene.rs:206](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/scene.rs#L206) + +- [x] **Duplication | Medium | Use one resource-free render-pass copy for retained frame identity.** RDR2 copies the complete SR pass into retained state at games/rdr2/src/scene.rs:613 then clears ten borrowed resource pointers. Fallout 4 copies its FG input pass at games/fallout4/src/render_hooks/publication.rs:426 and additionally clears native_frame_context and temporal_mask, both pointer fields in sdk/game/src/lib.rs:331 and :333. RDR2's helper would retain either non-null field from its input after the callback lease. Put the resource-free copy in the SDK alongside the pass type, use it at both retention sites, and test with every borrowed pointer populated. Preserve scalar identities and camera data; this finding does not require either pointer to be populated by today's RDR2 producer. [games/rdr2/src/scene.rs:230](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/scene.rs#L230) + +- [x] **Quality | Medium | Match the RDR2 WINDOW receipt to the backbuffer that received the completed scene.** completed_scene records the exact target resource in saved.surface. At PRESENT_END, marker checks only that it is nonzero, retrieves the swapchain current index and passes that buffer to the host without comparing identities. If Present has already advanced the index, the previous frame camera and source are published with the next buffer. Capture the buffer identity at the actual Present boundary, compare it to the blit target, and withhold the association when they differ. Include a rotating two-buffer fixture. [games/rdr2/src/scene.rs:432](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/scene.rs#L432) + +- [x] **Duplication | Low | Use one RAGE camera fixture for the Rust decoder and its C++ ABI test.** games/rdr2/src/camera/tests.rs:33 and tests/rdr2_camera.cpp:36 independently construct the same 0x800-byte view with the same native offsets, matrices, jitter and dimensions. Both then test the same static point, reset and refusal cases against the same Rust decoder through games/rdr2/src/camera.rs:218. A changed view layout requires editing both constructions, and passing both suites still covers just one trajectory. Share a versioned synthetic fixture and expected values, keep detailed reprojection and refusal coverage in Rust, and keep a focused native ABI call plus the C++ capture-file CLI. [games/rdr2/src/camera/tests.rs:33](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/camera/tests.rs#L33) + +- [x] **Duplication | Low | Use the ASI status formatter for Social Club hook results.** games/rdr2/src/social_club.rs:98 and games/rdr2/src/asi.rs:200 both call the same AsiPlatform.hook_status leaf, check for null and convert the returned C string to owned text. Social Club calls its private copy at :164 and :185, whereas the D3D12 trace uses the existing method at asi.rs:424. An unknown status is printed as a bare number in one log and with MH_STATUS in the other. Use AsiPlatform::status_text for all three messages and retain its labeled numeric fallback. [games/rdr2/src/social_club.rs:98](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/social_club.rs#L98) + + + +### R03 · RDR2 capture and diagnostics + +Port capture observation, registration, GPU ownership and publication alongside the capture fixture. + +**Coordinate shared edits** + +- ASI and renderer session ownership and submitted capture resources ([R01](#r01), [R02](#r02)). + +**Port files (6)** + +- [x] [games/rdr2/src/capture_ngx.cpp](games/rdr2/src/capture_ngx.cpp) (CRT and NGX exception leaves; now the C11 leaf `capture_ngx.c`, SEH replaces `catch (...)`) +- [x] [games/rdr2/src/capture_state.h](games/rdr2/src/capture_state.h) +- [x] [games/rdr2/src/d3d12_trace.h](games/rdr2/src/d3d12_trace.h) +- [x] [games/rdr2/src/diagnostics.h](games/rdr2/src/diagnostics.h) +- [x] [games/rdr2/src/native_capture.cpp](games/rdr2/src/native_capture.cpp) +- [x] [games/rdr2/src/native_capture.h](games/rdr2/src/native_capture.h) + +**Fixtures (2)** + +- [x] [tests/rdr2_capture_ngx.cpp](tests/rdr2_capture_ngx.cpp) (native NGX fixture object; now the C11 leaf `rdr2_capture_ngx.c` calling the NgxParam `Set` vtable slots) +- [x] [tests/rdr2_capture.cpp](tests/rdr2_capture.cpp) + +**Rust review findings (11)** + +- [x] **Altitude | Medium | Detach completed capture metadata before writing the RDR2 bundle.** The native poller takes g->mutex at native_capture.cpp:727 and calls this export, which writes camera files, formats up to 4096 draw records, writes and renames the manifest, and logs before returning. Present takes that same mutex even after the capture has drained, so filesystem delays can stall presentation. Transfer an owned bundle snapshot and tail lease to the poller under the mutex, publish after unlocking, and finalize the matching sequence under the lock. [games/rdr2/src/capture_state/bundle.rs:100](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/capture_state/bundle.rs#L100) + +- [x] **Altitude | Medium | Keep the target identity of enabled RDR2 capture hooks.** The registry collapses each enabled slot to Hook::Enabled and returns before reading the next object's target. native_capture.cpp:539 binds the same draw and reset roles for every created command list, so a second vtable implementation silently misses observation while the registry still reports the first install. Record the enabled target and compare subsequent objects; either support target-specific original dispatch or report the unobserved implementation in capture completeness. [games/rdr2/src/capture_state/hooks.rs:86](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/capture_state/hooks.rs#L86) + +- [x] **Altitude | Medium | Keep unavailable pipeline observations explicit in capture artifacts.** remember_pipeline in native_capture.cpp:112 passes null for an unrecognized descriptor and Rust removes those facts. get_draw_binding nevertheless succeeds for a bound target and fills Pipeline with zeros; the draw bundle and image JSON then serialize shader CRCs, blend state and write mask as observed values. Carry a pipeline-known flag or optional pipeline snapshot from binding to serialization and mark these fields unavailable while retaining the draw and PSO identity. [games/rdr2/src/capture_state/recordings.rs:274](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/capture_state/recordings.rs#L274) + +- [x] **Quality | Medium | Invalidate capture state after an aliasing barrier with no named destination.** native_capture.cpp:303 forwards pResourceAfter for every aliasing barrier. D3D12 permits a null destination to cover any alias, but capture_alias does nothing for null, so state() can still return an earlier concrete state. The NGX capture path at native_capture.cpp:423 uses that value to insert readback barriers. Record a wildcard invalidation for that command list, propagate it through submission in command order, and refuse copies until the resource state is explicitly observed again. [games/rdr2/src/capture_state/recordings.rs:335](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/capture_state/recordings.rs#L335) + +- [x] **Altitude | Medium | Retire capture copies discarded by a command-list reset.** A shot recorded on a list that is reset before submission keeps its old generation forever. reset_list advances the generation, before_submit can no longer claim that shot, and collect_ready requires a completed fence. Even after timeout the pending entry keeps drained false, blocking publication and every future capture. At successful reset, detach provably unsubmitted, unclaimed receipts from the abandoned generation and mark their artifacts unavailable; preserve claimed or submitted leases until completion proof. [games/rdr2/src/capture_state/shots.rs:290](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/capture_state/shots.rs#L290) + +- [x] **Quality | Medium | Retire failed RDR2 readbacks when the fence reports device removal.** GetCompletedValue returning UINT64_MAX is a terminal device-removal signal. Readback::is_complete rejects it and collect_ready keeps the shot in pending exactly as for an unfinished fence. Timeout only clears active/inputs_remaining, so can_publish and can_arm remain false and the old buffer, fence, queue or backbuffers stay held across device replacement. Classify terminal device loss separately, record the readback failure and retire its leases after confirming removal without mapping the buffer. [games/rdr2/src/capture_state/shots.rs:290](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/capture_state/shots.rs#L290) + +- [x] **Duplication | Medium | Apply one foreground F10 edge rule to both RDR2 capture workers.** games/rdr2/src/diagnostics.rs:175 tracks the previous value of foreground AND F10 for camera/RenderDoc requests. games/rdr2/src/capture_state.rs:137 tracks raw F10 first and requires foreground only on a physical rising edge for the native readback poller called at games/rdr2/src/native_capture.cpp:710. Holding F10 while switching into the game can therefore trigger a camera/RenderDoc capture without the matching GPU capture even when both pollers observed the key beforehand. Share a tested edge transition for both workers, keep their request files and capture actions separate, and cover focus changes while the key stays down. [games/rdr2/src/diagnostics.rs:175](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/diagnostics.rs#L175) + +- [x] **Duplication | Low | Use the same bounded directory admission for RDR2 camera and GPU capture.** games/rdr2/src/asi.rs:472 and :518 read CameraProbeDirectory for the two installers. games/rdr2/src/camera_probe.rs:154 and games/rdr2/src/capture_state/install.rs:114 independently scan the UTF-16 pointer for a terminator within 196 units. The camera path rejects length zero, while the native-capture entry called at games/rdr2/src/native_capture.cpp:774 builds root-relative request and log paths from an empty input. Normal INI startup already filters empty values. Use one adapter-local nonempty bounded directory reader for both entry points and test the empty, maximum and unterminated cases once. [games/rdr2/src/capture_state/install.rs:114](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/capture_state/install.rs#L114) + +- [x] **Duplication | Low | Reuse the capture recorder's fallible map entry helper for swapchain metadata.** games/rdr2/src/capture_state/metadata.rs:183 looks for an existing pointer key, reserves one slot only if absent and returns entry.or_default for the HDR and colour-space callbacks at :208 and :223. games/rdr2/src/capture_state/recordings.rs:96 provides exactly this operation for list bindings and RTV entries at :220 and :237. Both deliberately allow an existing key to update even under allocation pressure. Move try_entry to capture_state and call it from both owners to keep that failure behavior consistent. [games/rdr2/src/capture_state/metadata.rs:183](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/capture_state/metadata.rs#L183) + +- [x] **Altitude | Low | Capture NGX scalar metadata as one observation.** native_capture.cpp:472 enumerates Rust-owned keys across FFI, branches on a returned type flag, reads the corresponding native NGX parameter, and crosses back into Rust for each of 18 fields. Each write searches the same temporal records again by InputId. Let the metadata owner resolve the input once and fill its scalar array in one operation using a typed native read callback that preserves the signed fallback and explicit unavailable values. [games/rdr2/src/capture_state/metadata.rs:419](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/capture_state/metadata.rs#L419) + +- [x] **Altitude | Low | Report whether the frame-probe request worker actually started.** rsf_rdr2_start_frame_probe returns the native initialization result even when CreateThread fails. asi_entry.cpp:39 forwards that result and asi.rs reports frame-probe success while no worker can consume the request file or F10. Return a distinct worker-start failure after successful initialization and include it in the existing startup report. [games/rdr2/src/diagnostics.rs:201](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/rdr2/src/diagnostics.rs#L201) + + + +### S01 · Skyrim startup, CPU input and compatibility + +Port the cold creation routes, session, event proofs and compatibility handoff. + +**Coordinate shared edits** + +- Steam chain installation and cold device creation ([F01](#f01), [I01](#i01)). +- Session retirement and the callbacks consuming Skyrim render inputs ([S02](#s02)). + +**Port files (12)** + +- [x] [games/skyrim-se/src/compatibility.cpp](games/skyrim-se/src/compatibility.cpp) (now the C11 leaf `compatibility.c`) +- [x] [games/skyrim-se/src/compatibility.h](games/skyrim-se/src/compatibility.h) +- [x] [games/skyrim-se/src/cpu_events.cpp](games/skyrim-se/src/cpu_events.cpp) (now the C11 leaf `cpu_events.c`) +- [x] [games/skyrim-se/src/cpu_events.h](games/skyrim-se/src/cpu_events.h) +- [x] [games/skyrim-se/src/cpu_policy.h](games/skyrim-se/src/cpu_policy.h) +- [x] [games/skyrim-se/src/input_ownership.h](games/skyrim-se/src/input_ownership.h) +- [x] [games/skyrim-se/src/native_creation.cpp](games/skyrim-se/src/native_creation.cpp) (now the C11 leaf `native_creation.c`) +- [x] [games/skyrim-se/src/native_creation_platform.h](games/skyrim-se/src/native_creation_platform.h) +- [x] [games/skyrim-se/src/observer_platform.h](games/skyrim-se/src/observer_platform.h) +- [x] [games/skyrim-se/src/plugin.cpp](games/skyrim-se/src/plugin.cpp) (already the C11 `plugin.c` since 7f28d061) +- [x] [games/skyrim-se/src/session_platform.h](games/skyrim-se/src/session_platform.h) +- [x] [games/skyrim-se/src/guarded_read.cpp](games/skyrim-se/src/guarded_read.cpp) (native SEH read and write guards) + +**Fixtures (1)** + +- [x] [tests/skyrim_input.cpp](tests/skyrim_input.cpp) + +**Rust review findings (13)** + +- [x] **Altitude | Medium | Keep repeated initializer lookups under the same Community Shaders handoff.** The GetProcAddress detour replaces SKSEPlugin_Load only while the phase is Armed. The first lookup sets Captured, so a second lookup of the same module and function before invocation receives the unwrapped entry and can initialize without exclusion or withdrawal. In Captured, return the same wrapper for the same original/module identity and make the initializer transaction enforce its single-invocation rule. [games/skyrim-se/src/compatibility/initializer.rs:262](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/compatibility/initializer.rs#L262) + +- [x] **Duplication | Medium | Centralize Skyrim's shared frame, window and target-table addresses.** games/skyrim-se/src/camera/render.rs:11, games/skyrim-se/src/cpu_policy.rs:31 and games/skyrim-se/src/presentation.rs:20 each spell out the same frame/window RVAs. The camera reader at camera/render.rs:99, CPU identity producer at cpu_policy.rs:364 and presentation recheck at presentation.rs:194 must agree for the same frame. games/skyrim-se/src/auxiliary.rs:11 and games/skyrim-se/src/render_inputs.rs:18 likewise repeat the same target base and 0x30 stride for different slots. Put these verified addresses and the target-index operation in the existing Skyrim layout module. Preserve each owner's live reads and checks so a build update changes each native fact in one place. [games/skyrim-se/src/cpu_policy.rs:31](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/cpu_policy.rs#L31) + +- [x] **Altitude | Medium | Restore the screen classification with a nested Skyrim render scope.** cpu_events.cpp:743 saves only the previous scope ID before begin_render changes both scope and screen. end_render restores just the ID. If a native render callback nests, a parent pass subsequently receives the child's screen via render_identity, which also uses it to determine FG eligibility. Have begin_render return a receipt for both scope-local values and restore them together while retaining frame-wide counters. [games/skyrim-se/src/cpu_policy.rs:295](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/cpu_policy.rs#L295) + +- [x] **Quality | Medium | Commit poll completion atomically with the Skyrim overlap check.** An exclusive poll can pass the conflicts check at end_poll, then pause before storing its generation. A poll on another thread can enter and finish in that interval, increment conflicts and store zero. The first poll then overwrites zero with its old generation. Once both writers leave, epochs.snapshot and the poll_sample_status caller in cpu_events.cpp:652 can report a sampled source despite the overlap. Serialize poll begin/end/invalidation bookkeeping or use a generation-checked atomic publication, and test this interleaving with synchronized threads. [games/skyrim-se/src/cpu_sources.rs:188](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/cpu_sources.rs#L188) + +- [x] **Duplication | Medium | Use the same cold renderer-owner predicate for Skyrim creation and compatibility.** games/skyrim-se/src/creation.rs:166 reads OWNER and OWNER_DEVICE to decide Steam preparation at :187. games/skyrim-se/src/compatibility.rs:176 repeats that pointer chain to decide whether the original Community Shaders initializer may run at games/skyrim-se/src/compatibility/initializer.rs:290 and :336. Both accept a missing owner or device and refuse unreadable memory, but only the latter rejects zero module base explicitly, uses checked addition and preserves read failure as None. Put the checked observation beside the shared owner offsets, accepting a guarded read callback. Both admission callers can then require Some(true). [games/skyrim-se/src/creation.rs:166](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/creation.rs#L166) + +- [x] **Duplication | Medium | Use one D3D11 creation-scope and native-chain binding on both sides of device creation.** games/fallout4/src/platform_abi.rs:132 and :157 contain generated chain and scope records. Skyrim manually defines the identical wire objects at games/skyrim-se/src/platform.rs:28 and :50, initializes them at games/skyrim-se/src/creation.rs:304, and lends the final device/context/swapchain fields on return. Runtime interprets a third pair at runtime/orchestrator/src/d3d11_host_abi.rs:110 and :119 through d3d11_host.rs:2447 and :2480. The manual Skyrim checks cover record sizes but could miss same-sized pointer fields exchanged within the chain. Share the generated public records and keep adapter-specific call frames private. [games/skyrim-se/src/platform.rs:28](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/platform.rs#L28) + +- [x] **Duplication | Medium | Use one public D3D11 host setup binding for adapters and runtime.** games/fallout4/src/platform_abi.rs:61 already has the generated 160-byte rsf_d3d11_host_setup used for creation at games/fallout4/src/session.rs:201. Skyrim builds the same payload with handwritten HostSetup and nested MotionDecode at games/skyrim-se/src/session.rs:110 and :529. The runtime interprets it using a third definition at runtime/orchestrator/src/d3d11_host_abi.rs:58 before validation at runtime/orchestrator/src/d3d11_host.rs:2273. The two manual versions depend on selected offset assertions and can silently reinterpret same-size fields after a header change. Generate the public setup, motion parameters and callback signature once from d3d11_host.h in a shared ABI crate. Keep adapter settings and private platform callbacks local. [games/skyrim-se/src/session.rs:110](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/session.rs#L110) + +- [x] **Altitude | Medium | Propagate the Runtime's Skyrim host activation result.** Leaves::set_active returns Ok whenever the native wrapper did not throw, irrespective of the returned status. The Runtime returns INVALID for an unknown host. Session::start can consequently enable admission for an inactive host, and suspend_host can report success after a refused deactivation. Preserve both the exception and Runtime result and publish the new lifecycle state only after RSF_OK. [games/skyrim-se/src/session.rs:245](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/session.rs#L245) + +- [x] **Altitude | Medium | Keep failed Skyrim subsystem rollback visible to the session owner.** Stage::retire tests is_ok() on Result, so normal false from a busy presentation or sampling stop, or a refused CPU disable, counts as successful cleanup. Creation discards stop's boolean too. After a later stage fails, Session::start can report a clean refusal while a prior subsystem still owns live hooks or leases. Track outstanding rollback stages and return BUSY until each stop acknowledges release; exercise a false stop separately from a thrown stop. [games/skyrim-se/src/session.rs:376](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/session.rs#L376) + +- [x] **Duplication | Medium | Bind Skyrim CPU services without repeating native hook preparation.** Session::prepare calls CPU_PREPARE first with the upstream host at games/skyrim-se/src/session.rs:476, then with the bound runtime services at :574. games/skyrim-se/src/cpu_events.cpp:762 routes both to the same Control::prepare, which rereads the named callback and 13 hook guards at games/skyrim-se/src/cpu_hooks.rs:227, requeries clock frequency at :248 and overwrites the saved services. The second call needs the bound callbacks but the hooks are already prepared and pinned. Separate native preparation from service binding, publish the final table once, and retain the independent live admission check at cpu_hooks.rs:286 before enabling. [games/skyrim-se/src/session.rs:574](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/session.rs#L574) + +- [x] **Quality | Medium | Do not report a successful Skyrim restart while admission is withdrawn.** start returns OK whenever self.enabled is true. After a successful start, quiesce clears ACCEPTING and quiesces the subsystems but leaves enabled true, so a caller invoking the public start hook again gets success while status.active stays zero. An activation exception also leaves enabled true before returning NOT_READY, causing the same false success on retry. Distinguish installed-but-quiesced hooks from an accepting session and either resume all required stages or return an explicit refusal until stop/prepare. [games/skyrim-se/src/session.rs:597](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/session.rs#L597) + +- [x] **Simplicity | Low | Skyrim threads the one static platform table through every export and re-validates it per call.** platform.rs already has register/get for the process-lived table, but about twenty exports (auxiliary, compatibility/initializer, cpu_hooks, cpu_policy, plugin, postprocess, presentation, render_inputs, render_observer, resolution, sampling) take platform: *const Platform and call platform::inspect on every call, re-reading the size/version header (30 inspect/get sites across 14 files). Every C++ caller passes the same creation_platform() static (sampling.cpp:72, resolution.cpp:94, render_inputs.cpp:134/138, presentation_inputs.cpp:97, plugin.cpp:218, auxiliary.cpp:139), and session::publish already inspects leaves.platform before any lifecycle call, yet register only runs late in Session::prepare, so earlier exports cannot use get() and cpu_policy.rs:236 has to explain "the upstream CPU prepare runs before session registration of this same platform". Simpler: register the table once in session::publish, drop the platform parameter from the exports, and read platform::get() (or take &Platform internally). Tradeoff: the C++ export signatures change, and a fixture that wants a private table must publish it first instead of passing it per call. [games/skyrim-se/src/platform.rs:161](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/platform.rs#L161) + +- [x] **Duplication | Low | Use one identity predicate for reusing a process-lived D3D11 host.** games/skyrim-se/src/session.rs:296 and games/fallout4/src/session.rs:100 compare exactly four fields of the same rsf_game_host_services type: session ID, user pointer, log callback and CPU-event callback. Skyrim uses its copy to admit a cached host at :553 and Fallout uses its copy at :260. Adding a callback that participates in rebinding identity currently requires finding and updating both predicates. Give the shared D3D11 host support code a named upstream-identity comparison, preserve the existing four-field contract, and test each field independently. [games/skyrim-se/src/session.rs:296](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/session.rs#L296) + + + +### S02 · Skyrim rendering and presentation + +Port camera and render inputs, presentation, resolution, sampling and auxiliary render effects. + +**Coordinate shared edits** + +- Session retirement and the callbacks consuming Skyrim render inputs ([S01](#s01)). + +**Port files (14)** + +- [x] [games/skyrim-se/src/auxiliary.cpp](games/skyrim-se/src/auxiliary.cpp) +- [x] [games/skyrim-se/src/auxiliary.h](games/skyrim-se/src/auxiliary.h) +- [x] [games/skyrim-se/src/camera.h](games/skyrim-se/src/camera.h) +- [x] [games/skyrim-se/src/postprocess_platform.h](games/skyrim-se/src/postprocess_platform.h) +- [x] [games/skyrim-se/src/presentation_inputs.cpp](games/skyrim-se/src/presentation_inputs.cpp) +- [x] [games/skyrim-se/src/presentation_inputs.h](games/skyrim-se/src/presentation_inputs.h) +- [x] [games/skyrim-se/src/render_inputs.cpp](games/skyrim-se/src/render_inputs.cpp) +- [x] [games/skyrim-se/src/render_inputs.h](games/skyrim-se/src/render_inputs.h) +- [x] [games/skyrim-se/src/render_observer_platform.h](games/skyrim-se/src/render_observer_platform.h) +- [x] [games/skyrim-se/src/resolution.cpp](games/skyrim-se/src/resolution.cpp) +- [x] [games/skyrim-se/src/resolution.h](games/skyrim-se/src/resolution.h) +- [x] [games/skyrim-se/src/sampling.cpp](games/skyrim-se/src/sampling.cpp) +- [x] [games/skyrim-se/src/sampling.h](games/skyrim-se/src/sampling.h) +- [x] [games/skyrim-se/src/screen_classification.h](games/skyrim-se/src/screen_classification.h) + +**Fixtures (1)** + +- [x] [tests/skyrim_camera.cpp](tests/skyrim_camera.cpp) + +**Rust review findings (12)** + +- [x] **Duplication | Medium | Share the D3D11 auxiliary surface, pass and restore-scope bindings.** Skyrim declares Surface, Pass and Scope at games/skyrim-se/src/auxiliary.rs:17, :30 and :40, sends the pass at :279 and reuses the scope at :294. Runtime already generates the same surface with every offset checked at runtime/orchestrator/src/auxiliary_sr_abi.rs:27 and manually declares the other two at runtime/orchestrator/src/d3d11_host_abi.rs:156 and :165 for the corresponding host calls at runtime/orchestrator/src/d3d11_host.rs:2612 and :2657. Reordering session/frame/view identifiers would preserve the size checked in Skyrim and break restore identity. Generate all three public records once and import them in both crates, keeping Skyrim texture selection and runtime lease management local. [games/skyrim-se/src/auxiliary.rs:17](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/auxiliary.rs#L17) + +- [x] **Altitude | Medium | Make auxiliary reconstruction depend on entering the output-resolution scope.** apply accepts the Runtime's auxiliary upscale and stores the result of enter_output_resolution only as a cleanup flag. The caller then reports reconstruction success even when resolution_enter declined its mutation lock or could not read producer ratios, so post-processing can consume reconstructed surfaces with the reduced-size viewport. On enter refusal, restore the Runtime scope, retain any outstanding cleanup receipt, and return failure to the reduced-resolution producer. [games/skyrim-se/src/auxiliary.rs:282](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/auxiliary.rs#L282) + +- [x] **Quality | Medium | Invalidate Skyrim SR history when a sampled frame never reaches evaluation.** read_frame replaces HISTORY before render_inputs.rs reads or validates the textures. If frame N has the right camera but a missing motion target, produce returns before calling the runtime. Frame N+1 sees a consecutive camera receipt, can omit RESET, and publishes the previous jitter for N although SR last consumed N-1. Track the last accepted SR frame separately from camera sampling and force a reset after a missed publication. Cover a good frame, one refused input lease, then a good frame; preserve separate FG timing. [games/skyrim-se/src/camera/render.rs:178](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/camera/render.rs#L178) + +- [x] **Altitude | Medium | Retain the Skyrim TAA restore receipt when the native write fails.** The post-process hook clears the engine's TAA-enabled byte for one native call. Its destructor invokes this void restore once, ignores the guarded write's boolean and drops the stack receipt. If the owner still matches and that write fails, TAA can remain disabled on later native fallback frames with no retry or diagnostic. Keep an outstanding owner-checked receipt on failure, report it, and drain it before admitting another bypass or ending the session. [games/skyrim-se/src/postprocess.rs:133](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/postprocess.rs#L133) + +- [x] **Altitude | Medium | Record the outcome of the Skyrim window-begin callback in its lease.** The native render leaf returns false if the callback throws. use_buffer retains the context and chain and publishes an Open Window before checking that result, so retirement sends a normal end event even when begin never completed. Represent successful and indeterminate begin separately, clear a never-opened reservation or run explicit recovery for partial host work, and keep final-scene and window accounting consistent. [games/skyrim-se/src/presentation.rs:375](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/presentation.rs#L375) + +- [x] **Duplication | Medium | Share Skyrim's native TAA owner and history-clear operation.** games/skyrim-se/src/resolution.rs:108 follows manager+0x1f0 to TAA, reads its mask at +0x30 and sets bit zero when resolution ownership changes. games/skyrim-se/src/postprocess.rs:49 and :58 independently locate the same TAA object and set that bit after reconstruction, then temporarily clear the enable byte. A layout or history-bit change can otherwise reset a different history in the two paths. Factor the owner lookup and checked mask read/OR into a single Skyrim TAA helper, keeping each caller's native write result and postprocess-only enable/restore receipt. [games/skyrim-se/src/resolution.rs:108](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/resolution.rs#L108) + +- [x] **Duplication | Medium | Share the validation of render dimensions returned by the host.** games/skyrim-se/src/resolution.rs:169 and games/fallout4/src/resolution.rs:401 each construct a sized, otherwise empty rsf_game_render_config, ask their host for a plan, then accept only enabled plans with the requested output and nonzero render dimensions bounded by it. The Skyrim callback writes into an out-struct while Fallout also returns a success flag, and each game applies its ratios differently. Share the zeroed sized request and the pure checked-render-extent method on the SDK type, retaining the respective callback failures and native configuration in each adapter. Both will then apply future validation changes consistently. [games/skyrim-se/src/resolution.rs:179](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/resolution.rs#L179) + +- [x] **Altitude | Medium | Bind the cached renderer-upload flags to their observed frame.** record_per_frame_flags stores only a byte in thread-local storage and never clears it. If a subsequent frame or session has no successful dirty upload on that thread, output_ready still accepts the old observation and enter/leave pass the previous flags to the engine's upload. Store the frame and owner/session with the observation, check them when opening the output scope, and retain the admitted flags in the receipt for its matching restore. [games/skyrim-se/src/resolution.rs:330](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/resolution.rs#L330) + +- [x] **Duplication | Medium | Share Skyrim's single-hook binding publication and enable rollback.** games/skyrim-se/src/sampling.rs:223 and games/skyrim-se/src/presentation.rs:440 separately create and publish a permanent trampoline, install a copied binding before enabling its hook, restore the previous binding after enable failure, and set LIVE only on success. Both entry points are started by the Skyrim lifecycle, but sampling requires the bias service and may owe a sampler restoration, while presentation has optional capture and can owe a window end. Extract the create/publish/enable/rollback transaction for these two hooks. Keep their busy checks, owner-specific cleanup and export requirements separate and exercise the shared failure path with a fake enable callback. [games/skyrim-se/src/sampling.rs:258](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/sampling.rs#L258) + +- [x] **Duplication | Low | Share the finite matrix comparison used to admit camera history.** games/skyrim-se/src/camera/render.rs:129 takes two 16-float matrices by value and checks every component for finiteness and absolute difference at most 0.001, before accepting the previous jitter at :188. games/fallout4/src/render_inputs.rs:589 compares borrowed matrices by the same rule during history reset at :1257 and producer validation at :1140. Only Fallout tests the tolerance and NaN behavior at :1911. Put the finite component comparison next to shared camera math, take borrowed matrices and an explicit absolute tolerance, and route both call sites through the same edge-case tests. [games/skyrim-se/src/camera/render.rs:129](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/camera/render.rs#L129) + +- [x] **Duplication | Low | Generate the texture-capture request used by Skyrim and the D3D11 host.** games/skyrim-se/src/presentation.rs:25 manually defines the same 64-byte request as runtime/orchestrator/src/d3d11_host_abi.rs:142. The before/after interface callback constructs it with two string pointers and a texture, then calls the resolved capture export at presentation.rs:409. runtime/orchestrator/src/d3d11_host.rs:2734 accepts the other Rust type. Both check the total size but different offsets, so a swap of name and description could go undetected. Use the same public-header binding for the request at both ends while leaving the diagnostic names and frame identity in the Skyrim producer. [games/skyrim-se/src/presentation.rs:25](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/presentation.rs#L25) + +- [x] **Duplication | Low | Put Skyrim's guarded 32-bit memory reader on Platform.** games/skyrim-se/src/render_inputs.rs:123, games/skyrim-se/src/cpu_policy.rs:188 and games/skyrim-se/src/camera/render.rs:51 each define a four-byte guarded read and little-endian conversion from the same Platform. The frame identity recheck at render_inputs.rs:306, CPU frame facts at cpu_policy.rs:364 and camera cache capture at camera/render.rs:99 all require the same None-on-failure contract. Expose read_u32 alongside Platform::read_usize and have the callers retain their own fallback or refusal behavior. [games/skyrim-se/src/render_inputs.rs:123](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/skyrim-se/src/render_inputs.rs#L123) + + + +### W01 · Project Wingman integration + +Port the game entry, observation, camera and execution paths. Tie compute packets to their render-graph lifetime. + +**Coordinate shared edits** + +- Carrier entry, game recognition and existing forwarding exports ([L01](#l01), [A01](#a01)). + +**Port files (9)** + +- [x] [games/project-wingman/src/native_camera.cpp](games/project-wingman/src/native_camera.cpp) +- [x] [games/project-wingman/src/native_camera.h](games/project-wingman/src/native_camera.h) +- [x] [games/project-wingman/src/native_execution.cpp](games/project-wingman/src/native_execution.cpp) +- [x] [games/project-wingman/src/native_execution.h](games/project-wingman/src/native_execution.h) +- [x] [games/project-wingman/src/native_observer.cpp](games/project-wingman/src/native_observer.cpp) +- [x] [games/project-wingman/src/native_observer.h](games/project-wingman/src/native_observer.h) +- [x] [games/project-wingman/src/native_read.h](games/project-wingman/src/native_read.h) +- [x] [games/project-wingman/src/plugin.cpp](games/project-wingman/src/plugin.cpp) +- [x] [loader/proxy/src/wingman_loader.cpp](loader/proxy/src/wingman_loader.cpp) + +**Fixtures (1)** + +- [x] [tests/wingman_camera.cpp](tests/wingman_camera.cpp) + +**Rust review findings (10)** + +- [x] **Quality | High | Expire Wingman compute packets when their render graph ends.** record_compute inserts unowned RDG identities under a parameter-block address before original_compute runs. When construction fails or RDG culls the pass, take never removes that entry and only plugin stop clears it. A later unrelated pass reusing the address can consume the stale packet, and native_execution.cpp:148 then tries to acquire COM textures through old graph objects. Even without address reuse, 256 abandoned entries prevent recording new packets. Bind records to graph and pass lifetime, retire on graph discard, and test address reuse after a skipped execution. [games/project-wingman/src/execution.rs:269](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/project-wingman/src/execution.rs#L269) + +- [x] **Quality | Medium | Reject nonfinite jitter before marking a Wingman camera valid.** decode reads jitter_pixels from engine memory and never checks either component. With otherwise admissible matrices and timing, NaN jitter passes decode, camera_valid becomes 1, and the RHI observer sends those pixels through host.render_pass. Validate both components before admission and add a guarded-copy fixture with one nonfinite jitter component. [games/project-wingman/src/camera.rs:81](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/project-wingman/src/camera.rs#L81) + +- [x] **Duplication | Medium | Build carrier plugin-session requests with one SDK helper.** games/project-wingman/src/carrier.rs:127 and games/rdr2/src/runtime_worker.rs:193 both build the same sized AMD64 probe, zeroed GameSDK services, nonzero tick-based session ID, log callback and versioned plugin-session options, then prepare and start in that order. Wingman starts an observation-only session, while RDR2 must call render_host_create to populate its services before prepare at runtime_worker.rs:242. Provide shared sized constructors for the probe/services and a session request borrowing the paths, digest and prepared services. Keep executable identity, host creation, activation and result reporting local so adding an SDK header field does not require updating parallel initializers. [games/project-wingman/src/carrier.rs:127](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/project-wingman/src/carrier.rs#L127) + +- [x] **Altitude | Medium | Retain the cleanup handle from a refused Wingman session prepare.** The carrier resolves only prepare and start, then discards the local session on any nonzero prepare result. plugin_session.h explicitly permits BUSY with a non-null inactive session that the caller must retain and quiesce/stop. The adapter can therefore leave cleanup ownership in the runtime with no handle available to retry it. Store the pending session and resolve its cleanup operations, as the Anomaly carrier already does for a retained refusal. [games/project-wingman/src/carrier.rs:151](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/project-wingman/src/carrier.rs#L151) + +- [x] **Quality | Medium | Keep Wingman start retryable after an execution hook refuses to enable.** start rolls back through stop, which clears the execution host once callbacks drain. observer::start then returns NATIVE_REFUSED but leaves its own host installed, so status still says prepared and every subsequent start fails at execution::start because its host is missing. The same split occurs when the observer hook enable fails. Retain the prepared host during start rollback or transition both owners to unprepared and allow prepare to run again; test a one-time enable failure followed by a retry. [games/project-wingman/src/execution.rs:135](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/project-wingman/src/execution.rs#L135) + +- [x] **Duplication | Medium | Decode the size-only GameSDK probe once for exact-build detectors.** Project Wingman registers detect at games/project-wingman/src/lib.rs:99 and Fallout 4 at games/fallout4/src/lib.rs:345. Their bodies at :24 and :282 respectively repeat the short-probe check, null pointer checks, CStr borrows and ASCII comparisons. RDR2 repeats the same decoding at games/rdr2/src/lib.rs:130, while Anomaly at games/anomaly/src/lib.rs:113 searches several local builds. Put the size-only probe-to-borrowed-fields conversion and case-insensitive comparison in the Rust GameSDK with one short/null-input contract. Keep PE machine requirements, accepted executable names, hashes, and multi-build selection inside each adapter. [games/project-wingman/src/lib.rs:24](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/project-wingman/src/lib.rs#L24) + +- [x] **Duplication | Low | Share row-major camera multiplication while preserving the scalar precision.** games/project-wingman/src/camera.rs:41 multiplies flat row-major 4x4 f32 matrices in increasing inner-index order for the view identity check at :102 and reprojection at :118. games/rdr2/src/camera.rs:57 implements the same indexing and summation with f64 accumulators for current and previous clip transforms at :170 and :174. Both already use sdk/game/src/camera_math.rs:5 for inversion. Put the row-major product alongside that helper with a scalar parameter retaining each caller's precision and operand order, and verify it with non-commuting reference matrices. [games/project-wingman/src/camera.rs:41](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/project-wingman/src/camera.rs#L41) + +- [x] **Boundaries | Low | Give the Wingman ObserveNative gate a saved overlay control.** rsf_wingman_carrier_start reads [ProjectWingman] ObserveNative from ReScaleFrame.ini with GetPrivateProfileIntW and returns before loading the Runtime when it is 0. It is the only switch for the experimental native observer, and no overlay row, settings_store key or restart-required control exists for it. Rule 2 covers experimental options: a restart-only option still needs a control that says so and saves the value. Move the key into the shared settings store and give it a restart-required overlay row (or a Runtime-owned diagnostic enable), so the carrier reads the stored value rather than a private INI key. [games/project-wingman/src/carrier.rs:79](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/project-wingman/src/carrier.rs#L79) + +- [x] **Simplicity | Low | Project Wingman keeps two copies of one lifecycle: two ACCEPTING flags and two stored hosts.** observer.rs and execution.rs each own a static ACCEPTING flag and a Mutex State holding Option (observer.rs:50/88, execution.rs:67/88). observer::prepare/start/quiesce/stop always drive execution::prepare/start/quiesce/stop in the same call, so both hosts are written from the same *host and cleared together, and both flags flip in the same quiesce (observer.rs:191-192) and stop. Readers then ask different copies of the same fact: rsf_wingman_exec_take reads execution host plus execution ACCEPTING (execution.rs:272), rsf_wingman_observe reads observer ACCEPTING plus observer host. Simpler: one lifecycle state (host, accepting) owned by observer.rs and read by execution.rs, leaving execution.rs only its sites/created/installed/pending. Tradeoff: execution.rs gains a dependency on the observer state, and the start order (execution hooks enabled before the observer hook) must set the single flag after both succeed. [games/project-wingman/src/execution.rs:67](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/project-wingman/src/execution.rs#L67) + +- [x] **Duplication | Low | Read the Wingman view jitter once per captured temporal packet.** The native TAA hook at games/project-wingman/src/native_execution.cpp:128 enters capture, which copies JITTER into pass.camera.jitter_pixels at games/project-wingman/src/execution.rs:182. Six lines later read_camera enters games/project-wingman/src/camera.rs:81 and copies the same bytes into the same field again. Successful captures perform two guarded native reads, and an early camera refusal can carry jitter from the first one. Capture jitter once and pass its Option into the decoder, preserving the fallback value for refused packets and the independent public read_camera entry. [games/project-wingman/src/execution.rs:182](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/project-wingman/src/execution.rs#L182) + + + +### M01 · Minecraft native integration + +Port the JNI bridge and review the frame and session boundaries against the Java callers. + +**Coordinate shared edits** + +- OpenGL shared surfaces, device ownership and linked Minecraft callers ([D08](#d08), [D02](#d02)). + +**Port files (2)** + +- [x] [games/minecraft/native/jni.cpp](games/minecraft/native/jni.cpp) +- [x] [games/minecraft/native/minecraft_platform.h](games/minecraft/native/minecraft_platform.h) + +**Rust review findings (6)** + +- [x] **Boundaries | Medium | Move Minecraft runtime options into the shared settings store and overlay.** frame::options builds rsf_gl_pipeline_options from rsf_minecraft_configuration: SR backend, quality, FG backend, FG mode (FIXED/OFF chosen here from fg != 0), generated frames, Reflex mode, frame limit (converted from fps to us here), debug, DLSS preset and the twelve sharpening fields. The Java mod stores and edits these in TaaSettings, SodiumConfig and TaaScreen. The runtime GL pipeline (runtime/orchestrator/src/gl_pipeline.rs) has no settings_store or overlay service use, so these options bypass the shared settings storage and the shared overlay. That breaks Rule 1 (settings storage stays generic) and Rule 2 (each option needs a live overlay control). The adapter also turns the FG backend into an FG mode and the limit into an interval, which is Rule 3 pacing and FG policy. Let the Runtime own these keys and overlay rows as on the d3d11 host, and have Java report only game facts. [games/minecraft/native/frame.rs:128](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/minecraft/native/frame.rs#L128) + +- [x] **Duplication | Medium | Give Minecraft native status fields a shared index definition.** games/minecraft/native/frame.rs:189 serializes 25 status values in an implicit order. games/minecraft/src/main/java/org/kpc/rescaleframecraft/render/NativeRenderer.java:72 uses indices 2, 3, 14 and 15 to set generation limits and :239 decodes the same array again for display. games/minecraft/native/frame/tests.rs:222 checks the Rust-side order against another tuple, but a Java index change can pass that test and alter live limits. Define the append-only field names and indices once and generate Rust writers and Java accessors, retaining prefix-length handling for older callers. [games/minecraft/native/frame.rs:181](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/minecraft/native/frame.rs#L181) + +- [x] **Altitude | Medium | Preserve query failure when publishing Minecraft status.** The runtime platform declares return values for status_get and latency_status_get, but Ops wraps both as unit. rsf_minecraft_status then packs zero-initialized fields and returns a nonzero count even if the pipeline or latency query failed, and jni.cpp copies those fields to Java as a successful snapshot. Propagate pipeline status failure to the existing zero-count path, and encode latency availability separately so a failed latency query does not erase valid graphics status. [games/minecraft/native/lib.rs:175](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/minecraft/native/lib.rs#L175) + +- [x] **Quality | Medium | Convert the Java runtime directory to standard Unicode before opening Minecraft resources.** jni.cpp:26 and :50 pass GetStringUTFChars directly to rsf_minecraft_open. JNI modified UTF-8 encodes supplementary characters as surrogate pairs, so open_log replaces those bytes with replacement characters and setup forwards the same nonstandard encoding as runtime_directory_utf8. A valid installation path containing an emoji or supplementary ideograph can lose its log and vendor runtime lookup. Take GetStringChars and length, preserve UTF-16 for the file path and explicitly encode standard UTF-8 for the runtime call; cover a path with a supplementary character. [games/minecraft/native/lib.rs:303](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/minecraft/native/lib.rs#L303) + +- [x] **Altitude | Medium | Propagate a failed surface query before constructing the camera pass.** camera_pass ignores the Runtime's get_surfaces result. On a query that leaves the initialized record unchanged, frame::pass marks the camera valid with zero extents and computes reciprocal motion scales from zero, then both evaluate and hudless submit the packet. Return a Result from camera_pass and pass the surface-query error back through JNI before dispatch, so callers see the original failure. [games/minecraft/native/lib.rs:421](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/minecraft/native/lib.rs#L421) + +- [x] **Simplicity | Low | Minecraft threads the platform table through every export but reads it once, then re-checks each validated leaf.** All twelve rsf_minecraft_* exports take a platform pointer and call ops(platform), which returns the cached OnceLock Ops after the first call and ignores the argument from then on (lib.rs:51-58). Ops is documented as "every entry is present" after Ops::complete (61-79), yet all 17 wrappers re-handle None with map_or(RSF_BACKEND_ERROR_INVALID_ARGUMENT), if let Some or is_some_and (85-211); line 32 even notes that error is "returned only if jni.cpp ever lent an incomplete table", which complete() already refuses. Simpler: one rsf_minecraft_publish(table) that converts the table once into plain extern fn pointers, and exports that take only their real arguments and call through the published Ops. Tradeoff: jni.cpp must publish before the first call instead of passing its static table each time. [games/minecraft/native/lib.rs:51](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/minecraft/native/lib.rs#L51) + +## Engine and platform integrations + + + +### I01 · Steam and Windows integration + +Port the Steam chain and Windows input facts, coordinating shared Steam interfaces with Fallout 4 and Skyrim. + +**Coordinate shared edits** + +- Steam chain installation and cold device creation ([F01](#f01), [S01](#s01)). + +**Port files (4)** + +- [x] [integrations/steam/include/rescaleframe/steam_d3d11_chain.h](integrations/steam/include/rescaleframe/steam_d3d11_chain.h) +- [x] [integrations/steam/src/d3d11_chain.cpp](integrations/steam/src/d3d11_chain.cpp) +- [x] [integrations/steam/src/d3d11_chain_platform.h](integrations/steam/src/d3d11_chain_platform.h) +- [x] [integrations/windows/xinput_facts.h](integrations/windows/xinput_facts.h) + +**Rust review findings (2)** + +- [x] **Simplicity | Low | Steam relay state is four loose atomics re-validated on every forwarded call** prepare publishes SERVICE_USER, STEAM_BASE, PLATFORM and SERVICE (lib.rs:118-121, stored at :603-606) once, after Ops::resolve already proved platform.dispatch is Some (:461) and service non-null (:542), and before any hook is created or enabled (:608-646). Yet every forwarded Present/Release/Resize call goes through handled() (:178-199), which transmutes the SERVICE pointer back into an Option, re-dereferences PLATFORM and re-checks its dispatch Option, with a NOT_READY fallback that cannot occur once hooks exist; continuation() separately reloads STEAM_BASE. Simpler: publish one `OnceLock` (a Send wrapper for the user pointer) before the hooks are created, and have handled()/continuation() read that record directly. Tradeoff: one small wrapper type; removes the pointer/fn transmute, four Acquire loads per call and the dead not-ready branch. [integrations/steam/src/lib.rs:118](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/steam/src/lib.rs#L118) + +- [x] **Duplication | Low | Share Present request assembly between Steam's two forwarding paths.** integrations/steam/src/lib.rs:215 and :263 independently fill the same PresentArgs and dispatch it before native continuation. The Present1 pair at :230 and :324 repeats the same operation with the parameters pointer from integrations/steam/src/chain_abi.rs:62. The early entry continues through the original Steam handler while the inner route uses the saved method, so the continuation must remain distinct. Share just the typed dispatch request and handled-result extraction per Present method; a future flag or field change will then reach early and inner calls together. [integrations/steam/src/lib.rs:263](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/steam/src/lib.rs#L263) + + + +### U01 · Unity Mono startup and configuration + +Port the plugin, Runtime setup and configuration from managed entry through session startup. + +**Coordinate shared edits** + +- Unity package callback tables, device events and checked retirement ([U02](#u02), [U03](#u03), [U04](#u04), [U05](#u05)). + +**Port files (7)** + +- [x] [games/unity-mono/include/rescaleframe/unity_runtime_config.h](games/unity-mono/include/rescaleframe/unity_runtime_config.h) +- [x] [games/unity-mono/include/rescaleframe/unity_runtime_host.h](games/unity-mono/include/rescaleframe/unity_runtime_host.h) +- [x] [games/unity-mono/src/plugin.cpp](games/unity-mono/src/plugin.cpp) +- [x] [games/unity-mono/src/plugin_platform.h](games/unity-mono/src/plugin_platform.h) +- [x] [games/unity-mono/src/runtime_host.cpp](games/unity-mono/src/runtime_host.cpp) +- [x] [games/unity-mono/src/runtime_graphics.cpp](games/unity-mono/src/runtime_graphics.cpp) +- [x] [games/unity-mono/src/runtime_platform.h](games/unity-mono/src/runtime_platform.h) + +**Fixtures (2)** + +- [x] [tests/unity_mono_runtime.cpp](tests/unity_mono_runtime.cpp) +- [x] [tests/unity_sr_d3d12.cpp](tests/unity_sr_d3d12.cpp) (deleted: the DirectXMath leaves are Rust, the preset validator is the C11 leaf `tests/unity_sr_d3d12_preset.c`, and the Streamline call is Rust in `tests/game-sdk/src/unity_sr_d3d12/streamline.rs`) + +**Rust review findings (7)** + +- [x] **Altitude | Medium | Close Mono bridge callback admission when proving its final drain.** stop checks bridge.drained, runs managed Stop on another thread, then releases native objects. The Mono implementation at bridge.cpp:323 only samples callback/packet/fence counts. A message or managed logging callback can still enter after that sample while the bridge clears services and unhooks. Use a checked close that prevents new callback leases and verifies existing work has drained before returning the release right, as the package D3D12 route already does. [games/unity-mono/src/lifecycle.rs:229](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/lifecycle.rs#L229) + +- [x] **Boundaries | Medium | Remove the Unity Mono Auto FG dependency on the FSR3 directory.** fg_start chooses the FSR3 directory for both Auto and Off, then returns NO_PATHS before passing the per-provider locations to Runtime if that directory is unset. A deployment with Streamline available and FSR3 omitted therefore cannot install the switchable host for Auto even if Runtime would choose DLSS. Pass the available directories and a provider-independent runtime root to the host, and let Runtime validate the directory for its selected backend. Cover Auto with only one non-FSR provider configured. [games/unity-mono/src/runtime_setup.rs:208](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/runtime_setup.rs#L208) + +- [x] **Boundaries | Medium | Expose the Unity Mono graphics diagnostics in the shared overlay.** fg_start reads GraphicsDebug and FGCaptureDirectory exclusively from UnitySR via Win32 profile calls. It enables the debug layer before graphics creation and sends the capture destination to the Runtime once after installation. The Mono adapter provides no overlay descriptors or saved preferences for either key, so a user must edit the INI and restart to try capture. Add a saved, restart-labelled debug-layer control and a capture-directory control that calls the Runtime capture configuration while running. [games/unity-mono/src/runtime_setup.rs:218](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/runtime_setup.rs#L218) + +- [x] **Quality | Medium | Attempt Unity SR startup once when Mono arrives near the polling deadline.** If mono_loaded first succeeds in the final two seconds of the 90-second wait, start sleeps MONO_SETTLE and then checks the original deadline before its first sr_start call. It returns SR_NOT_READY even though the runtime is available and the callback host was never asked to start. Attempt once after settling, applying the remaining deadline only to retries, and cover late Mono availability with a controllable clock. [games/unity-mono/src/runtime_setup.rs:366](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/runtime_setup.rs#L366) + +- [x] **Duplication | Medium | Reuse the executable fingerprint across Unity SR startup retries.** games/unity-mono/src/runtime_setup.rs:296 hashes the whole executable on each sr_start call. The combined starter at :366 invokes that entire route again every 500 ms when runtime/orchestrator/src/callback_host.rs:1068 reports that plugin preparation or activation failed and cleanup completed. A delayed Unity startup can therefore reread an unchanged executable many times before its 90-second deadline. Build an owned executable name and digest once per combined start and lend them to each retry. Keep the standalone SR start doing its own verification, and keep rechecking the actual host readiness on each attempt. [games/unity-mono/src/runtime_setup.rs:367](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/runtime_setup.rs#L367) + +- [x] **Quality | Low | Resolve rooted Unity configuration paths consistently on Windows.** resolve recognizes a leading backslash only for strings of length two or more and never recognizes a leading forward slash. Thus a valid runtime directory value of a single backslash resolves to the INI directory, and /sdk resolves beneath the INI directory rather than at the drive root. Both plugin and package path_setting use this branch. Classify root components before the length-two drive check and test both separator forms, including the existing single-backslash fixture. [games/unity-mono/src/runtime_config.rs:24](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/runtime_config.rs#L24) + +- [x] **Simplicity | Low | Two Unity config exports are kept with no caller** runtime_config.rs:5 states the exports behind unity_runtime_config.h no longer have a caller in the tree. A repository search confirms it: rsf_unity_config_path_setting (runtime_config.rs:167-189) and rsf_unity_config_utf8 (:193-209) are referenced only by the inline helpers in games/unity-mono/include/rescaleframe/unity_runtime_config.h, and no .cpp/.h/.cs/build file includes that header. The Rust callers use path_setting and utf8 directly. Simpler: delete both exports and the header (it is already listed for retirement in PORT.md:265), leaving runtime_config.rs as plain crate-internal helpers. Tradeoff: an out-of-tree consumer of the header would break; none is demonstrated. [games/unity-mono/src/runtime_config.rs:167](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/runtime_config.rs#L167) + + + +### U02 · Unity package session and routing + +Port settings, host services, routing and window admission, including safe subclass retirement. + +**Coordinate shared edits** + +- Unity package callback tables, device events and checked retirement ([U01](#u01), [U03](#u03), [U04](#u04), [U05](#u05)). + +**Port files (3)** + +- [x] [integrations/unity/native/package.c](integrations/unity/native/package.c) (C++ removed: C11 leaf for the SDK device events, the platform table, the `rsfu_*` exports and plugin load; the Runtime shims and the dead `fg_window` exception flag moved to direct Rust calls) +- [x] integrations/unity/native/package.h (deleted: its two declarations had no caller) +- [x] [integrations/unity/native/package_state.h](integrations/unity/native/package_state.h) + +**Rust review findings (9)** + +- [x] **Quality | High | Keep the Unity window forwarding chain alive when a later subclass prevents detachment.** unload clears window and previous even though the restore leaf has no result. In package.cpp:88 another subclass above input_proc prevents the restore, leaving that subclass able to call input_proc. It now falls through to DefWindowProcW instead of the saved Unity procedure, or targets unloaded plugin code after DLL unload. Use an owner-thread subclass mechanism with independent removal, or retain the module and forwarding receipt until a verified detach. Cover shutdown with another subclass installed above the Unity hook. [games/unity-mono/src/package_state/services.rs:355](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/package_state/services.rs#L355) + +- [x] **Altitude | Medium | Require a valid render plan before publishing a Unity SR view.** Leaves::sr_plan discards the Runtime result and returns zero-initialized dimensions on refusal. create_view then calls view_planned unconditionally, enabling the managed render config and setting temporal_ready for a nonzero backend even if it has no valid input extent. Return a fallible plan, validate the dimensions against the output and release the newly created context on refusal before publishing it. [games/unity-mono/src/package_state.rs:338](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/package_state.rs#L338) + +- [x] **Altitude | Medium | Use the latency owner's snapshot for Unity latency availability and mode.** Package::status takes latency_available and latency_mode from fg.vendor, then independently fills latency_owner, markers and sleep counts from native_latency_status. That second record already has available and effective_mode at native_fg_cpu.rs:1534. A provider transition or independently active latency path can therefore expose a mode belonging to a different owner, while a failed read preserves old counters. Populate the latency fields together from one snapshot and explicitly mark an unavailable read. [games/unity-mono/src/package_state.rs:510](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/package_state.rs#L510) + +- [x] **Boundaries | Medium | Have the Runtime own the Unity package SR fallback and quality admission.** Unity rejects Ultra Quality when the last active Auto provider was DLSS (line 456), then independently retries a failed vendor context as backend zero in create_view. package.cpp:139-163 queries the command list adapter and calls rsf_sr12_create, so a provider failure and the next chosen context are split across two owners. On a first Auto request there is no previous active DLSS value to enforce the same quality rule. Resolve capabilities and fallback against the current device inside the Runtime, return the effective backend, dimensions and original refusal, and let Unity apply that plan to its engine. [games/unity-mono/src/package_state.rs:729](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/package_state.rs#L729) + +- [x] **Altitude | Medium | Tie Unity's cached Auto FG decision to the graphics device.** request_generation keeps the first nonzero adapter-derived backend for the entire process. A successful device shutdown and subsequent initialization in routing.rs:161-175 reloads the graphics bridge without invalidating that value, so Auto can request the previous adapter's provider. Let the Runtime resolve Auto for the live device or invalidate a device-keyed decision when the Unity device is retired. [games/unity-mono/src/package_state/presentation.rs:183](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/package_state/presentation.rs#L183) + +- [x] **Duplication | Medium | Give Win32 input message classification a single implementation.** The Unity package at games/unity-mono/src/package_state/services.rs:389, Unity Mono at games/unity-mono/src/bridge.cpp:266, RDR2 at games/rdr2/src/native_platform.cpp:111 and AC7 at games/ac7/src/native_renderer.cpp:297 repeat the same keyboard/mouse ranges and raw-input device mapping. The package uses a raw-type leaf while the three native callbacks call GetRawInputData directly. They then attach different source-frame and lifetime facts to the same input kind. Put the Win32 message-to-GameSDK-kind operation in shared Windows support, let the package call it through its native leaf, and keep callback admission and frame attribution at each integration. [games/unity-mono/src/package_state/services.rs:389](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/package_state/services.rs#L389) + +- [x] **Boundaries | Medium | Retire Unity SR contexts when their camera disappears.** ReScaleFrameUpscaler.cs:104 sends the camera entity ID as the view key. Views::entry appends each new ID, while take drains the entire table only on global reconfiguration or session retirement. A scene that repeatedly creates and destroys cameras retains every old SR context and its GPU resources until one of those global events. Have the integration report when a camera is removed, or age out inactive views, and have the Runtime release each context once its last submission retires. Cover camera churn with other cameras still rendering. [games/unity-mono/src/package_views.rs:84](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/package_views.rs#L84) + +- [x] **Simplicity | Low | Unity package re-adopts the constant 55-leaf platform table on every export and callback** Leaves::adopt (package_state.rs:204-267) null-checks the table, copies it and unwraps 55 Option leaves. It runs at the top of 18 exports (package_state.rs:771,802,819,844,869,890; routing.rs:196,210,220,234; presentation.rs:218,236,245; services.rs:459,470,491,504,511) and inside host_cpu_event via the host services user pointer (services.rs:442), so every window message, CPU event, render route and log line repeats the validation of package.cpp's one constant table, and every export carries a platform parameter plus a None branch with its own fallback result (0, FAILED, FEATURE_FAILED, device==WAITING). Leaves also stores `table` only so services.rs:303 can lend it back as the user pointer for that re-adoption. Simpler: adopt once in rsf_unity_package_load (or the first export) into a static OnceLock, drop the platform argument from the exports and the user-pointer round trip, and keep `&Leaves` parameters internally so the fake-table tests still inject leaves. Tradeoff: a package.cpp/package_state.h signature change and one ordering rule (load before other exports), in exchange for removing 19 per-call validations and their divergent refusal results. [games/unity-mono/src/package_state.rs:204](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/package_state.rs#L204) + +- [x] **Duplication | Low | Use the same preview resource-state bit for Unity pass creation and consumption.** games/unity-mono/src/d3d11_pass.rs:51 declares a local bit and sets it at :166. games/unity-mono/src/package_state/routing.rs:17 independently declares the same bit and tests it at :103 to tell the Editor presenter which D3D12 state the texture is in. The routing test at games/unity-mono/src/package_state.rs:2439 supplies the literal again, so its synthetic packet can continue passing if the actual writer changes. Expose RSF_UNITY_PREVIEW_SOURCE_COMMON from integrations/unity/native/package.h:16 through the common binding, refer to it in both Rust modules and the native D3D11 header, and test the real plan-to-route handoff. [games/unity-mono/src/package_state/routing.rs:17](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/package_state/routing.rs#L17) + + + +### U03 · Unity D3D11 and D3D12 bridges + +Port shared frame state, submission resources and per-frame ownership from both native bridges. + +**Coordinate shared edits** + +- Unity package callback tables, device events and checked retirement ([U01](#u01), [U02](#u02), [U04](#u04), [U05](#u05)). + +**Port files (8)** + +- [x] [games/unity-mono/include/rescaleframe/unity_bridge.h](games/unity-mono/include/rescaleframe/unity_bridge.h) +- [x] [games/unity-mono/src/bridge.c](games/unity-mono/src/bridge.c) (C++ removed: C11 leaf for the pinned D3D12 interface calls and resource-state records, linked into the Mono plugin and the package) +- [x] [games/unity-mono/src/bridge.h](games/unity-mono/src/bridge.h) +- [x] [games/unity-mono/src/bridge_interop.h](games/unity-mono/src/bridge_interop.h) +- [x] [games/unity-mono/src/bridge_state.h](games/unity-mono/src/bridge_state.h) +- [x] [games/unity-mono/src/d3d11_pass.h](games/unity-mono/src/d3d11_pass.h) +- [x] [games/unity-mono/src/d3d11_state.h](games/unity-mono/src/d3d11_state.h) +- [x] [integrations/unity/native/bridge.c](integrations/unity/native/bridge.c) (C++ removed: C11 leaf for the renderer query and the D3D11 interface; the swapchain getter is gated by a CMake header check; the Vulkan wrappers became direct Rust calls) + +**Rust review findings (7)** + +- [x] **Boundaries | Medium | Move the Unity interop submission ring and retirement mechanism into the Runtime.** The package owns a process-wide ring that allocates D3D11/D3D12 fence values, tracks outstanding copies and decides when a slot or the entire bridge can retire. Both integrations/unity/native/bridge.cpp:330-378 and vulkan_bridge.cpp:384-435 drive the ring directly. d3d11_state.rs:413-414 and vulkan_state.rs:680-690 consult it before releasing graphics objects. These decisions need queue, fence and submission identity but no Unity camera or frame semantics. Put them behind a per-bridge Runtime handle with acquire, submit and drain operations. Keep Unity texture acquisition and Unity event timing in the package so other adapters can use the same resource lifetime guarantees. [games/unity-mono/src/bridge_interop.rs:36](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/bridge_interop.rs#L36) + +- [x] **Altitude | Medium | Commit a Unity D3D12 reconfiguration only after the bridge delivers it.** admit_frame clears pending before bridge.cpp:209 creates or resets the command list. Those operations can fail and return before the host sees RSF_GAME_RENDER_RECONFIGURE, yet config now exposes the new generation as settled. Return the pending generation in the admission receipt and acknowledge it after the reconfiguration is successfully delivered; preserve newer generations and leave failed attempts retryable. [games/unity-mono/src/bridge_state.rs:350](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/bridge_state.rs#L350) + +- [x] **Boundaries | Medium | Preserve each Unity view submission receipt until the queue flush.** record_source replaces the entry at source_frame_id % 8 without comparing session or view_key. Two accepted passes with the same frame and different view keys overwrite one another, as can frames eight apart before a flush. games/unity-mono/src/bridge.cpp:113 forwards only the surviving receipts to Runtime as RSF_GAME_RENDER_SUBMISSION. Keep pending receipts by full session, source and view identity, deduplicate exact repeats, and refuse new work or report exhaustion before overwriting an unconfirmed receipt. Cover two views in one frame and a delayed window callback. [games/unity-mono/src/bridge_state.rs:393](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/bridge_state.rs#L393) + +- [x] **Duplication | Medium | Build the common Unity render-pass fields once across all three graphics routes.** games/unity-mono/src/d3d11_pass.rs:110, integrations/unity/native/vulkan_bridge.cpp:406 and games/unity-mono/src/bridge.cpp:78 unpack the same Unity packet into frame/session/view identities, reset flag, camera, rects, motion scaling and previous clip transform. D3D11 uses it from integrations/unity/native/bridge.cpp:301, Vulkan at vulkan_bridge.cpp:463 and the direct D3D12 path at games/unity-mono/src/bridge.cpp:222. Direct D3D12 also binds packet resources and treats an inputs-only probe as camera-valid FG input; the other routes supply their own surfaces. Expose a shared packet-to-scalar-pass builder in the Unity Rust bridge, then retain those explicit route-specific role and resource adjustments. A new camera or identity field will then propagate to all three paths. [games/unity-mono/src/d3d11_pass.rs:110](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/d3d11_pass.rs#L110) + +- [x] **Quality | Medium | Validate source compatibility before copying Unity motion or depth into a shared texture.** shared_format unconditionally selects RG16_FLOAT for motion and R32_FLOAT for depth. The fixture at line 427 accepts RGBA16_FLOAT motion, but integrations/unity/native/bridge.cpp:349 uses CopyResource, which cannot convert that texture to RG16_FLOAT and returns no HRESULT. The bridge proceeds with missing or stale input. Accept only copy-compatible source formats and matching sample/mip/array layouts, or run an explicit conversion. Correct the RGBA16 motion fixture to verify refusal or conversion. [games/unity-mono/src/d3d11_pass.rs:189](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/d3d11_pass.rs#L189) + +- [x] **Altitude | Medium | Require both graphics timelines to retire before replacing a Unity shared surface.** prepare_surface waits only for the D3D12 ring before destroying the previous shared surface. bridge.cpp:372 records the D3D11 output copy after hand-back and signals a separate tail; input-copy failures can also leave an unproved D3D11 copy. The checked close already requires both proofs. Apply equivalent retirement to the old surface on key change, keeping it owned and declining replacement while either side is unproved. [games/unity-mono/src/d3d11_state.rs:520](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/d3d11_state.rs#L520) + +- [x] **Altitude | Low | Make the shared Unity completion check reject device removal.** Interop::drained treats u64::MAX as completed, and the unit test asserts that behavior. Every real fence consumer must repair the predicate: d3d11_state.rs:412, vulkan_state.rs:690, preview.rs:468 and vulkan_bridge.cpp:127 each filter the sentinel separately. Let the completion owner distinguish removed, pending and completed before callers decide whether to release resources, and update the test to exercise that contract. [games/unity-mono/src/bridge_interop.rs:94](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/bridge_interop.rs#L94) + + + +### U04 · Unity Vulkan bridge + +Port resolver, shared surfaces, presentation and their retirement. Account for every GPU user before replacing an image on resize. + +**Coordinate shared edits** + +- Unity package callback tables, device events and checked retirement ([U01](#u01), [U02](#u02), [U03](#u03), [U05](#u05)). + +**Port files (4)** + +- [x] [games/unity-mono/src/vulkan_resolver.h](games/unity-mono/src/vulkan_resolver.h) +- [x] [games/unity-mono/src/vulkan_state.h](games/unity-mono/src/vulkan_state.h) +- [x] [integrations/unity/native/vulkan_bridge.c](integrations/unity/native/vulkan_bridge.c) (C++ removed: C11 leaf for the Vulkan interface, loader hooks and layout assertions, with SEH guards filtered on 0xE06D7363) +- [x] [integrations/unity/native/vulkan_bridge.h](integrations/unity/native/vulkan_bridge.h) (C declarations only) + +**Rust review findings (7)** + +- [x] **Quality | High | Retire every user of a Unity Vulkan shared image before replacing it on resize.** The six shared image entries belong to the device and are reused across three command slots. On a changed extent or format prepare_image immediately destroys the old Vulkan image, memory and D3D12 resource. execute_admitted waits only for its current slot unless the packet is a policy reconfiguration. A normal render-size change in slot 1 can free the image while slot 0 still uses it. Defer destruction until all prior Vulkan and D3D12 users complete, or prove a full drain before replacement. Cover resize with another slot outstanding. [games/unity-mono/src/vulkan_state.rs:759](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/vulkan_state.rs#L759) + +- [x] **Altitude | Medium | Preserve the Vulkan dispatch owner when caching interceptor originals.** vulkan_bridge.cpp:734 passes a device-specific lookup result to Rust without the VkDevice; Resolver stores only the function slot. A later lookup for another device overwrites the original, and resolver_device_function returns that cached pointer without considering the device passed by the swapchain destroy caller at line 664. Key dispatch entries by the originating instance or device, or resolve the continuation from the supplied device at call time. [games/unity-mono/src/vulkan_resolver.rs:141](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/vulkan_resolver.rs#L141) + +- [x] **Quality | Medium | Give the fake Vulkan resolver its exact callback context type.** interop_lookups_run_in_order_and_short_circuit erases the pointer to (Vec::new(), found) as c_void, so the callback cast at line 534 cannot constrain the vector element type or the integer width. The byte-string equality checks do not uniquely determine a vector element type, and an unconstrained found defaults to i32 while the callback reads usize. Declare the local as (Vec>, usize) or use one named fixture type on both sides of the cast. This is a source inspection of the test path. [games/unity-mono/src/vulkan_resolver.rs:543](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/vulkan_resolver.rs#L543) + +- [x] **Boundaries | Medium | Bind the Unity Vulkan window packet to the Present that consumes it.** set_window stores a single copied frame, and window returns it for every present until a new packet, fault or release. vulkan_bridge.cpp:550-560 retrieves that packet before looking up the intercepted swapchain, and :593 reports its source identity to Runtime. If no new window event arrives, a later Present can report the previous source again; the registry also has no match from the packet to the presenting swapchain. Carry the intended presentation identity, consume the matching window receipt once, and forward a Present with no matching receipt along the native path. [games/unity-mono/src/vulkan_state.rs:352](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/vulkan_state.rs#L352) + +- [x] **Duplication | Medium | Share the Unity graphics-device creation and publication transaction.** integrations/unity/native/bridge.cpp:254 and integrations/unity/native/vulkan_bridge.cpp:316 enter separate Rust initializers. games/unity-mono/src/d3d11_state.rs:418 and games/unity-mono/src/vulkan_state.rs:585 both claim a single creator, prepare device and slots outside the mutex, destroy partial transfers before relinquishing the claim, then swap the finished record into state and return a borrowed view. D3D11 latches failure until release, while Vulkan allows retry and additionally requires an active borrower and a Vulkan command pool. Extract the claim/publication transition parameterized by the two admission and failure policies, leaving device preparation, destruction and sync proofs on their existing backends. [games/unity-mono/src/vulkan_state.rs:585](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/vulkan_state.rs#L585) + +- [x] **Altitude | Medium | Keep swapchain semaphore ownership until Vulkan retirement is proven.** swapchain_retire removes the registry entry before invoking a void Retire callback and returns success unconditionally. The production leaf at vulkan_bridge.cpp:720 ignores vkDeviceWaitIdle's result and destroys the semaphores. Make the callback report its wait outcome, retain the handles on unproved completion and distinguish explicit device-loss teardown from normal retirement. [games/unity-mono/src/vulkan_state.rs:1085](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/vulkan_state.rs#L1085) + +- [x] **Simplicity | Low | Unity Vulkan admission is two booleans for a three-state lifecycle** State.retiring is read only in enter() (vulkan_state.rs:407), and always together with closed (`self.retiring || self.closed`); every other gate (open :345, claim_device :419, can_borrow_device :427, close :479, commands_retired :667) reads closed alone. release() (:495-499) sets both, reopen() (:486-489) clears both, stop_admission (:797) sets retiring and close() (:478-484) sets closed, so retiring && closed carries nothing beyond closed. Simpler: one `admission: Admission { Open, Retiring, Closed }` field, with enter() requiring Open, the closed checks reading `== Closed`, stop_admission moving Open to Retiring, close() moving to Closed and release/reopen assigning Closed/Open. Tradeoff: none beyond touching the tests that poke the two flags (:1248); behavior is identical. [games/unity-mono/src/vulkan_state.rs:299](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/vulkan_state.rs#L299) + + + +### U05 · Unity Editor preview + +Port preview window and GPU lifetime and make the fixture exercise the production fence path. + +**Coordinate shared edits** + +- Unity package callback tables, device events and checked retirement ([U01](#u01), [U02](#u02), [U03](#u03), [U04](#u04)). + +**Port files (3)** + +- [x] [games/unity-mono/src/preview_platform.h](games/unity-mono/src/preview_platform.h) +- [x] [integrations/unity/native/preview.cpp](integrations/unity/native/preview.cpp) +- [x] [integrations/unity/native/preview.h](integrations/unity/native/preview.h) + +**Rust review findings (3)** + +- [x] **Altitude | Medium | Invalidate the Editor preview's cached window when its parent disappears.** The region owner enumerates a parent only while its stored HWND is zero. If the Editor destroys that parent and its child preview, later position attempts keep using the stale handles, and a failed position neither clears the record nor withdraws its visible flag. Track window destruction or validate the pair before reuse, withdraw the old preview chain, and recreate it under the newly observed parent. [games/unity-mono/src/preview.rs:203](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/preview.rs#L203) + +- [x] **Boundaries | Medium | Separate the Unity Editor window policy from its DXGI presenter.** The package creates and resizes the preview swapchain, acquires its backbuffer, schedules a copy, signals its own fence, calls Present and counts base frames. integrations/unity/native/preview.cpp:97 and :198 implement CreateSwapChainForHwnd and Present for that Rust owner. The child window selection, visibility and source production require Unity knowledge, while the copy, swapchain, presentation and retirement need only a destination HWND, a queue and a leased source. Move the latter into a per-output Runtime presenter and return its presentation outcome to the Editor. [games/unity-mono/src/preview.rs:566](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/preview.rs#L566) + +- [x] **Duplication | Medium | Drive the real preview signal-failure transition in the retirement tests.** integrations/unity/native/preview.cpp:224 calls the production Rust present entry, which records a copy, assigns its fence value, faults on signal failure and advances the ring only after signalling at games/unity-mono/src/preview.rs:562. The test helper at :784 reproduces recording/submission/advance while skipping the signal, and the fault-retention test at :977 sets faulted directly. Removing the production fault assignment could leave the test green. Extract the post-record submission transition on Graphics, exercise it with a refusing signal leaf, and assert the slot, retained source and release verdict through that path. [games/unity-mono/src/preview.rs:784](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/games/unity-mono/src/preview.rs#L784) + + + +### E01 · Godot engine hooks and render graph + +Port the SCons engine module and engine patch hooks, including frame, viewport, graph and pass-record interfaces. + +**Coordinate shared edits** + +- Godot module-to-extension ABI, pass records and driver routing ([E02](#e02), [E03](#e03)). + +**Port files (16)** + +- [ ] [eng/patch-godot.py](eng/patch-godot.py) (inserts integration hooks into the Godot source checkout; blocked: a Python source patcher whose inserted hooks are C++ statements inside Godot functions, `Main::iteration`, `Input::_parse_input_event_impl` (`Object::cast_to`), `DisplayServerWindows::process_events`, `RenderingDevice::_execute_frame`, `RenderingDeviceGraph::_run_render_commands`, `RenderForwardClustered::_render_scene` and private `RenderingDeviceDriverVulkan`/`RenderingDeviceDriverD3D12` members. The call sites name only `RSFGodot` forwarders and driver members.) **Kept:** run by `eng/build-godot-engine.ps1:12` and `eng/prepare-godot.ps1:37`; the hooks it inserts are C++ inside Godot sources. +- [ ] [integrations/godot/modules/rescaleframe/bridge.cpp](integrations/godot/modules/rescaleframe/bridge.cpp) (native.rs now owns the library load, export table, CPU event and every gated forwarder. Blocked residue is Godot glue: `ReScaleFrameBridge : Object` with `GDCLASS`, `_bind_methods`, `ClassDB::register_class` and `Engine::add_singleton`; `Dictionary` reads and writes; `ProjectSettings`, `OS`, `SceneTree`, `DisplayServer` and `RenderingServer` calls; `RenderingDevice::driver_callback_add` with `RD::CallbackResource`; `RenderSceneBuffersRD` textures; `Projection` and `Transform3D` inverses; and callback lambdas that cast `RenderingDeviceDriver` to its D3D12 and Vulkan subclasses.) **Kept:** compiled into the Godot engine module (patched engine, `eng/patch-godot.py`); `GDCLASS(ReScaleFrameBridge, Object)` is declared in `rsf_godot_engine.h:12`, `bridge.cpp` defines `_bind_methods` (`:173`), registers the class with `GDREGISTER_CLASS` (`:189`), publishes it with `Engine::add_singleton` (`:194`), calls `RenderingDevice::driver_callback_add` (`:413`, `:430`) and casts the driver to `RenderingDeviceDriverD3D12`/`Vulkan` (`:105-113`); all Godot C++ APIs. +- [x] [integrations/godot/modules/rescaleframe/cpu_facts.h](integrations/godot/modules/rescaleframe/cpu_facts.h) (deleted; native.rs builds and reports the CPU event) +- [ ] [integrations/godot/modules/rescaleframe/d3d12.cpp](integrations/godot/modules/rescaleframe/d3d12.cpp) (blocked: defines `RenderingDeviceDriverD3D12::rescaleframe_begin` and `rescaleframe_end`, members the patch declares in the Godot class. They call the private `_resource_transitions_flush` and reset private `CommandBufferInfo` binding caches.) **Kept:** compiled into the Godot engine module; it defines members of Godot's `RenderingDeviceDriverD3D12` that the patch declares. +- [x] [integrations/godot/modules/rescaleframe/frame.h](integrations/godot/modules/rescaleframe/frame.h) +- [ ] [integrations/godot/modules/rescaleframe/graph.cpp](integrations/godot/modules/rescaleframe/graph.cpp) (blocked: graph.rs owns the decisions. The leaves call `RenderingDeviceDriverVulkan::command_buffer_create`, `semaphore_create`, `semaphore_free`, `command_buffer_begin` and the patched graph members, append to the typed `RenderingDeviceGraph::CommandBufferPool` vectors and rebind the live `CommandBufferID&`.) **Kept:** compiled into the Godot engine module and included by `tests/godot_graph_handoff.cpp` (`tests/CMakeLists.txt:544`, `graph.cpp` included at `tests/godot_graph_handoff.cpp:3`); it calls private Godot driver members. +- [ ] [integrations/godot/modules/rescaleframe/graph.h](integrations/godot/modules/rescaleframe/graph.h) (blocked: `RSFGodot::GraphScope` is constructed in `RenderingDeviceGraph::_run_render_commands` through a template constructor over the engine's label lambda, holding `RenderingDeviceDriver::CommandBufferID&` and `CommandBufferPool&` in a C++ `thread_local` scope stack) **Kept:** included by `integrations/godot/modules/rescaleframe/graph.cpp` and `tests/godot_graph_handoff.cpp`; `GraphScope` is built inside Godot's `_run_render_commands` through a C++ template constructor. +- [x] [integrations/godot/modules/rescaleframe/host.h](integrations/godot/modules/rescaleframe/host.h) +- [ ] [integrations/godot/modules/rescaleframe/motion.cpp](integrations/godot/modules/rescaleframe/motion.cpp) (blocked: motion.rs owns the decoder state. The leaves call `RenderingDevice::shader_compile_spirv_from_source`, `shader_create_from_spirv`, `compute_pipeline_create` and `compute_list_*`, the variadic `UniformSetCacheRD::get_cache` template and `RenderSceneBuffersRD::create_texture`/`get_texture` with `StringName`.) **Kept:** compiled into the Godot engine module; it calls Godot's `RenderingDevice` shader and compute APIs and the `UniformSetCacheRD` template. +- [x] [integrations/godot/modules/rescaleframe/pass.h](integrations/godot/modules/rescaleframe/pass.h) +- [x] [integrations/godot/modules/rescaleframe/primary.h](integrations/godot/modules/rescaleframe/primary.h) +- [x] [integrations/godot/modules/rescaleframe/register_types.cpp](integrations/godot/modules/rescaleframe/register_types.cpp) (deleted; host.rs implements both module entries and the scene-level dispatch. The `ClassDB::register_class` and `Engine` singleton leaves moved into bridge.cpp beside `ReScaleFrameBridge::_bind_methods`.) +- [x] [integrations/godot/modules/rescaleframe/register_types.h](integrations/godot/modules/rescaleframe/register_types.h) (C declarations only: the two `extern "C"` entries called by Godot's generated `register_module_types.gen.cpp`) +- [ ] [integrations/godot/modules/rescaleframe/rsf_godot_engine.h](integrations/godot/modules/rescaleframe/rsf_godot_engine.h) (blocked: declares `ReScaleFrameBridge : Object` through `GDCLASS` and the `RSFGodot` C++ names that patched engine sources call. Its forwarders are inline calls into native.rs. `VulkanExecutionScope` is RAII over `RenderingDevice::_execute_frame` with C++ `thread_local` nesting, which the no_std Rust object cannot hold on stable.) **Kept:** included by the engine sources `eng/patch-godot.py` patches; `GDCLASS` and `VulkanExecutionScope` (C++ `thread_local` RAII) need C++. +- [x] [integrations/godot/modules/rescaleframe/viewport.h](integrations/godot/modules/rescaleframe/viewport.h) +- [ ] [integrations/godot/modules/rescaleframe/vulkan.cpp](integrations/godot/modules/rescaleframe/vulkan.cpp) (blocked: defines `RenderingDeviceDriverVulkan` members the patch declares in the Godot class, `rescaleframe_create`, `_release`, `_drain`, `_images`, `_acquire`, `_present`, `_begin`, `_graph_info`, `_graph_split`, `_submit` and the queue locks. They read private `queue_families`, `device_functions`, `SwapChain`, `CommandBufferInfo` and `RenderingContextDriverVulkan::Surface` fields. Receipt reporting now runs from present.rs to native.rs.) **Kept:** compiled into the Godot engine module; it defines members of Godot's `RenderingDeviceDriverVulkan` that read private driver fields. + +**Fixtures (3)** + +- [ ] [tests/godot_graph_handoff.cpp](tests/godot_graph_handoff.cpp) (blocked by graph.cpp: includes it to instantiate the production `GraphScope` over typed doubles. The Rust side now also covers native.rs refusals before load.) **Kept:** compiled as `rsf_godot_graph_handoff_test` (`tests/CMakeLists.txt:544`); it includes the C++ `graph.cpp` to instantiate `GraphScope`. +- [ ] [tests/godot_graph_stubs/drivers/vulkan/rendering_device_driver_vulkan.h](tests/godot_graph_stubs/drivers/vulkan/rendering_device_driver_vulkan.h) (blocked by graph.cpp: C++ double of the `RenderingDeviceDriverVulkan` members `GraphScope` calls) **Kept:** on the include path of `rsf_godot_graph_handoff_test` (`tests/CMakeLists.txt:545`); a C++ double of Godot's driver for `graph.cpp`. +- [ ] [tests/godot_graph_stubs/servers/rendering/rendering_device_graph.h](tests/godot_graph_stubs/servers/rendering/rendering_device_graph.h) (blocked by graph.cpp: C++ double of `RenderingDeviceDriver` IDs and `RenderingDeviceGraph::CommandBufferPool`) **Kept:** on the include path of `rsf_godot_graph_handoff_test`; a C++ double of Godot's graph types for `graph.cpp`. + +**Rust review findings (5)** + +- [x] **Boundaries | Medium | Report Godot input sampling from its input callback independently of frame begin.** rsf_godot_cpu_begin emits FRAME_BEGIN and INPUT_SAMPLE together whenever it opens a frame. eng/patch-godot.py:66 and :110-116 call that same function both on main-loop iteration entry and before Windows event processing, so iteration entry can report an input sample without observing the input path. The Runtime uses INPUT_SAMPLE for pacing. Split frame opening from input-sample reporting, emit the latter only from the verified engine sampling boundary, and leave an iteration with no sample unreported. [integrations/godot/modules/rescaleframe/frame.rs:121](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/modules/rescaleframe/frame.rs#L121) + +- [x] **Altitude | Medium | Keep ownership of a started Godot native host until its boot transaction completes.** boot marks READY after native start, clears it on an attach refusal, and publishes even a zero session returned by the later status query. shutdown consults only READY, so an attach failure after successful start skips native shutdown, while a failed session query can admit configuration with no frame identity. Track started ownership separately, roll it back on attach or session failure, and publish ready only after a nonzero session is established. [integrations/godot/modules/rescaleframe/host.rs:189](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/modules/rescaleframe/host.rs#L189) + +- [x] **Duplication | Medium | Generate the public camera and CPU event records once for Godot's standalone Rust object.** integrations/godot/modules/rescaleframe/pass.rs:28 and cpu_facts.rs:11 hand-declare the same wire records generated at sdk/game/src/lib.rs:91 and :483. The engine consumes the CPU record directly at integrations/godot/modules/rescaleframe/bridge.cpp:111 and copies the camera at :155. Its SCons rules invoke rustc directly, so importing the entire Cargo SDK is unnecessary. Generate a core-only source module for these two public records and their ABI constants from the SDK headers, include it in both build paths and list it as a SCsub dependency. Keep Godot's private Record and CPU sequencing local. This removes a second source update and offset checklist for every public layout change. [integrations/godot/modules/rescaleframe/pass.rs:28](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/modules/rescaleframe/pass.rs#L28) + +- [x] **Altitude | Medium | Bind the Godot final-scene receipt to its primary render target.** primary_set changes the current target and resource generation but leaves recorded_source and pass.rs's LAST record intact. final_scene_admitted checks the current target and previous source frame independently. If the target changes within a frame, bridge.cpp:496 can submit the new target's color using the old target's camera and view key. Invalidate the stored receipt on retarget and require its target and generation to match the final-scene admission. [integrations/godot/modules/rescaleframe/primary.rs:145](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/modules/rescaleframe/primary.rs#L145) + +- [x] **Boundaries | Medium | Keep Godot camera reset requests pending until their pass is recorded.** decide clears RESET_REQUESTED during rsf_godot_sr_plan. bridge.cpp:456-459 can then return for missing resolved motion or depth before rsf_godot_sr_record. A retry for the same source with unchanged color and extent can lose the camera change, because the previous evaluated frame is still its immediate predecessor. Snapshot a reset generation while planning and acknowledge that generation only when recording succeeds, preserving newer requests and covering a same-frame retry. [integrations/godot/modules/rescaleframe/primary.rs:156](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/modules/rescaleframe/primary.rs#L156) + + + +### E02 · Godot host services and D3D12 + +Port extension control, compositor diagnostics, window input and D3D12 rendering through the existing native API. + +**Coordinate shared edits** + +- Godot module-to-extension ABI, pass records and driver routing ([E01](#e01), [E03](#e03)). + +**Port files (8)** + +- [x] [integrations/godot/native/api.h](integrations/godot/native/api.h) +- [x] [integrations/godot/native/effect.cpp](integrations/godot/native/effect.cpp) (deleted; the `CompositorEffect` class, `_render_callback` and leaves are Rust in native/gdextension/effect.rs on Godot's C interface) +- [x] [integrations/godot/native/effect.h](integrations/godot/native/effect.h) (deleted with the godot-cpp class) +- [x] [integrations/godot/native/extension.cpp](integrations/godot/native/extension.cpp) (deleted; `rsf_godot_initialize` and class registration are Rust in native/gdextension.rs, exported through exports.def) +- [x] [integrations/godot/native/godot_platform.h](integrations/godot/native/godot_platform.h) +- [x] [integrations/godot/native/runtime.cpp](integrations/godot/native/runtime.cpp) (replaced by the C11 leaf native/runtime_platform.c: CMake-selected Vulkan provider symbols, project version, `atexit` unload hook) +- [x] [integrations/godot/native/runtime_control.cpp](integrations/godot/native/runtime_control.cpp) (deleted; the `RefCounted` class is Rust in native/gdextension/runtime.rs; script_dictionary.h deleted with it) +- [x] [integrations/godot/native/runtime_control.h](integrations/godot/native/runtime_control.h) (deleted with the godot-cpp class) + +**Rust review findings (14)** + +- [x] **Boundaries | Medium | Return a reusable Godot status header on D3D12.** lib.rs:155 accepts a status output only when its header carries the current Godot ABI (3 in api.h). The D3D12 session initializes its stored status with ABI 1 and status writes that whole record back to the caller. A second rsfg_status call with the same initialized output is therefore refused after the first one succeeds. Vulkan returns the current ABI. Preserve the negotiated output header or initialize the D3D12 snapshot with ABI_VERSION, and pass the same buffer twice through the exported entry point in the regression test. [integrations/godot/native/control.rs:40](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/control.rs#L40) + +- [x] **Duplication | Medium | Derive the packaged D3D12 vendor paths once for Godot and Unity.** integrations/godot/native/control.rs:109 and games/unity-mono/src/package_state/presentation.rs:49 independently append the same four paths to the supplied SDK root, including the nested Streamline interposer. Godot lends the resulting pointers to its host at control.rs:119 and Unity lends them to SR setup at presentation.rs:68. A package directory rename currently needs two implementations and two sets of literal expectations. Share an owned UTF-8 vendor-path builder and keep boot-time pointer lifetimes, engine metadata and Vulkan-specific directory overrides in their current owners. [integrations/godot/native/control.rs:109](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/control.rs#L109) + +- [x] **Duplication | Medium | Expose one interpretation of simultaneous FG session and provider-switch failures.** Godot's status builder at integrations/godot/native/control.rs:452 prefers a nonzero switch result to the session result. The Unity package at games/unity-mono/src/package_state.rs:496 prefers the nonzero session result and skips the switch query. Both read the same present-switch service as shown at integrations/godot/native/runtime.cpp:194 and integrations/unity/native/package.cpp:216. Consequently the two status APIs explain the same pair of failures differently. Return both facts from a common runtime status helper and define the legacy aggregate field precedence there, with a test where both results are nonzero. [integrations/godot/native/control.rs:452](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/control.rs#L452) + +- [x] **Boundaries | Medium | Use Godot's D3D12 latency owner for availability and mode.** apply_fg copies low-latency availability and effective mode from FG, while apply_latency reads the latency owner and counters from a different snapshot. runtime.cpp:196 takes the former fields from fg.vendor.effective_reflex and low_latency_available, and leaf_latency_facts at :204 omits the authoritative mode and availability. With latency operating independently of FG, rsfg_status can report a pacing owner and paced frames alongside unavailable or incorrect mode. Carry available and effective_mode from rsf_native_latency_status_get into LatencyFacts, and populate all latency status fields from that result. [integrations/godot/native/control.rs:461](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/control.rs#L461) + +- [x] **Altitude | Medium | Publish a Godot D3D12 binding only after its completion fence exists.** render stores the device/queue pair before leaf_d3d12_bind attempts CreateFence. After a refusal the next pass on that pair skips binding and can record work, but leaf_d3d12_signal requires a non-null fence, so pending slots can never retire. The existing failed-fence test expects that second pass to evaluate. Make device, queue and fence a single successful binding or keep an explicit retryable failed state that refuses recording. [integrations/godot/native/d3d12.rs:193](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/d3d12.rs#L193) + +- [x] **Altitude | Medium | Publish the render receipt used by Godot Present after successful recording.** render stores Rendered::of(pass) before capture admission, slot wait, context creation or final-scene recording. If any of those steps refuses, present still sees the current frame and reuses its screen and camera instead of marking the SR miss. Keep attempted pass identity separate and commit the rendered receipt only when the relevant operation succeeds, with a regression case for same-frame refusal followed by Present. [integrations/godot/native/d3d12.rs:204](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/d3d12.rs#L204) + +- [x] **Boundaries | Medium | Bind the Godot HUD-less capture slot to a successfully admitted source.** final_scene picks last_slot(next_slot) and excludes only pending work from a different frame. Submitted work leaves pending immediately, and the SR path increments next_slot before d3d12_wait returns. A refused slot wait can therefore be followed by final_scene using that very slot without a completion proof. runtime.cpp:305-318 flushes and records the capture in that slot. Record a slot receipt after successful acquisition, keyed by session and source, and require that receipt or independently acquire a retired slot for HUD-less capture. [integrations/godot/native/d3d12.rs:328](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/d3d12.rs#L328) + +- [x] **Duplication | Medium | Pass Godot's composed settings to the engine without a second dictionary round trip.** integrations/godot/native/runtime_control.cpp:49 reads a Dictionary using the 21-field schema from integrations/godot/native/extension.rs:57 and compose at :117 writes typed Settings. The engine callback at integrations/godot/modules/rescaleframe/bridge.cpp:77 converts that record back to a Dictionary, only for configure_parse at :242 to map all the keys back into the same record. A new setting must survive three field lists to reach the native renderer. Add an engine-side typed configure path shared by the extension callback and the public Dictionary method after its own parse. Preserve the stricter extension argument checks, root viewport admission and scaling updates. [integrations/godot/native/extension.rs:117](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/extension.rs#L117) + +- [x] **Boundaries | Medium | Read the Godot ABI size before borrowing the complete header.** checked borrows and copies both u32 words before testing struct_size. Public rsfg_attach_engine, rsfg_boot and rsfg_configure in runtime.cpp forward the caller pointer directly. A record containing only its four-byte size word therefore triggers an out-of-bounds header read instead of a clean refusal. Read just the size first, reject any value smaller than the required record, then read the version. For output records validate the header through raw reads without constructing a reference to the uninitialized output body. [integrations/godot/native/lib.rs:48](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/lib.rs#L48) + +- [x] **Duplication | Medium | Use the public sharpening binding for Godot's settings and render requests.** integrations/godot/native/platform.rs:27 duplicates every field of the generated rsf_sharpening_options at runtime/orchestrator/src/render_abi.rs:801 and games/unity-mono/src/package_abi.rs:280. Godot's C++ validation leaf at integrations/godot/native/runtime.cpp:136 receives the public type, while the Rust caller supplies its handwritten Sharpening. Its size assertion cannot detect a swap of adjacent floats such as motion_threshold and motion_scale_limit. Publish a shared generated type with field offset checks, add required test derives there, and use it for the Godot Settings/SrEvaluate members. [integrations/godot/native/platform.rs:27](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/platform.rs#L27) + +- [x] **Boundaries | Medium | Route Godot CPU events and PCL ping requests through the Runtime session.** Window::cpu and Window::latency_ping pass a Vulkan-booted boolean into the adapter table to select one of two latency paths. runtime.cpp:185-189 maps those choices to rsf_fg12_cpu versus rsf_latencyvk_cpu and rsf_native_latency_ping versus rsf_latencyvk_ping, plus a separate Vulkan Present marker call. Rule 3 assigns ping routing and marker mapping to the orchestrator. Bind one versioned CPU-event and ping service to the active Runtime session at setup, and report actual Present begin/end with the window and source identity. Keep Godot window admission in the adapter. [integrations/godot/native/platform.rs:1338](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/platform.rs#L1338) + +- [x] **Duplication | Medium | Test Godot's Auto delegation without copying the runtime vendor policy.** The fake selectors at integrations/godot/native/platform/fake.rs:654 and :672 implement vendor preferences and fallback order again from runtime/orchestrator/src/lib.rs:385 and runtime/orchestrator/src/fg_choice.rs:47. integrations/godot/native/vulkan/tests.rs:598 expects the fake to return vendor-specific results even though production vulkan.rs:179 and :185 delegate those decisions. The adapter test can therefore pass after the real policy changes. Make the fake record its arguments and return test-selected sentinel backends, assert forwarding and capability masks in Godot, and exercise vendor choice tables against the actual runtime implementation. [integrations/godot/native/platform/fake.rs:654](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/platform/fake.rs#L654) + +- [x] **Altitude | Medium | Retain the owning HWND with a Godot window procedure that cannot be detached.** release keeps previous when an intervening subclass or a failed SetWindowLongPtr prevents restoration, but clears input unconditionally. A later accept can publish a different HWND; attach skips installing its observer because previous still belongs to the old window, and a retry can no longer address the old HWND. Store forwarding ownership per window, preserve the original HWND for retirement and admit the replacement independently. [integrations/godot/native/window.rs:185](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/window.rs#L185) + +- [x] **Duplication | Low | Share the Godot native boot and status fixtures across renderer tests.** integrations/godot/native/control/tests.rs:6 and integrations/godot/native/vulkan/tests.rs:7 build the same versioned Setup with the same engine version, project UUID and null log fields. integrations/godot/native/d3d12/tests.rs:13 and integrations/godot/native/vulkan/sr/tests.rs:33 repeat the literal records alongside the fake platform boot. A new required setup field currently needs four fixture edits and can make whole suites accidentally test boot refusal. Put a parameterized Setup constructor and successful backend-specific boot helpers in the existing platform::fake module, allowing negative cases to override fields and failure controls locally. [integrations/godot/native/d3d12/tests.rs:13](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/d3d12/tests.rs#L13) + + + +### E03 · Godot Vulkan + +Port Vulkan creation, render, SR and presentation, with adapter facts feeding Runtime provider policy. + +**Coordinate shared edits** + +- Godot module-to-extension ABI, pass records and driver routing ([E01](#e01), [E02](#e02)). + +**Port files (4)** + +- [x] [integrations/godot/native/vulkan.cpp](integrations/godot/native/vulkan.cpp) +- [x] [integrations/godot/native/vulkan_control.h](integrations/godot/native/vulkan_control.h) +- [x] [integrations/godot/native/vulkan_creation.cpp](integrations/godot/native/vulkan_creation.cpp) +- [x] [integrations/godot/native/vulkan_creation.h](integrations/godot/native/vulkan_creation.h) + +- [x] [runtime/orchestrator/src/native_sr_vulkan_session.cpp](runtime/orchestrator/src/native_sr_vulkan_session.cpp) (introduced Runtime Vulkan SR session adapter) + +**Fixtures (1)** + +- [x] [tests/godot_vulkan_creation.cpp](tests/godot_vulkan_creation.cpp) + +**Rust review findings (10)** + +- [x] **Boundaries | Medium | Put fixed-guide allocation and recreation policy on the Runtime Vulkan presenter.** Godot decides that FSR4 and XeSS have fixed guides, caches their first SR dimensions, and invalidates presenter_generation on certain changes. vulkan.cpp:532 turns this adapter-side decision into VK_ERROR_OUT_OF_DATE_KHR. The Runtime presenter owns the actual provider allocations; adding another provider or changing its allocation behavior requires synchronizing independent code in the Godot DLL. Pass the session, view, generation and extents to the Runtime presenter and have it return whether recreation is necessary. Godot should continue performing its engine-owned WSI recreation. [integrations/godot/native/vulkan.rs:70](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/vulkan.rs#L70) + +- [x] **Duplication | Medium | Derive Godot Vulkan's Auto masks and explicit admission from the same capability facts.** integrations/godot/native/vulkan.rs:170 builds SR/FG choice masks from XeSS readiness, FSR4 build/graph/interop availability, and XeSS FG build/interop/window availability. The explicit checks at :295 and :326 repeat those combinations before accepting settings. vulkan/tests.rs:611 checks the masks returned to Runtime, while the configure path can independently accept or reject the same provider. Calculate the common per-provider prerequisites once from a guarded snapshot and reuse them in both paths. Keep the documented explicit-only DLSS-G/FSR4 FG rules, capacity probes and live presenter checks separate. [integrations/godot/native/vulkan.rs:170](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/vulkan.rs#L170) + +- [x] **Duplication | Medium | Use one reconstruction generation key for Godot configuration changes.** integrations/godot/native/vulkan.rs:277 and integrations/godot/native/control.rs:314 compare backend, quality and DLSS preset field by field, conditionally increment a generation, then copy the same Settings structure. D3D12 uses this generation to retire stale SR contexts at integrations/godot/native/d3d12.rs:228 and Vulkan compares it with presenter readiness at vulkan.rs:398. A future reconstruction setting added to only one comparison would keep old resources eligible on the other renderer. Give Settings one reconstruction key or change predicate and cover each field and a generation-neutral setting once. Keep Vulkan device admission and D3D12 FG option delivery separate. [integrations/godot/native/vulkan.rs:277](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/vulkan.rs#L277) + +- [x] **Altitude | Medium | Keep FG admission and recording outcomes together for each Godot Vulkan pass.** vulkan.cpp:626 shuttles a mutable VkFgPass through fg_begin, Runtime enable_options, a separate backend query, fg_admit and fg_recorded. The final-scene branch then rereads the session-wide fg_result, which may still describe an earlier pass when no presenter exists. Have the pass owner perform that sequence around typed recording callbacks and return the current pass outcome directly, including no presenter; publish diagnostics separately. [integrations/godot/native/vulkan.rs:436](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/vulkan.rs#L436) + +- [x] **Duplication | Medium | Merge Vulkan extension names with one checked helper.** integrations/godot/native/vulkan/creation.rs:63 and games/unity-mono/src/vulkan_resolver.rs:243 retain the supplied order, compare NUL-terminated names by content and append absent requirements. Both add the Win32 memory/semaphore pair in their device paths at creation.rs:447 and vulkan_resolver.rs:286. Unity guards the u32 count limit and skips null entries during comparison, while Godot also merges vendor lists and converts the final length back to u32. Share a checked ordered merge with explicit null and count handling, and keep feature-chain construction, availability tests and retry policy with each caller. [integrations/godot/native/vulkan/creation.rs:63](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/vulkan/creation.rs#L63) + +- [x] **Boundaries | Medium | Move XeSS feature-chain compatibility and fallback into Runtime device negotiation.** Godot decides which promoted Vulkan structures to insert for XeSS, which features to clear, and in what order to retry device creation without XeSS, interoperability and latency. vulkan_creation.cpp:175-192 patches the cloned chain before calling the existing Runtime XeSS requirement service. The compatibility rules concern the SDK and Vulkan structures, and would have to be repeated by another engine. Extend the Runtime negotiation interface to own the optional stages and report which were accepted. Leave Godot responsible for lending its base request, invoking its loader and returning the resulting device. [integrations/godot/native/vulkan/creation.rs:82](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/vulkan/creation.rs#L82) + +- [x] **Altitude | Medium | Associate Vulkan feature readiness with the Godot device that acquired it.** A new device creation attempt clears the global XeSS/interop flags before the driver accepts it, whereas adapter facts change only on success. A failed secondary creation can therefore invalidate the live render device's capabilities; destroying a device does not remove its recorded adapter/readiness either. Build a capability receipt locally, publish it for the successful VkDevice and retire only that device's receipt; use the rendering device's receipt for provider admission. [integrations/godot/native/vulkan/creation.rs:371](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/vulkan/creation.rs#L371) + +- [x] **Duplication | Medium | Drain the Godot Vulkan presenter once per shutdown attempt.** integrations/godot/native/vulkan.rs:241 disables and drains the presenter, then calls retire_contexts under the same guard. When an SR context is live, integrations/godot/native/vulkan/sr.rs:97 immediately drains it again before the independent device-idle check. Both calls reach rsf_fgvk_drain on the same presenter at integrations/godot/native/vulkan.cpp:317, and vulkan/sr/tests.rs:450 explicitly expects both calls. A successful first drain is followed by another synchronization and failure point with no intervening submission. Separate already-drained context destruction from live reconfiguration, keep the first disable/drain and device-idle proof on shutdown, and assert one presenter drain in the fixture. [integrations/godot/native/vulkan/sr.rs:97](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/vulkan/sr.rs#L97) + +- [x] **Boundaries | Medium | Put Vulkan SR provider dispatch behind a single Runtime context.** Godot keeps separate generic and FSR4 context handles, chooses which create, plan, evaluate and destroy entry points to call, applies the DLSS preset, and decides when to run the spatial fallback. vulkan.cpp:325-418 forwards those choices to the respective Runtime APIs, while :564-566 repeats the dispatch for command retirement. Every caller of this path must understand provider-specific lifetime and continuation rules. Accept Godot's graph handoff, frame resources and callbacks through a generic Runtime session and return its effective plan, continuation and result. [integrations/godot/native/vulkan/sr.rs:188](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/vulkan/sr.rs#L188) + +- [x] **Altitude | Medium | Keep diagnostic failures from skipping Godot's Vulkan spatial fallback.** The SR path propagates a failed dump or log with ? before deciding whether a refused evaluation needs fallback. The native leaves explicitly return failure on a caught exception. A diagnostic failure can therefore leave a reduced frame without reconstruction or turn a completed evaluation into an unreported failure. Record the actual evaluation/fallback outcome independently and treat diagnostic delivery as best effort. [integrations/godot/native/vulkan/sr.rs:252](https://github.com/KillerPixelCrew/ReScaleFrame/blob/894a55f9157a71835986ef3e9b64dc8023eedb0c/integrations/godot/native/vulkan/sr.rs#L252) + +## Shader headers outside the C++ count + +The following tracked Anomaly headers contain shader source and use the same file extension as native headers. + +- [games/anomaly/shaders/core/rsf_core_pixel.h](games/anomaly/shaders/core/rsf_core_pixel.h) +- [games/anomaly/shaders/core/rsf_core_tess.h](games/anomaly/shaders/core/rsf_core_tess.h) +- [games/anomaly/shaders/core/rsf_core_vertex.h](games/anomaly/shaders/core/rsf_core_vertex.h) +- [games/anomaly/shaders/foliage/rsf_anomaly_foliage.h](games/anomaly/shaders/foliage/rsf_anomaly_foliage.h) diff --git a/README.md b/README.md index 39f05a705..a7ff94d6f 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,9 @@ remains pending. See the [RDR2 integration guide](games/rdr2/README.md). ReScaleFrameCraft connects Minecraft's Java/OpenGL renderer to ReScaleFrame's native runtime. The adapter supplies scene colour, depth, motion, camera state and frame boundaries. -The [OpenGL sharing layer](runtime/presentation/src/gl_shared_surface.cpp) imports shared +The [OpenGL sharing layer](runtime/orchestrator/src/gl_shared_surface.rs) imports shared D3D12 resources as OpenGL textures and synchronizes access through shared fences and -semaphores. The [GL pipeline](runtime/orchestrator/src/gl_pipeline.cpp) passes those resources +semaphores. The [GL pipeline](runtime/orchestrator/src/gl_pipeline.rs) passes those resources to the D3D12 SR/FG paths and exposes reconstructed output back to OpenGL. That bridge brings technology requiring D3D12 into Minecraft's OpenGL rendering path. @@ -103,8 +103,9 @@ AC7's integration brings modern upscaling and frame generation into its existing rendering pipeline. Native hooks expose the engine's scene, camera, depth, motion and composition boundaries, and prepare the renderer to supply the data those technologies need. -The [native bridge](loader/proxy/src/dlss_bridge.c) routes scene passes into ReScaleFrame's -SR processing and carries CPU, scene, UI and window events into the shared FG/latency paths. +The [AC7 carrier](games/ac7/carrier/dlss_bridge.c) reports scene passes and CPU, scene, UI and +window events to the shared [D3D11 host](runtime/orchestrator/src/d3d11_host.rs), which runs SR, +FG, latency and the overlay for AC7 as it does for Skyrim SE and Fallout 4. The D3D11/D3D12 presentation bridge provides the route to SDKs that require D3D12. Reconstructed scene output is reinserted into the engine's frame. UI and translucent @@ -118,8 +119,9 @@ The Unity Mono adapter connects URP RenderGraph to ReScaleFrame through a manage and Unity's native rendering interfaces. The helper identifies the reconstruction and pre-UI stages, produces camera/temporal packets and queues native render events. -The [native Unity bridge](games/unity-mono/src/bridge.cpp) validates those packets, retains -their resources and forwards the passes to the shared runtime. SR runs before DoF, bloom +The [native Unity bridge](integrations/unity/native/render_bridge.c) validates those packets through +its [Rust frame state](integrations/unity/src/bridge_state.rs), retains their resources and +forwards the passes to the shared runtime. SR runs before DoF, bloom and tonemapping; completed scene colour is captured before UI for FG. Player-loop callbacks supply the CPU frame boundaries used by latency coordination. diff --git a/apps/launcher/CMakeLists.txt b/apps/launcher/CMakeLists.txt deleted file mode 100644 index c2816b127..000000000 --- a/apps/launcher/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_executable(rsf_launcher src/main.cpp) -target_link_libraries(rsf_launcher PRIVATE rsf_build_options) -set_target_properties(rsf_launcher PROPERTIES OUTPUT_NAME "ReScaleFrame") diff --git a/apps/launcher/src/main.cpp b/apps/launcher/src/main.cpp deleted file mode 100644 index 44cf238cb..000000000 --- a/apps/launcher/src/main.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include - -#include -#include - -int main(int argc, char* argv[]) -{ - if (argc == 2 && std::string_view(argv[1]) == "--version") { - std::cout << "ReScaleFrame " << RSF_VERSION_STRING << '\n'; - return 0; - } - if (argc > 2 || (argc == 2 && std::string_view(argv[1]) != "--help")) { - std::cerr << "Unknown option. Use --help.\n"; - return 2; - } - std::cout << "ReScaleFrame " << RSF_VERSION_STRING << "\n" - "A framework for adding upscaling and frame generation to games.\n\n" - "Initial scaffold. Game launching and injection are not implemented.\n" - "Options: --help, --version\n"; - return 0; -} diff --git a/cmake/rust_static.cmake b/cmake/rust_static.cmake new file mode 100644 index 000000000..0268a97a6 --- /dev/null +++ b/cmake/rust_static.cmake @@ -0,0 +1,169 @@ +find_program(RSF_CARGO cargo REQUIRED) +if(MSVC) + set(RSF_RUST_TARGET x86_64-pc-windows-msvc) +else() + set(RSF_RUST_TARGET x86_64-pc-windows-gnu) +endif() +set(RSF_CARGO_DIR "${CMAKE_BINARY_DIR}/cargo") +set(RSF_CARGO_ARTIFACTS "${RSF_CARGO_DIR}/${RSF_RUST_TARGET}/$,debug,release>") + +# Builds of one package run one after another: each waits for the previous build target of its package. +function(rsf_serialize_rust_build build_target package) + get_property(previous GLOBAL PROPERTY RSF_RUST_BUILD_${package}) + if(previous) + add_dependencies(${build_target} ${previous}) + endif() + set_property(GLOBAL PROPERTY RSF_RUST_BUILD_${package} ${build_target}) +endfunction() + +# Every archive builds in the one target directory, so each dependency compiles once. Cargo writes a +# package's archive to .lib whatever its features, and a second build of the package +# (the plugin entry, the fixtures) would overwrite the first, so each build copies its archive to a +# file named for its own target. Builds of one package run one after another so that the copy is of +# its own build. An optional `ENV NAME=value` sets one variable for the Cargo build; the remaining +# arguments go to cargo build. +# +# A binary links one Rust archive: two would each carry rsf-game-sys and the other shared crates, and +# their exports collide once Cargo has built the copies with different hashes and both are pulled in. +# `CARRIES ""` names the archive targets whose crates this archive embeds as rlibs. +# rsf_resolve_embedded_archives (run once at the end of the top-level CMakeLists.txt) lists, for each +# binary, every archive in its link closure that another archive in it carries in the binary's +# RSF_EMBEDDED_ARCHIVES; such an archive keeps its C leaves and system libraries there but not its +# archive file. An archive that carries rsf_orchestrator_rust builds with the Runtime archive's +# features and environment (RSF_RUNTIME_EMBED_ARGS). The archive path is the target's RSF_ARCHIVE. +function(rsf_add_rust_static target build_target package archive) + cmake_parse_arguments(PARSE_ARGV 4 rsf "" "ENV;CARRIES" "") + if("rsf_orchestrator_rust" IN_LIST rsf_CARRIES) + get_property(rsf_embed GLOBAL PROPERTY RSF_RUNTIME_EMBED_ARGS) + cmake_parse_arguments(rsf_embed "" "ENV" "" ${rsf_embed}) + list(APPEND rsf_UNPARSED_ARGUMENTS ${rsf_embed_UNPARSED_ARGUMENTS}) + if(rsf_embed_ENV) + set(rsf_ENV "${rsf_embed_ENV}") + endif() + endif() + set(rust_archive "${RSF_CARGO_ARTIFACTS}/archives/${CMAKE_STATIC_LIBRARY_PREFIX}${target}${CMAKE_STATIC_LIBRARY_SUFFIX}") + add_custom_target(${build_target} + COMMAND "${CMAKE_COMMAND}" -E env ${rsf_ENV} "${RSF_CARGO}" build --locked -p ${package} ${rsf_UNPARSED_ARGUMENTS} + --target ${RSF_RUST_TARGET} --target-dir "${RSF_CARGO_DIR}" $<$>:--release> + COMMAND "${CMAKE_COMMAND}" -E make_directory "${RSF_CARGO_ARTIFACTS}/archives" + COMMAND "${CMAKE_COMMAND}" -E copy_if_different + "${RSF_CARGO_ARTIFACTS}/${CMAKE_STATIC_LIBRARY_PREFIX}${archive}${CMAKE_STATIC_LIBRARY_SUFFIX}" "${rust_archive}" + WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" + BYPRODUCTS "${rust_archive}" + COMMAND_EXPAND_LISTS VERBATIM) + rsf_serialize_rust_build(${build_target} ${package}) + add_library(${target} INTERFACE) + add_dependencies(${target} ${build_target}) + set_target_properties(${target} PROPERTIES RSF_ARCHIVE "${rust_archive}" RSF_CARRIES "${rsf_CARRIES}") + target_link_libraries(${target} INTERFACE + "$<$>>:${rust_archive}>" + ntdll userenv ws2_32 dbghelp) + if(MSVC) + # legacy_stdio_definitions: the bounded swprintf entry the settings store formats with. + target_link_libraries(${target} INTERFACE synchronization legacy_stdio_definitions) + endif() +endfunction() + +# Builds the executables or DLLs of a Cargo package, which the tests run in a process of their own. +# FILES are the outputs, relative to Cargo's profile directory (a bin or cdylib name with its +# suffix); with a each is also copied there, where CTest and the fixtures look for it. +# ARGS go to cargo build (--example, --features). Builds of one package run one after another, as +# for the archives above. +function(rsf_add_rust_artifacts build_target package directory) + cmake_parse_arguments(PARSE_ARGV 3 rsf "ALL" "" "FILES;ARGS") + set(copy) + set(outputs) + if(directory) + list(APPEND copy COMMAND "${CMAKE_COMMAND}" -E make_directory "${directory}") + endif() + foreach(file IN LISTS rsf_FILES) + get_filename_component(name "${file}" NAME) + list(APPEND outputs "${RSF_CARGO_ARTIFACTS}/${file}") + if(directory) + list(APPEND copy COMMAND "${CMAKE_COMMAND}" -E copy_if_different + "${RSF_CARGO_ARTIFACTS}/${file}" "${directory}/${name}") + list(APPEND outputs "${directory}/${name}") + endif() + endforeach() + set(all) + if(rsf_ALL) + set(all ALL) + endif() + add_custom_target(${build_target} ${all} + COMMAND "${RSF_CARGO}" build --locked -p ${package} ${rsf_ARGS} + --target ${RSF_RUST_TARGET} --target-dir "${RSF_CARGO_DIR}" $<$>:--release> + ${copy} + WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" + BYPRODUCTS ${outputs} + COMMAND_EXPAND_LISTS VERBATIM) + rsf_serialize_rust_build(${build_target} ${package}) +endfunction() + +# The targets that CMake files under define, recursively. +function(rsf_directory_targets directory out) + get_property(targets DIRECTORY "${directory}" PROPERTY BUILDSYSTEM_TARGETS) + get_property(subdirectories DIRECTORY "${directory}" PROPERTY SUBDIRECTORIES) + foreach(subdirectory IN LISTS subdirectories) + rsf_directory_targets("${subdirectory}" more) + list(APPEND targets ${more}) + endforeach() + set(${out} ${targets} PARENT_SCOPE) +endfunction() + +# The targets named in link items, inside generator expressions too (LINK_ONLY, LINK_LIBRARY and +# conditions), with aliases resolved. It errs on the side of including a conditional item. +function(rsf_link_item_targets items out) + set(found) + foreach(item IN LISTS items) + string(REGEX MATCHALL "[A-Za-z0-9_.+-]+(::[A-Za-z0-9_.+-]+)?" names "${item}") + foreach(name IN LISTS names) + if(TARGET "${name}") + get_target_property(aliased "${name}" ALIASED_TARGET) + if(aliased) + set(name "${aliased}") + endif() + list(APPEND found "${name}") + endif() + endforeach() + endforeach() + set(${out} ${found} PARENT_SCOPE) +endfunction() + +# See rsf_add_rust_static: drops, from every binary, the archives another archive it links carries. +function(rsf_resolve_embedded_archives) + rsf_directory_targets("${PROJECT_SOURCE_DIR}" targets) + foreach(head IN LISTS targets) + get_target_property(type ${head} TYPE) + if(NOT type MATCHES "^(EXECUTABLE|SHARED_LIBRARY|MODULE_LIBRARY)$") + continue() + endif() + get_target_property(items ${head} LINK_LIBRARIES) + rsf_link_item_targets("${items}" queue) + set(closure) + while(queue) + list(POP_FRONT queue dependency) + if(dependency IN_LIST closure) + continue() + endif() + list(APPEND closure ${dependency}) + get_target_property(items ${dependency} INTERFACE_LINK_LIBRARIES) + if(items) + rsf_link_item_targets("${items}" more) + list(APPEND queue ${more}) + endif() + endwhile() + set(embedded) + foreach(dependency IN LISTS closure) + get_target_property(carried ${dependency} RSF_CARRIES) + foreach(archive IN LISTS carried) + if(archive IN_LIST closure) + list(APPEND embedded ${archive}) + endif() + endforeach() + endforeach() + if(embedded) + list(REMOVE_DUPLICATES embedded) + set_property(TARGET ${head} APPEND PROPERTY RSF_EMBEDDED_ARCHIVES ${embedded}) + endif() + endforeach() +endfunction() \ No newline at end of file diff --git a/cmake/vendor.cmake b/cmake/vendor.cmake new file mode 100644 index 000000000..19c750be2 --- /dev/null +++ b/cmake/vendor.cmake @@ -0,0 +1,45 @@ +# Vendor SDK header trees, each located once. They are fetched into untracked directories, and a +# missing tree switches its backend off (the C providers answer NOT_COMPILED), so a checkout +# without them still configures, builds and tests. Override a path with -D=...; the RSF_HAVE_* +# flags below are what the rest of the build tests. +set(RSF_STREAMLINE_INCLUDE "${CMAKE_SOURCE_DIR}/vendor/streamline/include" CACHE PATH + "Directory holding Streamline's sl.h") +set(RSF_FFX_INCLUDE "${CMAKE_SOURCE_DIR}/vendor/fidelityfx/Kits/FidelityFX/api/include" CACHE PATH + "Directory holding FidelityFX's ffx_api.h") +set(RSF_XESS_INCLUDE "${CMAKE_SOURCE_DIR}/vendor/xess/inc" CACHE PATH + "Directory holding XeSS's xess/xess.h and the Vulkan and frame generation headers beside it") +set(RSF_RENDERDOC_INCLUDE "${CMAKE_SOURCE_DIR}/vendor/renderdoc" CACHE PATH + "Directory holding RenderDoc's renderdoc_app.h") +set(RSF_UNITY_NATIVE_INCLUDE "${CMAKE_SOURCE_DIR}/vendor/unity-native/include" CACHE PATH + "Unity native-plugin headers; untracked, see docs/dependencies.md") +set(RSF_VULKAN_INCLUDE "${CMAKE_SOURCE_DIR}/references/godot/engine/thirdparty/vulkan/include" CACHE PATH + "Vulkan headers for native Vulkan services") +set(RSF_FFX_VK_INCLUDE "${CMAKE_SOURCE_DIR}/vendor/fidelityfx-vulkan/ffx-api/include" CACHE PATH + "Pinned FidelityFX Vulkan API headers") + +function(rsf_have name) + set(${name} ON) + foreach(header IN LISTS ARGN) + if(NOT EXISTS "${header}") + set(${name} OFF) + endif() + endforeach() + set(${name} ${${name}} PARENT_SCOPE) +endfunction() + +rsf_have(RSF_HAVE_VULKAN "${RSF_VULKAN_INCLUDE}/vulkan/vulkan.h") +rsf_have(RSF_HAVE_STREAMLINE "${RSF_STREAMLINE_INCLUDE}/sl.h") +rsf_have(RSF_HAVE_XESS "${RSF_XESS_INCLUDE}/xess/xess.h") +rsf_have(RSF_HAVE_XESS_VK "${RSF_XESS_INCLUDE}/xess/xess_vk.h") +rsf_have(RSF_HAVE_XESS_FG "${RSF_XESS_INCLUDE}/xess_fg/xefg_swapchain_d3d12.h" "${RSF_XESS_INCLUDE}/xell/xell_d3d12.h") +rsf_have(RSF_HAVE_FFX_VK "${RSF_FFX_VK_INCLUDE}/ffx_api/vk/ffx_api_vk.h") +rsf_have(RSF_HAVE_FFX "${RSF_FFX_INCLUDE}/ffx_api.h") +rsf_have(RSF_HAVE_FFX_FG "${RSF_FFX_INCLUDE}/../../framegeneration/include/ffx_framegeneration.h") +rsf_have(RSF_HAVE_FFX_DX12_FG "${RSF_FFX_INCLUDE}/dx12/ffx_api_dx12.h" + "${RSF_FFX_INCLUDE}/../../framegeneration/include/ffx_framegeneration.h") +rsf_have(RSF_HAVE_FFX_DX12_SR "${RSF_FFX_INCLUDE}/dx12/ffx_api_dx12.h" + "${RSF_FFX_INCLUDE}/../../upscalers/include/ffx_upscale.h") + +# Vulkan headers for the frame dump: the pinned tree above, else the installed SDK. +find_path(RSF_FRAME_DUMP_VULKAN_INCLUDE vulkan/vulkan.h + HINTS "${RSF_VULKAN_INCLUDE}" "$ENV{VULKAN_SDK}/Include") diff --git a/docs/current-status.md b/docs/current-status.md index 44a3c1205..c6eac062f 100644 --- a/docs/current-status.md +++ b/docs/current-status.md @@ -1,108 +1,23 @@ # Current implementation and validation -16 November 2026: Fallout 4 1.11.240 has user-accepted DLSS SR/FG in the tested -moving scene. XeSS FG's 128-frame stall was traced with a CPU dump and matching -Steam-overlay binary analysis to a Present-lock cycle. The shared Steam -integration now dispatches registered RSF facades before that lock. A later -physical VSync interval correction improved the observed XeSS result from about -23-28 base FPS to 82 base/164 presented FPS; the user accepted the improvement. -These are scoped game observations, not a controlled vendor benchmark. - -Actual native input and simulation callbacks supply latency markers. Reflex -Off/On/Boost and live PCL receipt delivery have recorded evidence; derived -boundaries do not authorize SDK markers. XeLL settings completion guarding is -built and CPU-tested but awaits deployment and a game settings-switch check. -AMD Anti-Lag has focused contract coverage, with no AMD device acceptance on -this NVIDIA machine. Full shader/material and lifecycle coverage remain tracked -separately. No release or broad rendering-readiness claim is made. GPU -autocapture is disabled. See the -[latency and XeSS investigation](research/fallout4-actual-latency-boundaries-20261116.md) -and [SR dropout investigation](research/fallout4-sr-dropout-20261116.md). - -15 November 2026: Skyrim SE 1.7.104 has an experimental no-SKSE pre-HDR path. -Bounded vanilla QASmoke runs evaluated DLSS at native 1711x1048, reinserted into -native colour, captured actual backend inputs/output and matched native Present. -Live SR off/on preserved native TAA and consumed its history reset. Camera and -host ABI fixtures pass. A subsequent native raster probe produced 1141x699 inside -1711x1048 allocations with clear depth outside the active rectangle, then restored -full resolution and resumed native DLSS. Reduced modes still use native fallback -until post-processing auxiliary repair is complete. Reduced-resolution SR, portable startup, shader repairs, -moving-game quality, worker input ownership, FG, latency and CS/ENB handover are -incomplete; CS currently refuses activation. Rendering readiness stays zero. -See [research](research/skyrim-se-integration.md) for evidence and limitations. - -End-of-day checkpoint, 25 October 2026: work stopped at the user's request. -The latest native Release gate passes 75 discovered tests, with 64 executed and -11 opt-in skips, plus formatting and Clippy. Standard/.NET editors also build -with a new FSR1 storage-format correction, but its GPU retake and matching -template rebuilds have not run. The new aggregate Vulkan matrix runner preserves -actual images and failures; its initial FSR1 case exposed the format mismatch, -and a full matrix has not run. DLSS secondary-window teardown still crashes; -the primary-only latency-chain experiment failed and was reverted. FSR2 stage -captures narrow the remaining edge displacement without delivering a production -fix. XeSS MFG capability/admission follow-up remains unimplemented. -See the [progress tracker](implementation.md) for the restart checkpoint. - -25 October 2026: the developer-facing Godot integration is in progress under -`integrations/godot`. Custom standard/.NET 4.7.2 Forward+ DX12 engines passed -SR/FG/MFG provider switching and PCL/input-marker fixtures. Actual FSR-generated -frame dumps exposed and helped correct a zero-motion handoff and camera matrix -conventions. Six standard/.NET visual cases now compare generated images with -independently rendered midpoints. SR-enabled testing also corrected Godot's -unwritten-motion sentinel. The expanded matrix passed vector/camera checks on -120 generated frames, but four of 30 end-to-end image cases still fail for -FSR2/FSR3 object motion. Standard/.NET Debug and Release -exports passed runtime/controller fixtures, with C# on .NET and a separate -GDScript-only .NET export. Native Vulkan FSR2/FSR3 SR now runs on standard/.NET -editors with resize, C# calls, raw GPU readbacks and validation-layer checks. -Vulkan FSR3 FG now passes standard/.NET functional fixtures with SR Off, -Off/resume, resize and a secondary native window. Captures include actual SDK -generated images and independent midpoint references. FSR2 image displacement -and a synchronization-validation present hazard remain open. The corrected -SR Off/FSR3 Vulkan image suite passes 12 cases and 48 actual generated frames. -Vulkan PCL/Reflex now runs with camera-free native presentation and alongside -FSR3 FG on standard/.NET editors. Vulkan DLSS SR also runs on both editions; -six DLSS SR + FSR3 FG + PCL image cases pass against independent midpoint -renders, covering 24 actual generated frames. XeSS Vulkan SR now passes six standard/.NET object/camera/combined image cases -with FSR3 FG and PCL, covering 24 actual generated images. Vulkan DLSS FG passes -strict standard/.NET device checks and independent midpoint image tests, including -a shared DLSS SR + FG case. Higher-count MFG3 passes strict GPU checks and independent quarter-step image -comparisons, preserving all three generated ordinals. XeSS FG uses a Vulkan/DX12 presenter: standard/.NET -lifecycle, C# and PCL checks pass. All twelve standard/.NET object/camera/combined -image cases with SR Off or XeSS SR pass, covering 48 actual SDK-generated images. -Optional foreground maintenance records scoped activation and preserved failed controls. -FSR4 SR uses a graph-owned -Vulkan/DX12 handoff; both editors pass switching/resize checks, with C# on .NET. One combined-motion -image case and four raw SR frames pass per edition. Rebuilt standard/.NET Release exports -also pass FSR4 switching, resize and raw-output checks. Debug exports pass XeSS FG/PCL, -Off/resume and resize on both editions. The strict DLSS lifecycle fixture now passes -all eleven phases and API/synchronization checks after the options correction, but -still crashes during SDK shutdown. FSR4 FG routing builds and correctly refuses -the current NVIDIA provider list; AMD execution remains untested. These remain bounded fixture results. Cold -startup pauses, FSR2 displacement, DLSS shutdown, new-provider export coverage and broader -scene-quality acceptance remain open. This does -not change game-plugin readiness flags. -Rebuilt Vulkan Debug/Release exports pass 12 standard/.NET SR, FG and -camera-free PCL fixtures, with C# in SR/FG and actual PNG/raw input checks in SR. -[Evidence and limits](research/godot-engine-integration.md). - -10 October update: the user reported a Unity UI/overlay regression in the new -package. The pre-UI snapshot, overlay synchronization, touch handling and Auto -FG corrections are applied and pass the recorded automated checks. Fresh game -and Claw acceptance remain pending; the earlier acceptance below does not cover -this package. [Correction and limits](research/shared-fg-20261004.md#unity-ui-regression-correction-10-october-2026). - -Later local live testing replaced the managed snapshot with a native copy on -Unity's current pre-UI recording list. Menu/gameplay and provider replacements -remained responsive, and the user confirmed the correction works. This local -acceptance supersedes the pending snapshot correction above. FSR4 ML-FG on -NVIDIA/Intel and physical Claw touch remain unestablished; the investigated INT8 -guides provide FSR4 SR compatibility. - -Documentation checked on 7 October 2026 against source commit -`fda5fd0f2730b40e5b96f419bc0a05cb0b73932b`, the recorded research and GitHub release metadata. -This is a source/documentation audit. No new game, GPU or Windows build was run for this audit. +Latest recorded acceptance by integration. Each row is a scoped game observation, not a controlled +vendor benchmark; the dated entries in [the implementation tracker](implementation.md) hold the +failures and corrections. +| Date | Integration | Recorded result and limits | +| --- | --- | --- | +| 16 Nov 2026 | Fallout 4 1.11.240 | User-accepted DLSS SR/FG in the tested moving scene. XeSS FG's 128-frame stall was traced with a CPU dump and matching Steam-overlay binary analysis to a Present-lock cycle; the shared Steam integration now dispatches registered RSF facades before that lock. A later physical VSync interval correction improved the observed XeSS result from about 23-28 base FPS to 82 base/164 presented FPS, which the user accepted. See the [latency and XeSS investigation](research/fallout4-actual-latency-boundaries-20261116.md) and [SR dropout investigation](research/fallout4-sr-dropout-20261116.md). | +| 15 Nov 2026 | Skyrim SE 1.7.104 | Experimental no-SKSE pre-HDR path. Bounded vanilla QASmoke runs evaluated DLSS at native 1711x1048, reinserted into native colour, captured actual backend inputs/output and matched native Present; live SR off/on preserved native TAA. Reduced modes still use native fallback; reduced-resolution SR, portable startup, shader repairs, moving-game quality, worker input ownership, FG, latency and CS/ENB handover are incomplete, and CS refuses activation. Rendering readiness stays zero. See [research](research/skyrim-se-integration.md). | +| 12 Nov 2026 | Anomaly | SR stages 1 and 2, motion vectors and the overlay game-accepted; jitter, foliage motion and temporal SR built and fixture-tested; FG device-fixture-tested only. See [the acceptance matrix](research/anomaly-sr-seam.md#integration-goal-and-acceptance-matrix-from-the-former-progressmd). | +| 25 Oct 2026 | Godot (developer integration, `integrations/godot`) | Standard and .NET Forward+ DX12 and Vulkan engines pass SR/FG/MFG provider switching, PCL/input-marker fixtures and independent-midpoint image cases for several providers. Open: FSR2/FSR3 object-motion cases (four of 30 end-to-end image cases), FSR2 displacement, a synchronization-validation present hazard, the DLSS lifecycle crash at SDK shutdown, cold-start pauses and AMD FSR4 FG execution. These are bounded fixture results and do not change game-plugin readiness flags. [Evidence and limits](research/godot-engine-integration.md). | +| 10 Oct 2026 | Unity (Drag'n Wash) | A UI/overlay regression in the new package was corrected (native pre-UI copy, overlay synchronization, touch handling, Auto FG); menu/gameplay and provider replacements stayed responsive and the user confirmed the correction. FSR4 ML-FG on NVIDIA/Intel and physical Claw touch remain unestablished. [Correction and limits](research/shared-fg-20261004.md#unity-ui-regression-correction-10-october-2026). | + +Actual native input and simulation callbacks supply latency markers. Reflex Off/On/Boost and live +PCL receipt delivery have recorded evidence; derived boundaries do not authorize SDK markers. XeLL +settings completion guarding is built and CPU-tested but awaits deployment and a game +settings-switch check. AMD Anti-Lag has focused contract coverage, with no AMD device acceptance on +this NVIDIA machine. Full shader/material and lifecycle coverage remain tracked separately. No +release or broad rendering-readiness claim is made. GPU autocapture is disabled. ## Downloads and source builds 18 October 2026: the [AC7 0.1.1 prerelease](https://github.com/KillerPixelCrew/ReScaleFrame/releases/tag/ac7-v0.1.1) @@ -129,13 +44,13 @@ it does not prove that a particular ZIP received game or Claw acceptance. | --- | --- | --- | | AC7, Steam build 9855922, D3D11 | Native renderer hooks and pre-tonemap SR; output-resolution UI/briefing; TrueSky correction; DLSS, FSR2/3/4, XeSS; D3D12 presentation facade and independent FG | User accepted corrected SR/UI/cloud rendering and DLSS-G. FSR3/XeSS FG have synthetic device activity; new AC7 vendor FG paths lack live acceptance. Briefing FG is deferred. Later low-resolution lighting defects and missing-object motion coverage remain open. | | Drag'n Wash, Steam build 25286774, Unity 6000.3.14f1 Mono/URP RenderGraph, D3D12 | Shared shim, Mono/Harmony hooks, pre-DoF SR, overlay, DLSS/FSR/XeSS FG switching, pre-UI colour and temporal inputs independent of SR | Live SR execution and improved post-processing order recorded; user accepted XeSS/DLSS-G and the final FSR correction. General scene/resize/teardown coverage, other Unity players and MSI Claw acceptance remain unproven. | -| Project Wingman, researched UE4.27.2 build | Exact-build XInput carrier and guarded native temporal graph observer | Release-built, contract-tested and deployed; user-run desktop mission verifies readable inputs/history/rectangles. GPU leases, SR, FG, latency and VR processing remain unimplemented. VR hardware was unavailable. | +| Project Wingman, researched UE4.27.2 build | Guarded native temporal graph observer whose sites are found by signature, through the generic XInput carrier | Release-built, contract-tested and deployed; user-run desktop mission verifies readable inputs/history/rectangles. Signature discovery is proven on the recovered researched executable, not yet in a game run. GPU leases, SR, FG, latency and VR processing remain unimplemented. VR hardware was unavailable. | | Red Dead Redemption 2, Steam build 13773296, RAGE | Native common-SR adapter, scene/pacing/marker, shared FG presentation and Rust overlay; forced-DX12 ASI and Social Club correction | Four SR providers and recorded DLSS/XeSS FG intervals accepted. Shared overlay and all five runtime performance presets are user-confirmed, with actual input dimensions captured in logs. FG-Off selector mapping corrected, regression-tested and deployed. Normal SDR pixels match outside the captured HUD region. Complete HUD modes, HDR and non-NVIDIA hardware remain unproven; broad readiness stays zero. | All native plugin APIs still report `rendering_ready = 0`. That conservative code-level flag is distinct from recorded user acceptance of individual deployed paths; it must not be rewritten in prose as either universal support or absence of all working rendering. Detection -checks executable basename, x64 machine and exact SHA256. Other builds remain unknown. +checks executable basename, x64 machine and exact SHA256 in the adapters not yet converted to AGENTS.md Rule 4; the Unity Mono plugin discovers the player instead and logs the hash as evidence. Evidence: [AC7 consumer session](research/ac7-consumer-session.md), [native renderer](research/ac7-native-renderer-refactor-20261001.md), @@ -181,11 +96,11 @@ physical scanout, a latency reduction, or an in-game performance gain. | Contract | Current version | Source | | --- | --- | --- | -| Game plugin lifecycle and renderer callbacks | 13 | `sdk/game/include/rescaleframe/game_api.h`, `game_renderer.h` | -| Frame/camera record | 1 | `sdk/game/include/rescaleframe/game_frame.h` | -| Vendor-neutral backend | 3 | `runtime/contract/include/rescaleframe/backend.h` | +| Game plugin lifecycle and renderer callbacks | 24 | `sdk/game/include/rescaleframe/game_api.h`, `game_renderer.h` | +| Frame record / camera record | 2 / 1 | `sdk/game/include/rescaleframe/game_frame.h` | +| Vendor-neutral backend | 4 | `runtime/contract/include/rescaleframe/backend.h` | | FG provider | 2 | `runtime/contract/include/rescaleframe/frame_generation.h` | -| Overlay | 12 | `ui/overlay/include/rescaleframe/overlay.h` | +| Overlay | 20 | `ui/overlay/include/rescaleframe/overlay.h` | `VERSION` and the Cargo workspace both specify 0.1.1. Equal component versions do not imply equal builds or ABI compatibility; deploy matched artifacts. SDK headers are optional, and absent headers diff --git a/docs/dependencies.md b/docs/dependencies.md index 6a16b74b7..5a13d5216 100644 --- a/docs/dependencies.md +++ b/docs/dependencies.md @@ -1,5 +1,16 @@ # Dependencies +The orchestrator uses the Cargo build dependency `cc` to compile the native +plugin exception guards. Cargo.lock pins it and its build tools. The guards +link into the orchestrator static library for both embedded and DLL consumers. +The Windows build uses Microsoft's `windows-sys` bindings for profile storage and Win32 calls, +and the `windows` crate for typed COM (D3D11, DXGI). Cargo.lock pins the bindings. + +Fallout 4's camera port derives its matrix operations from the MIT-licensed +DirectXMath 3.20 headers in Windows SDK 10.0.26100. The Microsoft copyright +notice and MIT terms accompany the source in [LICENSE](../LICENSE). +[Camera source comparison](research/rust-fallout4-camera.md) + ## REA development tooling `tools/rea` pins `rea-agents` 6.4.0 from npm, whose published Git revision is @@ -20,12 +31,15 @@ retain their commercial licenses and are not copied into Git or runtime packages ## Godot developer integration -The [Godot dependency lock](../integrations/godot/dependencies.json) pins Godot -4.7.2, godot-cpp, official standard/.NET archives, vendor SDKs and the Godot Mesa -NIR binary used by the Windows D3D12 engine build. Engine/reference checkouts, -SDKs and build tools remain ignored. The GDExtension links godot-cpp; the custom -engine builds the first-party module from this monorepo. The add-on preserves -the Godot/godot-cpp license texts and the vendor payload's bundled notices. +The [dependency lock](../eng/dependencies.json) pins Godot +4.7.2, godot-cpp, official standard/.NET archives, the vendor SDKs (see +[Vendor SDKs](#vendor-sdks)) and the Godot Mesa NIR binary used by the Windows D3D12 +engine build. Engine/reference checkouts and build tools remain ignored. The GDExtension is written against Godot's C +interface and does not link godot-cpp. The godot-cpp pin is kept as the source of the +4.7 API description (`extension_api-4-7.json`, `gdextension_interface.json`) that the +method hashes and record layouts follow. The custom engine builds the first-party +module from this monorepo. The add-on preserves the Godot/godot-cpp license texts +and the vendor payload's bundled notices. Python tooling uses the local environment and pinned SCons, NumPy and Pillow requirements. .NET validation uses the matching official GodotSharp assemblies @@ -34,7 +48,7 @@ Read the [build and validation record](research/godot-engine-integration.md) for exact revisions, binary hashes, exported-player coverage and image failures. Native Vulkan FSR2/FSR3 uses the separately pinned FidelityFX SDK 1.1.4 at -`c6efa6bf7f2027b3ec94f28578bb5965eabb9e55`. `eng/build-godot-vulkan.ps1` builds +`c6efa6bf7f2027b3ec94f28578bb5965eabb9e55` (the `vendor/fidelityfx-vulkan` submodule). `eng/build-godot-vulkan.ps1` builds it in an ignored staging directory, with guarded storage-format and swapchain lifetime corrections. Reference sources remain unchanged. The payload includes the SDK license texts and a source/patch/compiler/binary hash receipt. Development @@ -45,8 +59,8 @@ was used only for development; its exact archive/DLL fingerprints are in the research record and it is not part of the runtime payload. The Vulkan FG SDK build additionally includes the reviewed descriptor-pool count and presenter CPU completion corrections, each recorded in its hash receipt. -The pinned Streamline source (`2122257e0fce486f91b385aa63b9a09b0a34b363`) -is prepared separately from its retail SDK archive. Its corrected Production +The pinned Streamline source (`2122257e0fce486f91b385aa63b9a09b0a34b363`, the `vendor/streamline` submodule) +is built separately from its retail SDK archive. Its corrected Production common/interposer build stays ignored and is staged in a separate `streamline-vulkan` directory for Godot PCL/Reflex. The build receipt also covers the low-latency extension dependency and private-data feature corrections. CMake @@ -92,28 +106,71 @@ original-file baselines. The older verified-deployment input remains an optional The native build needs the Windows/C++ toolchain. Rust dependencies are pinned in `Cargo.toml` and `Cargo.lock`. MinGW-w64 and Wine support the optional Linux cross-build. -Vendor SDKs, reference checkouts, Epic source, and game binaries are kept outside version control. [The source map](research/source-map.md) records inspected revisions; Epic links require authorized access. +The Windows Rust runtime uses [ash](https://crates.io/crates/ash) 0.38.0+1.3.281 +(MIT OR Apache-2.0) for typed Vulkan descriptors and function signatures. Its +loader and link features are disabled. The graphics host continues to lend +the Vulkan procedure resolvers. + +Reference checkouts, Epic source, game binaries and vendor runtime binaries are kept outside version control; the vendor SDK sources are pinned submodules. [The source map](research/source-map.md) records inspected revisions; Epic links require authorized access. ## Optional local SDKs The RTX 40 MFG path incorporates selected MIT-licensed MFG-Unlocker sources at -`2b52823e3769c31cf52d3b368c6963cff8fc5344`, with its notice in +`2b52823e3769c31cf52d3b368c6963cff8fc5344`, adapted in Rust in the orchestrator's +`mfg_*.rs` modules, with its notice in `runtime/backends/dlss/third_party/mfg_unlocker/LICENSE`. It derives the guarded temporal program from the installed NVIDIA runtime in memory. No external GPU cache, Intel-derived shader data or MFGUnlocker DLL is included. Distributions using this path must retain the MIT notice alongside the existing vendor runtime terms. [Integration](research/rtx40-mfg-unlock.md). +## Vendor SDKs + +[eng/dependencies.json](../eng/dependencies.json) is the one source of the vendor pins: each SDK's +repository and revision, the Streamline release zip and its SHA-512, and the SHA-256 of every signed +DLL a package carries. The CMake receipt check, the eng scripts, `eng/fetch-vendor.ps1` and the +`tools/package-*.py` packagers (through `tools/package_common.py`) all read it. + +The SDK sources are shallow git submodules under `vendor/`, pinned to exactly those revisions. A +submodule records only a URL and a commit; nothing of the vendor's is copied into this repository, +so their licences do not restrict referencing them. A fresh clone gets everything with: + +```powershell +git submodule update --init --depth 1 +./eng/fetch-vendor.ps1 +``` + +| Submodule | Revision | Checkout | Licence | Used for | +| --- | --- | --- | --- | --- | +| `vendor/streamline` ([NVIDIA-RTX/Streamline](https://github.com/NVIDIA-RTX/Streamline)) | `2122257e0fce486f91b385aa63b9a09b0a34b363` (2.14.1) | 100 MB | MIT for the source and headers; the closed NVIDIA runtimes are not in it | `include/` compiles the DLSS/DLSS-G/Reflex/PCL adapters; `source/` feeds the corrected Vulkan Streamline build and the selected-device patch tests | +| `vendor/fidelityfx` ([FidelityFX-SDK](https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK)) | `7539ae8b6568ad29ed78a753404351daf3b5cca7` (SDK 2.4.0; FSR 2.3.4, 3.1.6, hardware-dependent 4.1.2 and FG 4.0.2) | 322 MB | MIT for the source; `Kits/FidelityFX/docs/license.md` (binary-only redistribution, no reverse engineering) for the signed DLLs | `Kits/FidelityFX/api/include`, `upscalers/include` and `framegeneration/include` compile the DX12 FSR SR/FG adapters; `signedbin/` holds the shipped `amd_fidelityfx_{loader,upscaler,framegeneration}_dx12.dll` | +| `vendor/fidelityfx-vulkan` (same repository) | `c6efa6bf7f2027b3ec94f28578bb5965eabb9e55` (SDK 1.1.4) | 427 MB | MIT | The native Vulkan FSR2/FSR3 runtime is built from this source with the corrections in `runtime/vulkan/fsr3/sdk-fixes` (their `sdkCommit` is this revision); `ffx-api/include` is `RSF_FFX_VK_INCLUDE` | +| `vendor/xess` ([intel/xess](https://github.com/intel/xess)) | `8fe81bdbbaf00b3c1b733fd0d830c333dc84e6f0` (3.0.2) | 104 MB | Intel Simplified Software License: redistribution of the binaries unmodified, with the notice | `inc/` (`xess/`, `xess_fg/`, `xell/`) compiles the XeSS SR/FG/XeLL adapters; `bin/` holds `libxess.dll`, `libxess_dx11.dll`, `libxess_fg.dll`, `libxell.dll` | +| `vendor/minhook` ([TsudaKageyu/minhook](https://github.com/TsudaKageyu/minhook)) | `c3fcafdc10146beb5919319d0683e44e3c30d537` (v1.3.4) | under 1 MB | BSD-2-Clause | The detour library. `rsf-minhook-sys` compiles it for Cargo builds and CMake builds its `minhook` target from it (`FETCHCONTENT_SOURCE_DIR_MINHOOK`), so neither needs CMake's fetch or the network. `third_party/minhook/minhook.lock.json` pins the same revision and the file hashes the fallback fetch checks when the submodule is absent | + +FidelityFX needs two revisions because the two paths use different products of it: the DX12 path ships +AMD's signed 2.4.0 DLLs, which the FSR4 compatibility hook recognises by their bytes, while the Vulkan +path builds the 1.1.4 source with tracked corrections that apply to that source only. SDK 2.3.0 +`60f4ea81` is still accepted by the FSR4 compatibility hook at runtime but is no longer a build input; +the earlier lock entry naming it was stale against the 2.4.0 DLLs the packagers pin. + +The signed Streamline runtime (`sl.*.dll`, `nvngx_dlss*.dll`) and its licences are only in the +[2.14.1 release zip](https://github.com/NVIDIA-RTX/Streamline/releases/tag/v2.14.1), not in the +repository. `eng/fetch-vendor.ps1` checks each submodule's revision and the pinned FidelityFX and +XeSS DLL hashes, downloads the zip, requires its SHA-512, unpacks only the eight pinned retail DLLs of +`bin/x64` and the licence files into `vendor/streamline-sdk` (67 MB; the 263 MB zip is deleted afterwards), +and checks each DLL against its pinned SHA-256. A run that finds them in place downloads nothing. That directory is the default `--streamline-root` of the +packagers and the default Streamline root of the deploy and staging scripts. The script then links the +package layout (`streamline/`, `fidelityfx/`, `xess/`) into `vendor/runtimes`, the default +`RSF_ANOMALY_SR_VENDOR_ROOT` for the Anomaly SR and backend-switch device fixtures. +Both directories are ignored. + | Dependency | Inspected version | Local path | Purpose | | --- | --- | --- | --- | -| RenderDoc header and x64 DLL | 1.45 | `vendor/renderdoc/` | In-application capture | -| Streamline headers | 2.14.1 | `vendor/streamline/include/sl.h` | Compile the DLSS adapter | -| Streamline/NGX x64 runtime | 2.14.1 release package | `vendor/streamline/bin/x64/` | Load and evaluate DLSS; `sl.dlss_g.dll`, `nvngx_dlssg.dll`, `sl.pcl.dll` and `sl.reflex.dll` are in the same package and are loaded by current-source FG/Reflex | -| FidelityFX SDK headers | `7539ae8b6568ad29ed78a753404351daf3b5cca7` (SDK 2.4.0; FSR 2.3.4, 3.1.6, hardware-dependent 4.1.2 and FG 4.0.2). SDK 2.3.0 `60f4ea81` remains accepted by the FSR4 compatibility hook | `vendor/fidelityfx/Kits/FidelityFX/api/include/` and `upscalers/include/` | Compile the FSR adapter | -| FidelityFX x64 runtime | same | `vendor/fidelityfx/Kits/FidelityFX/signedbin/` | `amd_fidelityfx_loader_dx12.dll`, `amd_fidelityfx_upscaler_dx12.dll`, `amd_fidelityfx_framegeneration_dx12.dll` | -| XeSS SDK headers | 3.0.2, `8fe81bdbbaf00b3c1b733fd0d830c333dc84e6f0` | `vendor/xess/inc/` (`xess/`, `xess_fg/`, `xell/`) | Compile the XeSS adapter | -| XeSS x64 runtime | same | `vendor/xess/bin/` | `libxess.dll`, `libxess_dx11.dll`, `libxess_fg.dll`, `libxell.dll` | +| RenderDoc header and x64 DLL | 1.45 | `vendor/renderdoc/` (hand-placed) | In-application capture | +| Unity native-plugin headers | NativeRenderingPlugin `522254181faf...` | `vendor/unity-native/include/` (hand-placed) | Unity adapter | +| Streamline/NGX x64 runtime | 2.14.1 release package | `vendor/streamline-sdk/bin/x64/` (fetched) | Load and evaluate DLSS; `sl.dlss_g.dll`, `nvngx_dlssg.dll`, `sl.pcl.dll` and `sl.reflex.dll` are in the same package and are loaded by current-source FG/Reflex | -Without the headers, the checkout still builds; the relevant API reports that the feature is unavailable. `RSF_RENDERDOC_DLL`, `RSF_STREAMLINE_BIN`, `RSF_FFX_BIN`, per-family `RSF_FSR2_BIN` / `RSF_FSR3_BIN` / `RSF_FSR4_BIN`, and `RSF_XESS_BIN` select runtime locations. See [loader setup](../loader/README.md). The new SR adapters use the SDK checkout layouts above. A single current AMD package can provide all three FSR algorithms; separate runtime directories and explicit version overrides also permit side-by-side SDK releases. See [the switching evidence](research/orchestrator-sr-switching.md). Vendor checkouts remain untracked. +Without the headers, the checkout still builds; the relevant API reports that the feature is unavailable. `RSF_RENDERDOC_DLL`, `RSF_STREAMLINE_BIN`, `RSF_FFX_BIN`, per-family `RSF_FSR2_BIN` / `RSF_FSR3_BIN` / `RSF_FSR4_BIN`, and `RSF_XESS_BIN` select runtime locations. See [loader setup](../loader/README.md). The new SR adapters use the SDK checkout layouts above. A single current AMD package can provide all three FSR algorithms; separate runtime directories and explicit version overrides also permit side-by-side SDK releases. See [the switching evidence](research/orchestrator-sr-switching.md). RenderDoc and Streamline source/header licenses are separate from the licenses covering NVIDIA runtime binaries such as `nvngx_dlss.dll` and `nvngx_dlssg.dll`. The FidelityFX signed DX12 DLLs carry the SDK release's bundled binary redistribution terms; ship `Kits/FidelityFX/docs/license.md` and `3rdpartynotice.md` beside them. The earlier statement grouping these signed binaries under MIT was incorrect for the inspected SDK 2.3 package. The XeSS headers and samples carry Intel's SDK licence and the `libxess*.dll` / `libxell.dll` binaries have separate Intel redistribution terms; confirm both against the shipped text before any redistribution. Check the exact release's included terms and notices in every case. The AC7 release includes the retail Streamline interposer/common/DLSS/PCL DLLs and NVIDIA DLSS 310.9.1.0, unmodified, with the SDK licenses and notices. The corrected AC7 package also includes FidelityFX SDK 2.3.0 upscaling (FSR 2/3/4) and XeSS SR 2.0.2 with their terms and notices. Frame generation and Reflex are not included in that published SR package. Current-source deployments use separate FG DLLs and shared latency services. Vendor binaries stay untracked in Git. @@ -132,14 +189,17 @@ hashes. Missing FidelityFX/XeSS runtime directories cause LOAD_FAILED refusals e proxy was built with their headers. [Diagnosis and deployment evidence](research/sr-runtime-deployment.md). Build and verify the Release configuration, build the Rust overlay with `cargo build --release ---locked -p rescaleframe-overlay`, and commit the release source. Use the official -[Streamline 2.14.1 SDK](https://github.com/NVIDIA-RTX/Streamline/releases/tag/v2.14.1), with the -unmodified retail DLLs from `bin/x64` and its accompanying license files. +--locked -p rescaleframe-overlay`, and commit the release source. Run `eng/fetch-vendor.ps1` for the +official [Streamline 2.14.1 SDK](https://github.com/NVIDIA-RTX/Streamline/releases/tag/v2.14.1) +runtime: the unmodified retail DLLs from `bin/x64` and its accompanying license files. ``` -python tools/package-ac7.py --streamline-root .local/streamline/sdk --fidelityfx-root vendor/fidelityfx --xess-root vendor/xess +py -3 tools/package-ac7.py ``` +The Streamline, FidelityFX and XeSS roots default to `vendor/streamline-sdk`, `vendor/fidelityfx` and +`vendor/xess`; `--streamline-root`, `--fidelityfx-root` and `--xess-root` override them. + The packager writes the Windows archive, corresponding-source archive and SHA256SUMS.txt under `build/releases`. It refuses a dirty source tree, includes a source-commit/file-hash manifest, collects dependency notices from pinned Cargo packages (using their exact recorded upstream @@ -172,11 +232,8 @@ and [current status](current-status.md). ## Runtime shader patching -yyjson is MIT licensed at ebb8d7e5aaa51bea4edefb39ee73a235066b0023. The source, -header and licence are pinned by runtime/shader_patch/yyjson.lock.json and staged -under ignored vendor/shader-patch/yyjson. CMake downloads only missing pinned files -and refuses changed bytes. The Anomaly packager includes its original MIT licence -and runtime/shader_patch/THIRD_PARTY.md. No game shader bodies are included. +Shader-pack JSON is read with serde_json (MIT or Apache-2.0), pinned in Cargo.lock. The Anomaly +packager includes runtime/shader_patch/THIRD_PARTY.md. No game shader bodies are included. 3Dmigoto 8f329bd94fecc9bbcb9211ffd42a95dd7fe6b43e (GPLv3) and Zstandard f8745da6ff1ad1e7bab384bd1f9d742439278e99 (BSD option) were downloaded for evaluation @@ -187,16 +244,18 @@ not added. See docs/research/runtime-shader-patching.md for approved later scope ## AMD Anti-Lag 2 -The optional Direct3D driver SDK is under ignored `vendor/antilag2`, from +The Direct3D Anti-Lag 2 calls follow the MIT-licensed inline DX11 and DX12 headers of [GPUOpen AntiLag2-SDK](https://github.com/GPUOpen-LibrariesAndSDKs/AntiLag2-SDK) revision -`390aa4a8c8655d0ae6e90079db2c85e103a96da3` (MIT). Only its DX11 and DX12 inline headers are used; no sample code or -runtime DLL is shipped. `RSF_ANTILAG2_INCLUDE` selects the SDK directory. Without both headers the core compiles an -unavailable driver endpoint, while its stub contract remains testable. The Runtime owns initialization, the pre-input -Update, device/vendor gating, status and FSR DX12 frame typing. AMD hardware and supported Adrenalin drivers are required; -the NVIDIA/Intel development machine cannot establish AMD acceptance. The original licence is preserved in vendor and -`runtime/orchestrator/ANTILAG2-LICENSE.txt`, included by the game packagers. - -Pinned header SHA-256: +`390aa4a8c8655d0ae6e90079db2c85e103a96da3`. The Runtime no longer compiles against those headers. They are inline C++ +over driver COM interfaces with no C ABI, so `runtime/orchestrator/src/latency_antilag_sdk.rs` makes the same driver +calls through the interface tables: the same `amdxc64.dll` and `amdxx64.dll` entry points, interface identifier, +structure layouts and call sequence. The `vendor/antilag2` checkout is a comparison reference only and nothing builds +from it; no sample code or runtime DLL is shipped. The Runtime owns initialization, the pre-input Update, device/vendor +gating, status and FSR DX12 frame typing. AMD hardware and supported Adrenalin drivers are required; the NVIDIA/Intel +development machine cannot establish AMD acceptance. The original licence is preserved in vendor and +`runtime/orchestrator/ANTILAG2-LICENSE.txt`, included by the game packagers, and covers the derived Rust module. + +Reference header SHA-256 (compared when the Rust module was written): - `ffx_antilag2_dx11.h`: `72659da3673d0d04ebcc7c3c4d5442bf4189c3cc99b5d2eb06ba832e5c288d31` - `ffx_antilag2_dx12.h`: `bf4e292c040103c7d2dd25d8c86c4ecd3a35338d539428a8db6535da4f82d52f` diff --git a/docs/design.md b/docs/design.md index 273301f80..91921230f 100644 --- a/docs/design.md +++ b/docs/design.md @@ -10,11 +10,10 @@ recorded acceptance from plans and the published SR-only AC7 package. | Component | Owns | | --- | --- | | Launcher or WSGM, planned | Game selection, profile storage, early loading, session lifetime | -| Bootstrap, currently version-only | Intended general runtime-loading entry point | | Current carriers | AC7 DirectInput entry and Unity version shim; runtime/plugin loading | | Orchestrator | Plugin lifecycle, vendor SDKs, resources, settings, latency and presentation | | Game plugin | Build recognition, engine hooks, frame data and SR reinsertion | -| Game SDK | Versioned C contract, currently game ABI 13, with leased native resources | +| Game SDK | Versioned C contract (`sdk/game/include/rescaleframe/game_api.h` holds the current ABI version), with leased native resources | | egui | Settings intents, effective status and FPS display; inspection/capture expansion planned | First-party components share a repository and release version. C interfaces keep ownership explicit. @@ -39,6 +38,19 @@ native family colour before Slate as an optional guide, retaining unclassified-U Unity's SDR pre-UI hook captures completed colour after post-processing; HDR refuses that guide path. Neither route establishes every provider's moving-scene/HUD quality. +## Retained native code + +The Rust crates own the runtime; native C remains only where Rust cannot express the work: MinHook +calls, COM calls on vendor objects, and guards for foreign C++ exceptions. MSVC raises a C++ throw +as SEH code `0xE06D7363`, so each C11 guard is a `__try` whose filter accepts only that code, the +filter `runtime/orchestrator/src/plugin_callbacks.c` uses for what a `catch (...)` stopped under +`/EHsc`. Access violations and other faults still propagate to the caller. A Rust panic is also +raised as `0xE06D7363` on MSVC, so panics stay contained. Scopes that C++ destructors closed on +unwind use `__try/__finally`. One guard deliberately keeps `EXCEPTION_EXECUTE_HANDLER`: the Wingman +`acquire_texture` engine/COM probe, which treats any fault as "no texture". Moving the Wingman report +and the D3D11 observer COM calls into Rust was considered and rejected: they are single vendor-vtable +calls whose only purpose is to sit inside the exception frame. + ## Backends and frontends AC7 keeps a D3D11-facing facade and uses same-adapter D3D12 services for D3D12-only SR/FG paths. diff --git a/docs/diagnostics.md b/docs/diagnostics.md index 569f08218..eee79781f 100644 --- a/docs/diagnostics.md +++ b/docs/diagnostics.md @@ -42,6 +42,11 @@ camera data, and checks final-image/Present evidence separately. It never labels image quality accepted. Real retained temporal and spatial bundles were checked; GPU automation-content validation is still pending. +An integration that knows the projection but not the camera matrices records it with +`rsf_input_dump_projection` (input dump ABI 2) as `projection.json`: near and far planes, +vertical field of view, aspect ratio, and depth inversion and an infinite far plane when known. +It does not make `camera_available` true; the analyzer's camera requirement is unchanged. + ## Programmatic harness `tools/runtime-action.py` is the maintained bounded runtime helper. Callers supply diff --git a/docs/documentation-audit.md b/docs/documentation-audit.md deleted file mode 100644 index 7cc95f46a..000000000 --- a/docs/documentation-audit.md +++ /dev/null @@ -1,68 +0,0 @@ -# Documentation audit, 7 October 2026 - -## Question, method and scope - -Do the repository's user/developer guides accurately describe ReScaleFrame and its plugins? -Checked the current source at `fda5fd0f2730b40e5b96f419bc0a05cb0b73932b`, recorded research, -build/deployment/packaging scripts and the GitHub release listing. Source and dated acceptance -records were used because a component version, successful build or detection hash alone cannot -establish a shipped feature or working game path. The audit is documentation/source review, -not a fresh reverse-engineering experiment, Windows build or game/device test. - -[Current implementation and validation](current-status.md) is the maintained feature/acceptance -summary. Historical research retains its original results, addresses, source revisions and hashes. -No historical device or game acceptance was invented or extended to new hardware. - -## Corrections and evidence - -| Area | Correction | Evidence checked | -| --- | --- | --- | -| SDK and lifecycle | Replace metadata-only/planned ABI 2 claims with game ABI 13, renderer/CPU callbacks and leased resources; retain readiness zero | `game_api.h`, `game_renderer.h`, `game_frame.h`, three plugin implementations and `plugin_session.cpp` | -| AC7 source versus release | Published v0.1.0 is SR-only; current source includes FG/latency and live provider replacement; preserve new AC7 vendor FG gaps | GitHub release metadata; SR/FG runtime, AC7/shared FG research and release notes | -| Unity/Drag'n Wash | Remove unimplemented Mono/Harmony/SR/FG claims; explain pre-DoF SR, pre-UI guide, Off/FSR1 inputs, final user acceptance and remaining Claw/MFG coverage | Managed/native plugin, `unity_sr_host.cpp`, Unity SR/shared FG notes and scripts | -| Project Wingman | Keep detection/ABI scaffold distinct from unsupported rendering/VR | Plugin source, contract fixture and engine evidence | -| Overlay | Replace F5/ABI 3 with Insert/ABI 9; document separate SR/FG intents, queried counts and measured FPS counter scope | Overlay header/Rust panel, native host and Unity host | -| Ownership and design | Replace proposed UI diversion as the default with native AC7 UI owners; distinguish carriers/runtime from version-only bootstrap and launcher | Native renderer, loader CMake/shim, orchestrator CMake and launcher source | -| Dependencies and packaging | Clarify helper netstandard2.1 versus Harmony net472, FG payloads, local Unity ZIP defaults and AC7 packager/deployer carrier mismatch | Managed csproj, build/deployment scripts, both packagers and notices | -| Research and plans | Scope dated pending/failed claims; point to later corrections and current headers; reconcile implemented Unity tracker steps | Research/tracker chronology, current native/managed source and repository skills | - -The checked release listing has one published release, v0.1.0, with the AC7 Windows ZIP, -corresponding-source ZIP and SHA256SUMS. Its replacement assets were uploaded on 2 October 2026. -Its SR-only release description remains accurate. No Unity/Project Wingman release or GitHub Pages -site was listed. The enabled wiki flag does not establish a wiki: its Git endpoint returned -Repository not found, so no wiki contents were audited. - -## Inventory - -The audit covers repository Markdown, game evidence summaries, the INI sample's documentation -and the Unity packager's generated README. `CLAUDE.md` remains a symlink to `AGENTS.md`. - -| Documentation set | Treatment | -| --- | --- | -| Root README, AGENTS and game READMEs | Current user/build/ownership claims reconciled with source and acceptance | -| SDK, runtime, graphics, overlay and loader guides | Current contracts/routes/controls corrected; compatibility mechanisms clearly scoped | -| Design, dependencies, tooling and tracker | Current architecture and script behavior reconciled; dated test runs preserved | -| Release guides/notes | Explicitly scoped to the published corrected SR ZIP; FG availability is described separately | -| Research records and plans | Dated experiment/design scope explicit; later acceptance/current status linked; original evidence retained | -| Methodology, source map, validation targets, WSGM and tool guides | Reviewed for scope/link consistency; references and planned targets retained | -| Local repository skills/references | Stale FG status corrected or scoped to recorded SR lessons; technical patch anchors preserved | -| Game `engine.json` files | Separate current validation summaries added; AC7 fingerprint linked to recorded executable evidence; Unity live API/status clarified | -| Historical evidence JSON | Parsed for validity; original snapshots preserved | -| Generated Unity package README and AC7 INI sample | Prose/comments corrected without changing script behavior or configuration defaults | - -## Checks and remaining boundaries - -Focused checks cover local Markdown targets/anchors, JSON validity, all three executable fingerprints -against plugin source, current documented ABI versions, and `VERSION`/Cargo agreement. The Unity -packager diff is restricted to its README here-string, and active INI assignments are unchanged. -Whitespace validation uses `git diff --check`. - -Result: 79 Markdown files and 504 local targets/anchors checked without failures; all 19 tracked -JSON files parse. Fingerprints, ABI/version checks, unchanged packaging behavior, unchanged active -INI defaults, documentation-only scope and the agent-instruction symlink checks pass. - -The workspace does not have PowerShell for a parser/native gate. No native, SDK or Rust behavior -changed, so no new native/game/device result is claimed. Existing MSVC, GPU, Rust and shipped-Mono -results remain attributed to their dated notes. Licensed game/engine source, captures and private -Ghidra hook addresses were not independently reproduced by this audit. Open lighting, motion, -new-provider acceptance, higher MFG, Claw and measured latency questions remain explicit. diff --git a/docs/implementation.md b/docs/implementation.md index 263fb0902..ea2c9cbea 100644 --- a/docs/implementation.md +++ b/docs/implementation.md @@ -1,5 +1,383 @@ # Implementation tracker +Steam recorded native access violations in the 29 November Skyrim and Fallout 4 sessions. The shared D3D11 shader snapshot now owns only counted class instances. SR can acquire its own graphics token after a pacing refusal. Both adapters trace native cleanup, and the shared runtime records native fault PCs and stacks. COM, token, rollback and exception-dispatch fixtures passed. Gameplay acceptance is pending. [Fault and refusal investigation](research/bethesda-first-world-av-20261129.md) + +The [November 29 Drag'n Wash investigation](research/drag-n-wash-20261129-run.md) reproduced non-finite skin motion, an asynchronous SR plan handoff and the player’s fatal Present HRESULT. Device tests covered skin motion and 15 temporal SR configurations. Fakes covered overlapping D3D12 mode changes with four FG providers. The [Streamline checklist results](research/drag-n-wash-streamline-checklists-20261129.md) distinguish those checks from player acceptance, which remains open. + +The [29 November DLSS-G experiment](research/dlssg-31091-phase-20261129.md) found thin-edge residue with correct guides on RTX 40. All 24 generated 3× images matched the provider's multi-frame kernel control. The offscreen fixture reproduced the result without launching a game. +Fallout 4 now releases its World borrow across the SR host calls. A Windows callback fixture covers synchronous re-entry and successful publication. The historical inner detour has no recorded stack. [Native investigation](research/rust-fallout4-render-hooks.md#29-november-2026-releasing-the-world-across-sr-callbacks) + +Skyrim SE and Fallout 4 preserve engine AA for FSR1 and publish resolved colour at the final scale draw. Installed executable checks, Windows synthetic tests and shader compilation passed. Moving-image acceptance is pending. [Native AA and spatial scaling](research/bethesda-native-aa-spatial-20261129.md) +Vendor SR switches on D3D11, D3D12 and Vulkan now stage DLSS graphics resources through the same worker as FSR and XeSS. Private D3D registrations initialize on the worker. The shared Streamline host retains its source-frame tokens and serializes feature calls. The workspace tests passed on Windows (1,054 passed, three ignored). The [Streamline threading audit](research/streamline-sr-preparation.md) records the SDK requirements and remaining first-evaluation cost. + +The [headless device check](tooling.md#headless-streamline-device-verification) passed all five runs on the RTX 4070 Laptop. The cold D3D11 select returned in 0.1 ms and the first live DLSS frame took 93.2 ms. The private D3D12 feature preallocation completed on the worker. Hidden-window DLSS-G accepted 16 tagged frames and reported inactive. + +Use `eng/deploy-game.ps1 -Game Anomaly -GameDirectory 'D:\Anomaly 1.5.3\bin' -WhatIf` to inspect a deployment. +SkyrimSE, Fallout4 and RDR2 take their game root. The dry runs resolved and hashed 28 files for Anomaly and 27 for each other game, including the canonical vendor payload. Anomaly used the thin carrier and its authored motion pack. Removing `-WhatIf` backs up replaced files under `.local/deploy-backups` and verifies each installed hash. Only the dry runs were tested. + +The [28 November Drag'n Wash investigation](research/drag-n-wash-temporal-20261128.md) records the installed motion producer, corrected SR/FG row orientation, and the output-sized depth binding for URP DoF. Headless GPU checks passed with the installed shaders. Player visual acceptance is pending. + +This page tracks what is built, synthetic-tested, game-tested and device-tested. Dated entries below +record each result with its failures and later corrections; a pending statement in an earlier entry +applies to that entry. [Current status](current-status.md) is the maintained summary of claims, and +the Rust port of the former C++ is recorded by the Git history and [the migration note](rust-migration.md), +not here. + +| Integration | Built | Synthetic-tested | Game-tested | Device-tested | Dated entries | +| --- | --- | --- | --- | --- | --- | +| AC7 (D3D11) | Native renderer hooks, pre-tonemap SR, DLSS, FSR2/3/4, XeSS, D3D12 FG facade | Velocity, render scope and native graph fixtures | User accepted corrected SR, UI and cloud rendering and DLSS-G; FSR3 and XeSS FG have no live acceptance | DLSS, FSR and XeSS on RTX 4070 Laptop and Intel UHD | [First working target](#first-working-target), [AC7 shared frame generation](#ac7-shared-frame-generation-5-october-2026), [AC7 motion and velocity](#ac7-motion-and-velocity-improvements) | +| Drag'n Wash and Unity Mono (D3D12) | Shared shim, Mono hooks, pre-DoF SR, overlay, FG switching | Package and layout fixtures | Live SR and improved post-processing order recorded; user accepted XeSS and DLSS-G and the final FSR correction | Not recorded for MSI Claw | [Unity UI regression](#unity-ui-regression-touch-and-fg-startup-10-october-2026), [Drag'n Wash character motion](#dragn-wash-character-motion-20-october-2026) | +| Project Wingman | XInput carrier and guarded native temporal graph observer | Camera and observer contracts | User-run mission verifies readable inputs, history and rectangles | None; SR, FG and latency unimplemented | [Wingman native observation](#wingman-native-observation-11-october-2026) | +| Red Dead Redemption 2 | Common-SR adapter, scene and pacing markers, shared FG presentation, forced-DX12 ASI | Camera and capture fixtures | Four SR providers and DLSS and XeSS FG intervals accepted; shared overlay and runtime presets confirmed | Non-NVIDIA hardware unproven | [RDR2 scaffold](#red-dead-redemption-2-scaffold-25-october-2026), [FSR2 input route](#rdr2-on-intel-fsr2-input-route-orchestrator-auto-sr-and-fidelityfx-240-30-october-2026) | +| Fallout 4 AE | Native render callbacks without F4SE or ENB | Camera and host ABI fixtures | DLSS SR and FG accepted in the tested moving scene; XeSS FG interval correction accepted | NVIDIA only | [Fallout 4 AE native render callbacks](#fallout-4-ae-native-render-callbacks-16-november-2026) | +| Skyrim SE | Experimental no-SKSE pre-HDR path | Camera and host ABI fixtures | Bounded vanilla runs evaluated DLSS at native resolution; reduced-resolution SR and FG incomplete | Vendor telemetry only, no physical scanout or latency | [Skyrim SE reduced-resolution SR](#skyrim-se-experimental-reduced-resolution-sr-15-november-2026) | +| Anomaly | SR stages 1 to 5, foliage motion, shader patching | DLSS, FSR3, FSR4 and XeSS 24/24 frames on RTX 4070 | Stage 2 motion run recorded; later stages not game-tested; signature discovery not yet game-run | RTX 4070 | [Anomaly SR Stages 3-5](#anomaly-sr-stages-3-5-and-foliage-motion-12-november-2026), [Anomaly signature discovery](#anomaly-signature-discovery-24-november-2026) | +| Godot | Standard and .NET engines, Vulkan SR and FG provider fixtures | Controller and export fixtures | Not a shipped game path | Generated-image comparisons against independent midpoints; some FSR2/FSR3 object-motion cases fail | [Godot developer integration](#godot-developer-integration-in-progress-25-october-2026) | +| Minecraft (OpenGL) | Java mod with SR and FG and motion producers | Java and offscreen OpenGL checks | World geometry confirmed in the 1.1.8-dev correction; shader-pack acceptance open | None recorded | [Minecraft OpenGL SR and FG](#minecraft-opengl-sr-and-fg-17-october-2026) | + +## SR backends prepared off the render thread, D3D11 pipeline ABI 6, 28 November 2026 + +Built and unit-tested (orchestrator and Anomaly), not game-run. The D3D12 and Vulkan hosts are not +changed yet (see the end of this entry). + +- The defect, from the user's AC7 run (`rsf-dump.log`, 28 November 2026 21:35): selecting FSR4 from + the panel ran `select_alternate` on the render thread; "SR backend 4 context created in 173 ms", + "SR warm-up dispatch done in 33286 ms", "backend 4 prepared in 33471 ms", "selected backend 4", + one evaluated frame, then the process exited. UE 4.18 exits when the game thread waits on the + render fence for more than 30 s (`g.TimeoutForBlockOnRenderFence`, 30000 ms). The switch itself + succeeded; the 33 s first-use pipeline build is what no render thread may pay. +- `sr_prepare.rs` is the core mechanism: a preparation runs on a worker thread, queues its log lines + (vendor lines included) for the frame thread, and hands a finished result to whoever takes it; a + preparation dropped before it finishes is abandoned and its worker releases what it built. +- `dlss_pipeline.rs`: FSR2/3/4 and XeSS selections return `RSF_DLSS_PIPELINE_PENDING` (1) at once. + The worker builds a new legacy adapter (bridge, D3D12 session, vendor context), selects the backend + and runs the warm-up dispatch that builds the pipelines. That adapter becomes the active one at + commit, so the pipelines are built once. The worker never reaches the D3D11 immediate context: a + fresh bridge has issued no D3D11 signal for its select to flush, and the warm-up records on the + bridge's own D3D12 queue. A device created `D3D11_CREATE_DEVICE_SINGLETHREADED` prepares on the + render thread as before. The commit runs after `on_frame` (or inside a later select): the replaced + adapter is destroyed there, history restarts and the status reports the new backend and render + range, which the callers plan from. A refusal keeps the active backend and is remembered for that + backend, output and quality so a caller asking every frame does not start a worker every frame. + The latest selection wins; a quality change or resize restarts the preparation; stop abandons it. + DLSS and FSR1 still switch in the call. A start on a prepared backend starts on FSR1 and prepares + it the same way. +- Callers: the D3D11 host (AC7 and every D3D11 game) records a pending backend as accepted and plans + the status's active backend and size; Anomaly asks again at each boundary while pending and no + longer announces a pause before a blocking select. +- `rescaleframe/dlss_pipeline.h` ABI 6: the pending result and its status contract. +- Tests: `sr_prepare` (3), `dlss_pipeline` `a_switch_is_prepared_on_a_worker_while_the_active_backend_serves_every_frame`, + `the_latest_selection_wins_and_every_superseded_adapter_is_released_once`, + `a_resize_or_quality_change_restarts_the_preparation_and_stop_abandons_it`, + `a_prepared_backend_starts_on_fsr1_until_it_commits`, `a_single_threaded_device_prepares_in_the_call`, + `d3d11_host` `a_pending_backend_plans_the_active_one_until_the_pipeline_commits`, the Anomaly + runtime fixture's `pending` case; `tests/sr_backend_switch_device.rs` now drives frames through + each preparation and fails on a select or frame slower than 250 ms (not run here). +- Resize and quality change of an active FSR/XeSS backend (pipeline ABI 7, same day): both used to + recreate the vendor context in the call, and the first evaluate rebuilt the pipelines on the + render thread. They now go through the same preparation: `set_quality` and `resize_output` return + PENDING, the active context keeps serving (for a quality change) or the status keeps the old + output so callers keep SR out of their frames (for a resize, whose old context cannot serve the + new size), and the commit brings the new output texture with the new adapter. One path, `pursue`, + serves select, quality, resize and start; going back to what serves abandons the preparation. + The D3D11 host and Anomaly accept a pending quality change. Tests: + `a_resize_of_a_prepared_backend_is_prepared_and_brings_its_output_at_commit`, the quality steps + in `a_switch_is_prepared_on_a_worker_while_the_active_backend_serves_every_frame` and + `alternate_quality_change_restarts_after_failure_limit`, the Anomaly `pending` case. +- Not changed: the D3D12 render host and the Vulkan host build the same way on the recording thread + (`render_host/callback.rs` `create_view` -> `sr12_create`, first `sr12_evaluate`; + `render_host.rs` `sr12_create`; `vulkan_host.rs` `Sr::open` -> `linked::open`, first evaluate). They + need the same preparation (the vendor session created and warmed on a worker, adopted at a drained + pass), which also needs a warm-up path for sessions on the game's own D3D12 device. +## FSR1 without camera jitter, 28 November 2026 + +Built and unit-tested, not game-run or device-tested. + +User report: "FSR1 is not working in any of the games. Just displays a jittered scene." FSR1 +(`RSF_SR_SPATIAL`) has no history, so a jittered camera only shakes its image. + +- One fact: `rsf_game_sys::sampling::backend_jitters` names the backends that resolve jitter, and + `rsf_game_render_config::jitters()` is the integration's view of it (an enabled plan with more + than one phase). FSR1 plans one phase, as before; the header now states that the camera then stays + unjittered and the engine keeps its own anti-aliasing. +- Core passes: both FSR1 EASU passes (sr12 on D3D12, `spatial_d3d11` on D3D11) took the camera + jitter as a sampling offset; they now sample at the plain output-to-input mapping. The D3D11 + pipeline refused any frame whose camera reported no jitter (`frame_assembly.rs`, `has_jitter`), so + an integration that stopped jittering for FSR1 lost every frame; FSR1 frames are now admitted + unjittered. Both paths log once, "FSR1 input is jittered (x,y px): the integration still jitters + its camera while FSR1 is selected", when an integration keeps jittering. +- AC7: the native views run FXAA (AntiAliasingMethod 1, [renderer roots](research/ac7-renderer-roots-20260930.md)); + the adapter switched them to TemporalAA (mode 2) for the stock temporal preparation, which applies + the engine's Halton jitter ([sample hook](research/ac7-stability-20261001.md)). Under FSR1 it no + longer selects mode 2, logging "native temporal sampling off". The native graph needs a jittered + view and refuses, so the engine's own scaling presents FXAA output; AC7 does not yet run the + Runtime's FSR1 kernel on a non-temporal seam. +- Anomaly stage 5: the adapter's own Halton jitter (`sr_stage.rs` `choose_jitter`) now follows + the backend the Runtime pipeline serves, restarting the sequence on a change either way. +- Unchanged and checked: Unity Mono and the Unity package select URP's own FSR1 with the camera's + original anti-aliasing (`EngineSpatial`); Godot selects its own FSR1 scaling mode; Skyrim SE + already writes zero jitter for one phase. +- Open: Fallout 4 keeps the engine's TAA jitter global (`resolution.rs`, `state + 4`, zeroed only + for the output scope) and excludes native TAA while RSF owns the output (`render_hooks.rs` + `rsf_fallout4_render_gate_taa`); RDR2's jitter comes from the game's own DLSS/FSR2 mode (pixel + jitter setter in `games/rdr2/RESEARCH-HANDOFF.md`). Both need engine-side work verified in a run. + +A run must show, per game: no "FSR1 input is jittered" line with FSR1 selected; AC7 "native +temporal sampling off"; Anomaly "the selected backend takes no jitter (FSR1)" and "Halton jitter +resumes" after switching back. + +### Follow-up from the game binaries, 29 November 2026 + +Built and unit-tested, not game-run. Each finding was read in the installed (or, for RDR2, the +decrypted dumped) executable with targeted capstone disassembly around sites the adapters already +discover; the REA, Ghidra and IDA servers were unavailable, so no database was opened. + +- `rsf_game_render_config::unjittered()`: an enabled plan with one phase, the fact an engine that + jitters by itself acts on (RDR2, Fallout 4). No plan keeps the engine's own sampling. +- AC7: the native graph now admits the unjittered view for a backend that takes no jitter + (`graph.rs` `jitter_admitted`), so the Runtime's FSR1 pass runs at the pre-tonemap seam with the + core sharpening, and FXAA (reviewed AA role between the root and the tonemapper) stays on after + it. Velocity still renders without TAA through the temporal velocity patch at + `ShouldRenderVelocities` 0x118a4e3 (`patches.rs`, [velocity gates](research/ue418-hook-map.md#velocity-gates-mapped-4-october)). + Translucency mesh scopes keep their jitter gate: FSR1 reads no translucency mask. +- RDR2 (1.0.1491.50, `dumps/rdr2-20261025/RDR2.exe.dump`; the on-disk code is encrypted): the + pixel-jitter setter +26f7b1c returns unless byte +0x670 is set, otherwise stores x*-2/round(w) + at +0x664 and 2y/round(h) at +0x668 and rebuilds the projection (+26f63fc). Of its 17 callers only + +31828f and +5fe1ce pass a non-zero pair; +31828f takes it from the generator +5a6a38, which zeroes + its result and then copies the current sample of the active DLSS state (0x45913a0, reader + +7bf05c), else FSR2 (0x4591a60, +7bf0b4), else TAA (0x3f28fe0, +7bf104). The same generator feeds + the upscaler evaluate (+5c7c57, scaled, then +7ac044 with the DLSS state). The carrier must stay + DLSS/FSR2 (it is RSF's only input route), and in that mode the jitter is the carrier's, so a mode + switch cannot remove it. The adapter now hooks the generator (new `camera jitter` site, unique in + both dumps) and writes zero for an unjittered plan, which unjitters projection and carrier + parameters together and keeps the adapter's projection/NGX jitter agreement. Logs "RDR2 camera + jitter off: the selected backend takes no jitter (FSR1)." The game's own TAA is not running in the + carrier mode, so RDR2 has no engine AA to keep under FSR1 (inferred from the generator's source + order, not traced to the TAA pass). +- Fallout 4 (1.11.240.0): the temporal update +182d580 writes the TAA jitter to State+4/+8 + (0x3d871a4) only with State+ac (0x3d8724c, the TAA flag the TAA query +2214fc0 also reads) set and + State+b0 clear, from an 8-phase Halton index; otherwise it stores zero. It is the last call of + WorldBegin +21f0ac0 (at +21f0e4c); the camera cache updates (+21f32a5...) then run builder + +182d750, which adds the jitter to P only with State+ac and the entry's useJitter byte set, and the + TAA effect reads the pair (+2214b73, +2218c4b). The WorldBegin detour now clears State+4/+8 after + the original returns for an unjittered plan; the offset is the verified `temporal size` site's two + stores. Logs "Fallout4 camera jitter off: the selected backend takes no jitter (FSR1)." The site + formerly named "jitter store" (+165ba9f) is the frame-delta bookkeeping, not jitter. +- Skyrim SE: the process function +14edbf0 runs the effect loop (+14ee060), then effect 0x1e/0x22 + (+14edd68), then native TAA +1544da0 (call +14eddbf); TAA returns its input when byte +0x18 is clear. + The adapter reinserts the reconstructed output before that function and sets the ratios to 1 for + its output scope (`resolution.rs` `enter`), so native TAA there would run at output scale over + render-scale motion and history; this is why `postprocess.rs` bypasses it on reconstructed frames, + FSR1 included. Jitter is already zero for one phase. +- Open: Skyrim SE and Fallout 4 keep no engine AA under FSR1 (native TAA runs after the + reconstruction seam and is excluded/bypassed there). Keeping it needs an FSR1 seam after the + engine's image-space processing, with native TAA at render scale; not built. +- D3D12 hosts (same day): both create their FSR/XeSS sr12 contexts on the engine's recording thread + and the first `sr12_evaluate` built the pipelines on the engine's list. `render_host/prepare.rs` + now creates the context on a worker with its own copy of the vendor directories and warms it with + `Sr12::warm_up` (one dispatch through the session on a queue of its own, the same + `sr_bridge::dispatch_warm_up` the D3D11 bridge uses, waiting until the GPU retires it). The RDR2 + host (`render_host.rs`, engine-owned extents) keeps evaluating with its current context while the + new one is built, commits at the first pass whose slots are drained, keeps the current context + after a refusal and does not retry it, and publishes a RECONFIGURE plan at commit. The Unity host + (`render_host/callback.rs`) already turns SR off and drains while a change applies; it now builds + the first view's context on a worker (and later views one at a time), publishes the plan when it + commits, which Unity reads every frame (`ReScaleFrameUpscaler.GetResolutionInfo`), and drops a + context finished for a configuration a change has replaced. Both hosts' log callbacks queue lines + from a worker. DLSS, FSR1 and backend zero are still created in the call. Tests: + `an_fsr_context_is_prepared_on_a_worker_while_the_current_one_serves`, the updated callback tests + (`provider_changes_respect_policy_and_wait_for_the_flagged_pass` covers drop-on-change and + resize), `a_session_warms_up_at_its_own_extents_and_other_vendors_build_nothing`. +- Vulkan host (same day): it retired the old session and opened the new one on the recording + thread (`Sr::pass`, `linked::open`); FidelityFX Vulkan builds its pipelines when its effect is + created (`vulkan_sr.rs` `create_effect`), and the FSR4 split built them at its DX12 bridge's + first dispatch. FSR and XeSS sessions are now opened on a worker (`Sr::stage`, sr_prepare) while + the current session keeps serving its device and output; the new one takes over at the first + pass after it is open, once the current one retires. The FSR4 split warms its bridge as it is + created (`rsf_fsr4_compat::vulkan_bridge::warm_up`: one dispatch on blank images on the bridge's + own queue, waiting on its local fence only). A Vulkan device holds no reference a worker could + keep, so nothing is abandoned: a superseded preparation is closed when its worker finishes, and + stop or a device change waits for every worker. Godot reads the status extent every frame + (`integrations/godot/modules/rescaleframe/host.rs` `current_extent`), so it renders at the + serving session's size until the commit. DLSS stays on this thread. Not unit-tested: the host + opens sessions through `linked::open` with no seam; the FSR4 state fixture + (`rsf_fixture_fsr4sr_state`) needs its CMake harness and fails the same lines under a cargo + harness with or without this change. + +## Frame dump projection without camera matrices, input dump ABI 2, 27 November 2026 + +Built and unit-tested (orchestrator `input_dump::abi` tests), not game-run. + +- A source that knows near, far and the vertical field of view but not its camera matrices (an + upscaler dispatch's parameters, say) could not record them: `frame.json` writes camera fields only + for a complete `rsf_camera_frame`, and filling one with zero matrices would make + `camera_available` lie to the analyzers. +- `rsf_input_dump_projection(record, projection)` (input dump ABI 2) takes `rsf_dump_projection` + (`struct_size`, `abi_version` 1, `near_plane`, `far_plane`, `vertical_fov_radians`, `aspect_ratio`, + `depth_inverted`, `far_infinite`). Each value is optional (zero or non-finite is not known; the two + conventions are known only as 0 or 1). A short structure, another version or a missing record is + refused. It writes `projection.json` into the bundle of the armed record and never makes + `camera_available` true; a complete camera in the record supersedes it. +- The frame record and `rsf_sr_frame` are unchanged: their versions are checked for equality across + every integration, so the projection is an appended entry point of the dumper instead. +- Tests: `the_projection_layout_is_the_headers`, + `a_projection_without_matrices_is_written_and_a_bad_call_is_refused`. + +## Final scene on the engine's own list, 27 November 2026 + +Built and unit-tested (synthetic host fixtures), not game-run or device-tested. No integration uses it yet. + +- The fence-retired D3D12 render host took a FINAL_SCENE pass only on the command list that carries the + frame's SR evaluation: it looked for a pending command slot with that list and frame number, and the + scene counted as submitted when that recording was. An engine that evaluates SR in its render lists and + composes its final picture in a separate present list (the scene without the UI, then the UI over it) + could not hand over its HUD-less image: the pass matched no slot and was dropped, so generation never + got `fg_hudless` and the WINDOW pass never matched. +- A FINAL_SCENE pass on another list is now taken when a command slot holds an SR evaluation of the same + `native_frame`, pending or already submitted. The scene remembers that list, the host calls `fg_hudless` + on it, and the scene is submitted (`fg_submitted`) when a `submit` end carries that list. It retires no SR + slot and signals no fence. The SR capture stays with the evaluation's slot and is not taken for such a + scene. A list reused for a newer scene before the earlier one was submitted carries only the newer one. +- Nothing changes for a scene on the SR recording's list, and a final scene of a frame with no SR + evaluation is still dropped. +- Test: `a_final_scene_on_the_engines_own_list_pairs_by_frame_and_submits_with_that_list`. + +## Explicit render-host presentation, 27 November 2026 + +Built and unit-tested, not game-run or device-tested. No integration uses it yet. + +- The fence-retired render host (`render_host.h`) had two presentation modes and both hook: OWNS installs + frame generation with DXGI factory detours, ENGINE creates a MinHook observer of the engine's factory, device, + queue and chain. An engine that creates its own D3D12 window and swap chain and wants no hooks could only use the + separate Godot route (`rsf_fg12_install_explicit` plus `rsf_d3d11_present_create_for_hwnd`), without the host's + services (SR through `process_upscale`, fence retirement, scene and Present matching, latency, feedback). +- `RSF_RENDER_HOST_EXPLICIT_PRESENTATION` (2) is the third mode: the host installs generation with + `rsf_fg12_install_explicit` (the bridge is prepared, no detours) and creates no observer. The engine calls the new + `rsf_render_host_create_swapchain(host, factory, queue, window, desc, out)` at its own creation site; the host + checks the mode, the DIRECT queue and the adapter's window filter, calls the bridge's explicit creation, keeps the + queue for the overlay and reports graphics ready. The engine presents on the chain it got and reports every + boundary through the host services, as an OWNS engine does. +- An engine may instead create its own native chain (or the host refuses creation because generation was not + installed, `RSF_ERROR_NOT_READY`): SR, submission, latency and feedback still work and frame generation has no + chain to present on. `rsf_render_host_graphics` accepts the presentation queue in this mode; + `rsf_render_host_device` and `rsf_render_host_factory` accept with nothing to attach. The setup struct and + `RSF_RENDER_HOST_ABI_VERSION` are unchanged; a runtime without the mode refuses value 2 as an invalid argument. +- Unit tests: the explicit host installs explicitly, never the observer or the detour install; creation refuses + other modes, a non-DIRECT queue, a missing window or one the filter refuses, and a host whose generation install + failed, each before the bridge is called; a failed creation returns its HRESULT and hands out no chain; device, + factory and graphics reports behave as described. The bridge's own explicit creation is exercised by the existing + presentation fixture (`tests/presentation/src/fg_fixture.rs`), which was not run for this change. + +## D3D12 render host publishes render_config, 27 November 2026 + +Built and unit-tested (synthetic host fixtures), not game-run or device-tested. + +- The fence-retired D3D12 render host (`rsf_render_host_create`) now fills `render_config`, as the + callback and D3D11 hosts already did. An integration that sizes its engine from RSF's plan sends a + `process_upscale` pass flagged RECONFIGURE with the output extent. The host resolves the saved backend, creates + the provider's context for the saved SR quality without engine extents, reads the provider's render + extent (`rsf_sr12_plan`), and publishes it with that vendor's jitter phases and LOD bias + (`rsf_game_render_config::plan`). The pass keeps native evaluation. Later passes at the planned extents + reuse that context at the planned quality. +- The plan is native extents with `enabled` 0 when SR is off, the provider is not served or its plan does + not fit the output, or the saved backend, quality or enable state changed after planning. +- Without a RECONFIGURE pass nothing changes: the engine keeps its own extents and the quality is still + inferred from the received ratio (RDR2). +- Tests: `reconfigure_plans_the_saved_quality_and_publishes_the_render_config`, + `reconfigure_publishes_native_when_sr_is_off_or_refused`; the full orchestrator library suite passes. + +## D3D12 reactive and transparency masks, game ABI 26, 27 November 2026 + +Built and unit-tested (synthetic sr12 fixtures), not game-run or device-tested. + +- `rsf_game_render_pass` gains `reactive_mask` and `transparency_mask` (game ABI 26): optional D3D12 + resources leased with the SR inputs, in NON_PIXEL_SHADER_RESOURCE during `process_upscale`, covering + the render extent from the origin with one readable channel (R8_UNORM, R16_UNORM, R16_FLOAT or + R32_FLOAT). The ranges are those of `rsf_sr_frame`: reactive [0, 0.9], transparency [0, 1]. +- Before, the D3D12 path could take neither: `temporal_mask` is a D3D11 texture and `rsf_sr12_evaluate` + left `rsf_sr_frame.reactive` and `.transparency` null, although the FSR and XeSS D3D12 providers + already consume them. sr12 now validates each mask (device, single 2D texture, extent, format), + refuses the pass for an unusable one, hands both to the provider at the render extent, holds them per + command slot until that slot is reused, and records them in captures (`sr-reactive-mask`, + `sr-transparency-mask`). +- D3D11 hosts ignore the new fields; `temporal_mask` stays the D3D11 hint. DLSS ignores both masks. +- Test: `reactive_and_transparency_masks_reach_the_provider`. + +## One D3D12 host, Runtime FSR1 and Unity settings, 25 November 2026 + +Built and unit-tested, not game-run or device-tested. Rule 5 audit F4 and overlay-parity follow-up 1, on +`NightHammer1000/wave-d3d12`. + +- Drag'n Wash FSR1 switch: a change of SR provider waited for a scene packet flagged RECONFIGURE, which the managed + side records only as an inputs-only probe with depth and motion present, and the pre-UI frame-generation copy kept + admission busy every frame; with FG on, the switch to the engine's FSR1 never completed. The Mono bridge now + delivers the pending change at the window event once its command ring is idle, and the host applies it there. +- One D3D12 host module: `callback_host.rs` is gone; the Unity entry is `render_host/callback.rs`. Vendor packages, + engine identity, SR context setup and the overlay's SR card are one implementation for RDR2 and Unity. Two C + entries remain because the integrations report different retirement facts (host-fenced recordings for RDR2, + adapter-retired command ring for Unity). +- Runtime FSR1: sr12 serves Spatial itself with an FSR1 EASU kernel (`sr12/easu.hlsl`, after AMD's MIT + `ffx_fsr1.h`) where the engine has no spatial scaler, sampled at the jitter-free position. RDR2 now offers FSR1; + Unity keeps URP's own FSR1, which its adapter reports. D3D11 hosts do not have it yet. +- Unity settings: SR backend, quality and enable state, generation mode, generated frames, latency, frame limit, + status overlay, DLSS model and sharpening are `rsf_render_settings` in the preferences `[Rendering]` section, + written on every accepted change. A key never saved keeps the adapter's `[UnitySR]` start value; the provider + keeps fg_choice's key. +- Unity package on the same host: the D3D12 callback host gained per-view SR contexts and an attach mode, and the + package now attaches it per session instead of keeping its own SR views, plan, settings checks, provider + requests and view setup. `rsfu_configure`, `rsfu_settings` and `rsfu_status` translate onto the host's settings + (stored in `preferences.ini` in the package's SDK root) and status, with the C# contract unchanged; package + games get the shared overlay on the D3D12 route. sr12 plans FSR1 from the shared `fsr1.rs` table. + +Game runs must confirm: Drag'n Wash FSR1 on and off at run time with FG on and off, and settings restored after a +restart; RDR2 upscaling unchanged and its new FSR1 image stable (jitter sign) with sharpening; a Unity package test +project on D3D12, D3D11 and Vulkan (SR per camera, the C# options and the overlay changing one setting, +status, Editor preview); FG providers and +the overlay in both. Rule 5 F9 (RDR2 screen class) and F10 (RDR2 masks) wait for a game run; the Unity package +host's generation install still happens in the integration (see the audit's F4). + +## RDR2 overlay without SR or FG, 28 November 2026 + +Built and unit-tested, not game-tested. [Research](research/rdr2-renderer.md#overlay-present-neither-sr-nor-fg-active-28-november-2026). +DLSS SR on a shared D3D12 Streamline host falls back to the host's newest live frame token when the SR frame has +none, and names that and the no-token refusal once (core, every D3D12 game). The RDR2 adapter publishes its window +pass at RAGE's PRESENT_START marker again, before Present, and names withheld windows. FG rows name the first +missing admission fact (`missing=`). +Checks: `cargo test -p rsf-orchestrator --lib` (447 passed), `cargo test -p rsf-rdr2`, Clippy and rustfmt on both. + +Follow-up the same day, built and unit-tested, not game-tested: SR quality and the selected backend's own plan +change the render size while the game runs, with only the ASI loader. The plugin's frame hook drives the ASI's +settings owner, which takes the settings manager's own lock (new discovered site "settings tick"); the core's +plan replaces the engine's DLSS and FSR2 dimension tables. ScriptHook keeps only the input guard. +[Research](research/rdr2-renderer.md#live-sr-quality-and-backend-plans-without-scripthook-28-november-2026). +`cargo test -p rsf-rdr2` with `RSF_RDR2_DUMP` (43 passed, every site resolved in the dump), orchestrator lib +(447 passed), Clippy and rustfmt. CMake was not built. + +## Overlay parity across games, 25 November 2026 + +Built and unit-tested, not game-run. Every game's overlay now offers the same controls and values, and a value +the machine cannot serve is drawn greyed with its reason instead of being absent. One Runtime source decides the +offer: `sr_choices.rs` (SR backends from the GPU vendor and the package files, quality per backend) and +`fg_choice::resolve` (FG Auto per GPU). SR Auto, FSR2 and FG Auto are wired where they were missing (AC7, Skyrim +SE, Fallout 4, RDR2, Unity Mono, Anomaly), the per-adapter lists are gone, and the panel always draws the Sharpen +tab, Ultra Quality, the DLSS model and the empty-SR controls, greyed. Audit table, per-game results and the +follow-ups that could not be finished (Runtime FSR1, Fallout 4 reduced frame, Wingman host, Anomaly bridge default) +are in [overlay-parity-20261125.md](research/overlay-parity-20261125.md). `loader/proxy/src/dlss_bridge.c` changed +and was not compiled. + +## Anomaly signature discovery, 24 November 2026 + +Built and synthetic-tested, not game-tested. The adapter no longer admits an executable by its SHA-256 or name or +reads per-build address tables: `games/anomaly/src/discovery.rs` resolves all 122 sites from the running executable +(104 patterns that each resolve uniquely in both 1.5.3 DX11 builds, vtable slots, the position binder object and +decoded first-person calls), matches each site's expected code at the found address and builds the profile records +from the found sites. A missing site refuses only its feature and is named in the logs; the hash is logged. The +per-build records are fixture data behind `recorded-profiles`. Checks: `cargo test -p rsf-anomaly` (171, including +the installed-executable proof for both builds), clippy with the shipping and all fixture features, the four +evidence scripts on both builds and `tools/anomaly_profile_evidence.py` (74 checks). Native CTest fixtures, a full +`eng/verify.ps1` and a game run on each build are pending. Research: +[anomaly-native-hooks.md](research/anomaly-native-hooks.md#signature-discovery-24-november-2026). + ## Fallout 4 AE native render callbacks, 16 November 2026 User priority is now fully native Fallout4.exe without F4SE/ENB first, with @@ -714,7 +1092,7 @@ chooses the phase_sunshafts/phase_blur prologue with FP16 render-size targets an inverse/forward tonemap; all Stage 0 sites are byte-guarded and verified against the exe. The shared motion decode gained an optional validity channel. Release VS2026: 173 discovered, 162 passed, 11 optional skips, fmt/Clippy. Overlay and coverage are not yet game-tested. -[Progress](../games/anomaly/PROGRESS.md), [SR seam](research/anomaly-sr-seam.md). +[Acceptance matrix and SR seam](research/anomaly-sr-seam.md#integration-goal-and-acceptance-matrix-from-the-former-progressmd). ## Anomaly wave 1, 12 November 2026 @@ -722,13 +1100,13 @@ Resumed on request. The geometry producer is audited and built into the adapter two registered contracts. The Runtime exports a generic `rsf_get_overlay_api` with DLL-import and hardware D3D11 fixture tests. The Debug Godot CRT mismatch is fixed at its CMake cache source. Release VS2026: 168 discovered, 157 passed, 11 optional skips, fmt/Clippy. Built and -synthetic-tested only; nothing was deployed or game-tested. [Progress](../games/anomaly/PROGRESS.md). +synthetic-tested only; nothing was deployed or game-tested. [Acceptance matrix](research/anomaly-sr-seam.md#integration-goal-and-acceptance-matrix-from-the-former-progressmd). ## Anomaly checkpoint, 12 November 2026 Implementation was paused for the day. The detailed acceptance matrix, build/device evidence, installation cleanup, overlay requirement and ordered resumption checklist are in -[`games/anomaly/PROGRESS.md`](../games/anomaly/PROGRESS.md). Full in-game SR/FG and overlay +[the acceptance matrix in the SR seam note](research/anomaly-sr-seam.md#integration-goal-and-acceptance-matrix-from-the-former-progressmd). Full in-game SR/FG and overlay integration remain incomplete. No RSF DLLs or shader replacements were deployed to Anomaly. ## Anomaly DLL-only integration research, 11 November 2026 @@ -773,7 +1151,7 @@ the expected-failure unknown-selection check, and all eight Python shader-tool c the local FXC byte-identity regression. CPU history and declaration-only shader staging do not produce GPU motion or establish a usable SR seam. The reviewed r3 tree contains 449 files; 55 geometry-stage roots are identified, 44 stage roots remain unclassified, and one tree wrapper -has a blocked recursive include. See `tools/anomaly_shader_README.md` for source evidence. +has a blocked recursive include. See `docs/research/anomaly-shader-inventory.md` for source evidence. ## FidelityFX Vulkan static line width, 8 November 2026 @@ -1599,7 +1977,7 @@ still require a fresh game run. [Evidence and limits](research/shared-fg-2026100 See [current status](current-status.md) for the source/release/acceptance summary checked on 7 October 2026. This tracker preserves dated increments, test counts and superseded failures; earlier unchecked or pending entries are not automatically current blockers. No new game/device -experiment was performed for the documentation audit; [scope and checks](documentation-audit.md). +experiment was performed for the documentation audit. ## REA development tooling, 8 October 2026 @@ -2046,7 +2424,7 @@ this overlay preflight is not a gameplay test. - [x] Streamline DLSS adapter: loading, device handover, support/render-size queries, tags, constants, and evaluation. Runs in AC7. - [x] View layout mapped through matrix identities, including camera basis, projection, and `ClipToPrevClip`. Offline check: 11 captured perspective views, no failures. - [x] D3D11 motion decode with bias/scale parameters, unwritten sentinel, and compute-state handling. Cross-built and tested under Wine/DXVK with source-encoded values and an axis flip. Game-buffer dumps matched the reference range and unwritten fraction. -- [x] AC7 view reader with matrix/size checks, main-view classification, pixel jitter, and unjittered projection. Recorded dataset: 50 recognized buffers, ten perspective views, secondary views marked. [Review](review.md) identifies remaining validation defects. +- [x] AC7 view reader with matrix/size checks, main-view classification, pixel jitter, and unjittered projection. Recorded dataset: 50 recognized buffers, ten perspective views, secondary views marked. The 7 September review (since removed) identified remaining validation defects. - [x] `TemporalAAJitter` located at `0x720` by comparing pre/post-patch captures, then checked against projection entries and live pixel offsets. - [x] Orchestrator frame assembly converts plugin camera/resource data into a DLSS frame and rejects unusable combinations. Unit-tested without GPU work. - [x] Live DLSS evaluation. Initial run: 2,176 recognized passes, 2,175 evaluations, no refusals. Mission run on 7 September: 7,917 evaluations, no refusals, 1024×576 input and 2048×1152 output. Recorded images show recovered detail and a complete scene; flight showed no obvious smearing. F7 is a debug display; reinsertion, grading, HUD, and controlled motion validation remain pending. [Evidence](research/ac7-frame-capture.md). @@ -2208,7 +2586,7 @@ classes are the tracker's: built, synthetic-tested, game-tested, device-tested. - [ ] M1. Classify every UI draw per screen, change nothing. The mechanism is built and synthetic-tested; the run that answers the question has not happened. - [x] The classifier as a pure function over shadowed facts, in `games/ac7/src/ui_rules.cpp` - with a no-device test (`445fc54`). + with a no-device test (`445fc54`). That file no longer exists in the tree. - [x] Vertex declaration and widget-target fingerprints, verified against UE 4.18.3 at `0a14a8d537a3` rather than the checkout's default 5.8.2 branch, where the same structures have a different shape (`0b16d2c`). @@ -2550,16 +2928,18 @@ producer extensions have not been game-tested. use the verified ordinary total-motion path or AC7's unidentified custom projection path. Preserve valid zero motion separately from unwritten pixels, and never add camera movement twice. Verify the sentinel handling against the Streamline version actually loaded. -- [ ] Reconcile the Rust and live C/C++ motion conversions. `MotionToPixels::unreal` in - `runtime/backends/rsf-upscaler/src/frame.rs` uses half the viewport extent and a vertical - sign flip, while `loader/proxy/src/dlss_bridge.c` and - `runtime/orchestrator/src/dlss_pipeline.cpp` currently default output/backend scales to - one. Trace clip displacement, normalized UV displacement, pixel units, and temporal +- [ ] Reconcile the Rust and live C motion conversions. At the time of this entry + `MotionToPixels::unreal` (the `rsf-upscaler` crate, since removed) used half the viewport + extent and a vertical sign flip, while `loader/proxy/src/dlss_bridge.c` and the DLSS + pipeline (now `runtime/orchestrator/src/dlss_pipeline/`, with the conversions in + `motion_decode.rs` and `motion_resolve.rs`) defaulted output/backend scales to + one. Re-check against those files, then trace clip displacement, normalized UV displacement, pixel units, and temporal direction end to end. Measure aircraft or missile displacement on both axes before applying the proposed ordinary-path Streamline scale `(0.5, -0.5)`. Rust's helper expresses the opposite temporal direction from the FSR/XeSS resolve; distinguish direction from units. Matching a numeric range alone does not establish matching units. -- [ ] Verify jitter throughout reprojection. In `games/ac7/src/view_uniforms.cpp`, establish +- [ ] Verify jitter throughout reprojection. In the AC7 view code (formerly + `view_uniforms.cpp`, now `games/ac7/src/view.rs`), establish whether the captured unjittered `ClipToPrevClip` result holds in stationary and flight views, and identify the custom producer's projection/jitter selection. Removing jitter from `ViewToClip` alone does not prove this. With a stationary camera and @@ -2781,7 +3161,7 @@ backend evaluation is not evidence that the supplied scene includes intact light - [ ] Reassess remaining hangar banding using an intact input scene. Keep driver preset selection unrestricted. Post-tonemap SR is a possible experiment, not the established correction. -Open defects from the [7 September review](review.md). These are not fixed by the documentation rewrite. +Open defects from the 7 September review (since removed). These are not fixed by the documentation rewrite. - [ ] Move F8 startup and F7 state changes to a render-thread command boundary; eliminate concurrent immediate-context use. - [ ] Reject non-finite camera, projection, reprojection, and jitter data in the reader/assembly path; add poisoned-input regressions. @@ -3105,7 +3485,7 @@ backup `.local/deploy-backups/ac7-pair-20261004-132153-981`; not yet seen in gam ## Codebase review pass (2026-10-09) -Implemented the [codebase review](reviews/codebase-review-20261009.md): shared helpers for D3D12, logging, shader compile, SRV formats and plugin boilerplate; the FG bridge reads engine identity from setup and has one retire export; the frame tap uses a game-supplied role table; per-frame cost reductions in the tap, SR bridge and Unity managed code; dead code removed. The full item table is section 8 of the review. +Implemented the 9 October codebase review (since removed): shared helpers for D3D12, logging, shader compile, SRV formats and plugin boilerplate; the FG bridge reads engine identity from setup and has one retire export; the frame tap uses a game-supplied role table; per-frame cost reductions in the tap, SR bridge and Unity managed code; dead code removed. Status: built (Release, MSVC) and synthetic-tested (ctest 49/49, 7 hardware-gated tests skipped; cargo fmt, clippy and test clean; RTX shared-host test passed). NOT game-tested. diff --git a/docs/releases/README.md b/docs/releases/README.md index 04a11b649..6569c7ce3 100644 --- a/docs/releases/README.md +++ b/docs/releases/README.md @@ -16,9 +16,14 @@ Use Python 3.11 or newer. Run the native/Rust gate and the integration checks be release-set dry run. The tool checks that the fetched `origin/main` is merged, but cannot prove the remote was just fetched. It never fetches, merges, commits, pushes, deploys to a game or publishes a release itself. +The vendor inputs come from the pinned submodules and `eng/fetch-vendor.ps1` (`vendor/streamline-sdk` is the default +`--streamline-root`; see [Vendor SDKs](../dependencies.md#vendor-sdks)): + ```powershell -py -3 tools/package-release.py --streamline-root D:/Coding/ReScaleFrame/.local/streamline/sdk --dry-run -py -3 tools/package-release.py --streamline-root D:/Coding/ReScaleFrame/.local/streamline/sdk +git submodule update --init --depth 1 +./eng/fetch-vendor.ps1 +py -3 tools/package-release.py --dry-run +py -3 tools/package-release.py ``` Default output is `build/releases/`. Use `--output ` to choose another ignored or external @@ -36,7 +41,7 @@ Do not package while another process is changing the build outputs. An explicit build is available when the normal build directory is free: ```powershell -py -3 tools/package-release.py --streamline-root D:/Coding/ReScaleFrame/.local/streamline/sdk --build +py -3 tools/package-release.py --build ``` This builds Cargo Release, native Release, the matched Unity Mono helper, copies the overlay, stages Minecraft's @@ -47,8 +52,7 @@ must match the Streamline payload passed to the release builder. No game install Successful incremental builds may reuse older unchanged binaries; the JSON summary lists them. `--dry-run` and `--build` cannot be combined. Never run this build option in a directory another worker has reserved. -The tool writes one `ReScaleFrame--source.zip` using `git archive` of the recorded commit and adds the -incorporated yyjson source/header/license after checking their pinned hashes. It never adds local game shader trees, +The tool writes one `ReScaleFrame--source.zip` using `git archive` of the recorded commit. It never adds local game shader trees, licensed engine source or compiled caches. Archives receive CRC/path/duplicate checks and asset hashes are streamed. The JSON summary reports version, commit, tag, names, sizes and SHA-256 values. A dry run reports planned names with null sizes/hashes and creates no release files. diff --git a/docs/releases/v0.1.0-ac7.md b/docs/releases/v0.1.0-ac7.md deleted file mode 100644 index 9441fdaad..000000000 --- a/docs/releases/v0.1.0-ac7.md +++ /dev/null @@ -1,44 +0,0 @@ -Release record: the corrected published v0.1.0 AC7 SR package, replaced on 2 October 2026. -FG/Reflex and Unity features on later `main` are outside this package. See -[current source status](../current-status.md). - -The first AC7 release is ready. DLSS starts with the game, the UI stays sharp, and the briefing -terrain and aircraft icons now render at full resolution without inheriting the scene's jitter. - -### Install - -1. Download **ReScaleFrame-0.1.0-AC7-Windows-x64.zip** below. -2. Close AC7. In Steam, choose **Manage > Browse local files** and find `Ace7Game.exe`. -3. Extract the ZIP into that folder. `dinput8.dll`, `rescaleframe_overlay.dll` and - `ReScaleFrame.ini` should sit beside the executable, with the included `ReScaleFrame` folder. -4. Launch normally. No developer hotkeys or Windows launch options are needed. - -The DLSS runtime is included. You need an NVIDIA RTX GPU with DLSS support and the -[current Visual C++ x64 runtime](https://aka.ms/vc14/vc_redist.x64.exe). - -If another mod already uses `dinput8.dll`, don't overwrite it. This build does not chain other -DirectInput proxies. - -### Use - -Press **Insert** to open the overlay. Turn **Enable DLSS** on or off and choose a preset: - -- **Native** uses DLAA at your output resolution. -- **Quality**, **Balanced**, **Performance** and **Ultra Performance** control the scene's render scale. - -Performance is the default. Your choices are saved for the next launch. The briefing layer stays -at full resolution whichever preset you choose. Turning DLSS off restores native rendering. - -### Scope - -This release is for the Steam version of AC7 on Windows x64, tested with build 9855922. -It includes DLSS Super Resolution and DLAA. Frame generation, Reflex, XeSS and FSR will come -separately; other game builds and Proton have not been validated with this release. - -To uninstall, close the game and remove the files you copied in. Saved preferences are in -`%LOCALAPPDATA%\ReScaleFrame\AC7.ini`; logs are in `%LOCALAPPDATA%\ReScaleFrame\AC7\`. - -If you run into a problem, [open an issue](https://github.com/KillerPixelCrew/ReScaleFrame/issues) -with your GPU, driver, preset, resolution and the relevant log excerpt. - -Thanks for trying it. The source archive, checksums and third-party notices are included. diff --git a/docs/releases/v0.1.1-windows.md b/docs/releases/v0.1.1-windows.md index fa06f3fc9..7b5d8ae27 100644 --- a/docs/releases/v0.1.1-windows.md +++ b/docs/releases/v0.1.1-windows.md @@ -3,22 +3,18 @@ Correction: the Project Wingman observer preview was withdrawn to draft. It should not have been offered as a game release. Project Wingman remains renderer research only; Drag'n Wash is the integration requested for the next -updated package. The build record below preserves what was prepared and checked. +updated package. The build record below covers the AC7 prerelease only. -Two separate prerelease downloads are built from the same committed source: +The prerelease download is built from committed source: - **AC7:** dedicated DirectInput carrier, game plugin, Rust overlay and pinned DLSS/DLSS-G/Reflex, FidelityFX SR/FG and XeSS SR/FG/XeLL runtime payloads. FG defaults Off. Stable SR-only 0.1.0 assets remain available. No fresh AC7 gameplay acceptance is claimed. -- **Project Wingman:** XInput carrier, shared runtime and exact-build game - plugin. This is a temporal-graph observer only. SR, FG, latency and VR - processing remain unimplemented. No vendor-runtime payload is included. -Install guides: [AC7](ac7-development-install.md) and -[Project Wingman observer](wingman-observer-install.md). Each archive includes -its own file-hash/source-commit manifest and notices. Corresponding source and -SHA256SUMS accompany each download. +Install guide: [AC7](ac7-development-install.md). The archive includes +its file-hash/source-commit manifest and notices. Corresponding source and +SHA256SUMS accompany the download. ## Build correction and checks @@ -31,22 +27,14 @@ The next clean build exposed the same warning in the lifecycle template when its quiesce check always returns OK. A result switch preserves every refusal and successful transition without a constant Boolean condition. -After compilation succeeded, the clean runner failed the Wingman forwarding -fixture without a diagnostic. The fixture now prints carrier/system load -errors and marks only a missing system XInput 1.3 DLL as a dependency skip, -after checking carrier exports. Other load failures still fail. The actual -system forwarding check passes locally; a skipped CI check is not forwarding -acceptance and does not replace that local result. - Local Windows VS2026/MSVC Release verification with the pinned SDK headers passes 44 native checks, with eight opt-in fixture skips, Rust formatting and Clippy. All 59 Rust tests pass and the Release overlay builds. This is build and fixture evidence, not gameplay or physical latency validation. The AC7 packager now includes AMD's loader alongside its SR/FG libraries and -the MFG-Unlocker MIT notice alongside the existing SDK notices. The Wingman -packager uses an explicit three-DLL allowlist and portable observer config. -Both reject dirty source, verify ZIP integrity and per-file hashes, and emit +the MFG-Unlocker MIT notice alongside the existing SDK notices. +It rejects dirty source, verifies ZIP integrity and per-file hashes, and emits matching source archives and checksums. Vendor SDKs and binaries stay ignored. Pinned runtime hashes match the AC7 packager's FidelityFX 2.3.0 and XeSS 3.0.2 diff --git a/docs/releases/wingman-observer-install.md b/docs/releases/wingman-observer-install.md deleted file mode 100644 index ea1621253..000000000 --- a/docs/releases/wingman-observer-install.md +++ /dev/null @@ -1,36 +0,0 @@ -# ReScaleFrame for Project Wingman: observer preview - -This Windows x64 development package records the native temporal render graph. -It does not implement upscaling, frame generation, latency integration or VR -processing. It is intended for renderer research, not a visual upgrade. - -Requires the researched Steam build 16671873 and the x64 Visual C++ v14 runtime. -Executable: `ProjectWingman-Win64-Shipping.exe`, SHA256 -`092e84225624a4de9c05d2404ff55269bd4a2aa2ff0548f2a183c6bf36abc85a`. -Other builds are refused. Install the Microsoft runtime from -https://aka.ms/vc14/vc_redist.x64.exe if MSVCP140/VCRUNTIME140 is missing. - -1. Close Project Wingman. Back up existing mod files. -2. Extract the entire ZIP beside `ProjectWingman-Win64-Shipping.exe`. - `xinput1_3.dll` and `ReScaleFrame.ini` belong beside the executable, with the - included `ReScaleFrame` directory. Do not replace another mod's XInput proxy; - chaining is not supported by this package. -3. Launch normally. The included `[ProjectWingman] ObserveNative=1` setting - enables the guarded observer. Native TAA continues unchanged. -4. Read `ReScaleFrame/project-wingman.log` for prepare/start results and graph facts. - -Set `ObserveNative=0` and restart to disable observation. There is no settings -overlay or vendor-runtime payload in this observer package. The runtime only -uses the game-plugin lifecycle here and does not activate a graphics provider. - -The manifest identifies the source commit, exact file hashes and capability -limits. Build/contract tests do not establish a fresh live-game or VR test. -Earlier desktop acceptance is recorded in the repository's Project Wingman -guide and research; this new package has not received a fresh gameplay test. - -To uninstall, close the game and remove the added `xinput1_3.dll`, -`ReScaleFrame.ini` and `ReScaleFrame` directory, restoring backed-up mod files. -Include the source commit, game build and observer log with issue reports. -First-party code is GPL-3.0-only except the MIT Game SDK. Included MinHook and -MFG-Unlocker notices retain their respective terms. Corresponding source is -provided as a separate archive. diff --git a/docs/representation-plan.md b/docs/representation-plan.md index 2f6d7a3a8..6741bf95a 100644 --- a/docs/representation-plan.md +++ b/docs/representation-plan.md @@ -1,577 +1,12 @@ -# Plan: Representation — UI extraction, presentation bridge, SR+FG for DLSS, FSR and XeSS +# Representation plan: retained research base -Historical design and milestone record. ABI 2 sketches, UI diversion and planned deletion lists -below are not the current implementation. Game ABI is now 13, overlay ABI is 9, and native UI -ownership plus shared SR/FG services supersede earlier assumptions. See -[current status](current-status.md) and the current SDK headers for implementation and limits. +The plan itself (UI diversion, the ABI 2 frame-callback sketches, milestones and deletion lists) is +not the current design and was removed; Git history holds it. This page keeps its appendix, the +research the plan was built on, as evidence. For what is implemented and its limits see +[current status](current-status.md) and the SDK headers (`sdk/game/include/rescaleframe/`), and for +frame generation see [the frame-generation plan](frame-generation-plan.md). -## Context - -30 September 2026: use [the frame-generation orchestrator plan](frame-generation-plan.md) for -current FG, MFG and latency design/milestones. It reuses the accepted root UI work, separates -pacing from PCL telemetry and updates SDK ownership/lifetime rules. The historical decisions and -superseded UI assumptions below remain as their research trail. - -The AC7 super-resolution input chain is done and game-tested (7 Sep 2026): jitter, translucent -velocity, composed scene colour, translucent depth, and the separate translucency layer at native all -reach the backend. What remains is presentation, and today's work on it established, from source and -runs rather than inference: - -- AC7 rasterizes its front-end interface at a hardcoded 1920x1080 - (`UWidgetToTextureConverter_Setup 0x1404d5c10`, constants at `0x1425f1cac`/`0x1425f1ce4`). The - interface's own resolution was never the problem. -- On the screens that look soft (briefing, hangar) the interface is drawn as world-space widget - quads (`Widget3DPassThrough_Translucent`) **into AC7's own render-resolution `R8G8B8A8` UI layer** - (`0x308F6550`/`0x308F6190`, alternating), depth-tested against the scene, and composited by the - game into the composite before the upscale. Reinsertion also misses an unpromoted intermediate - (`0x308E2770`) on that path. Promotion cannot sharpen this; extraction can. -- No frame-generation SDK runs on D3D11 (`sl.dlss_g.dll` manifest `"rhi": ["d3d12","vk"]`; - FidelityFX FG and XeFG are D3D12-only). Every FG path needs a DX11→DX12 presentation bridge. -- All three FG SDKs want the same UI contract: `Final = UI.rgb + (1 − UI.a) × HUDless.rgb`, - premultiplied, alpha 0 where no UI, same extent/format/colour space as the back buffer, plus - post-grade HUD-less colour. One `R8G8B8A8_UNORM` layer satisfies all of them (never R10G10B10A2, - which is AC7's back buffer). - -The user's decisions: the plan covers **everything needed to be clear and set for SR and FG across -DLSS, FSR and XeSS as one framework**; the existing design is **not a boundary** (tap / reinsert / -bridge / loader-hosted structure may be reworked on merit); no lazy routes — from references -(Skyrim CS, fo4test, FO4 CS, OptiScaler, SpecialK, UE 4.18.3, the AC7 SDK, the three vendor SDKs). -What stays fixed is `AGENTS.md`: C ABI at module boundaries, game rules in `games/ac7`, presentation -and vendors in `runtime/`, warnings as errors, expected-byte guarded patches, honest status, MIT game -SDK free of GPL includes. - -## Decisions (settled, with the reason) - -| Decision | Choice | Why | -| --- | --- | --- | -| UI handling | **Superseded 7 Sep 2026 by measurement, see below.** Divert every classified UI draw into a mod-owned premultiplied `R8G8B8A8_UNORM` layer at back-buffer extent, no depth; scene stays HUD-less; composite at present when FG is off; hand layer + HUD-less to FG when on | Skyrim CS `SetUIBuffer`; the vendor contract; the only thing that sharpens geometry-rasterized UI | -| UI handling, corrected | Promote AC7's own interface target to output resolution and scale the rasterizing draws' viewports, so the game's UI composite runs as it always did; take the frame generation layer from that promoted target, which already holds premultiplied colour with coverage | The divert works and the insertion point is wrong: the quads read the scene and its glow chain, so they are composites rather than overlays, and compositing at present skips AC7's own UI composite, glow and grade. Promotion keeps all three and yields the same layer the vendors ask for | -| Depth for diverted quads | Divert regardless of the scene depth being bound; bind no DSV (overlay semantics); `RSF_UI_DEPTH=0` default, promoted depth via `depth_replay`'s output-res depth later | The briefing quads all bind scene depth; "divert only depth-free draws" would extract nothing | -| Alpha | Per-draw blend patch on "over" blends only (`DestBlend == INV_SRC_ALPHA`): alpha ops → `ONE/INV_SRC_ALPHA/ADD`, colour ops untouched, cached by original state pointer; Slate untouched (already accumulates); additive left (alpha 0 = pure add); modulate counted, not representable | UE base-pass `BLEND_Translucent` keeps alpha at 0 from a transparent clear (`BasePassRendering.h:1105`); Slate does not (`SlateRHIRenderingPolicy.cpp:730`); Skyrim CS `GetPatchedAlphaBlendState` | -| Identification | Plugin-side classifier: shader-hash override table → Slate input-layout fingerprint (into non-widget target) → reads a registered widget render target with a translucent blend → scene | Every format rule so far was wrong once; SpecialK's hash registry; UE's `FSlateVertex` layout is distinctive | -| Presentation | `IDXGISwapChain4` facade with PASSTHROUGH and BRIDGED modes; BRIDGED never creates the game's D3D11 chain; the FG vendor creates/wraps the real HWND chain; shared NT-handle surfaces + shared fence, two-deep ring, `UNTIL_NEXT_PRESENT` | fo4test / FO4 CS / OptiScaler `Dx11wDx12SC`; `architecture.md` bridge section | -| SR routing | DLSS-SR native D3D11 unless DLSS-G owns FG (Streamline is one device per process → SR moves to the D3D12 proxy via the bridge); FSR-SR via bridge (ffx_api ships DX12 only); XeSS-SR D3D11 on Arc, D3D12 via bridge elsewhere | Vendor facts in the appendix | -| FG order | FSR-FG → DLSS-G → XeFG (+XeLL); Claw run as the device-test milestone | FSR runs on the RTX 4070 in front of us with no XeLL and no Streamline conflict; DLSS-G is the user's GPU; XeFG runs here only in non-Intel mode (1 frame) | -| Compositor rule | Exactly one compositor per rendered frame: our D3D11 composite when FG is off; the vendor composites generated frames; egui draws into the UI layer after the game's UI so it rides both | Skyrim CS flicker rule (`FidelityFX.cpp:167`) | -| Render scale | Through the game's own per-context table (`FGraphicsSettingsManager`), expected-byte guarded; `r.ScreenPercentage` write only as announced fallback; `keep_render_scale` deleted once game-tested | The game overwrites the cvar on every transition; the table is where the value belongs | -| Texture LOD bias | Apply `log2(render.y / output.y)` as a mip bias offset while SR is active, and 0 when it is not; sampler-state patch at creation, off switch `RSF_SR_MIP_BIAS` | Rendering at half height samples mips chosen for half height, so textures arrive soft and no upscaler recovers detail that was never sampled. Every upscaler integration does this and ours did not (Luma `main.cpp:1486`) | -| SR resolution model | Create the SR feature once at the output extent with the vendor's dynamic-resolution flag set, and vary only the per-evaluation render extent | Our screen policy changes the scale on every menu/flight transition; a feature created at a fixed render extent has to be destroyed and rebuilt at each one, which costs the history. Luma `main.cpp:917` sets it unconditionally for the same reason | -| View uniforms | Read at the game's own `Map`/`Unmap` of the constant buffer, not through a staging copy | `constant_buffer_read.cpp:65-83` creates a staging buffer, `CopyResource`s and maps it, which is a GPU round trip per read and lands a frame late. The data is already in CPU memory at the moment the game writes it (Luma `main.cpp:1344-1396`) | -| Engine's own `r.HDR.UI.CompositeMode` path | Recorded, not used | Covers Slate only, HDR-encoded LUT composite, front-end UI on the screens that matter is quads | -| Deleted mechanisms | format-based interface identification, the shape hunt and its collection, relooks (all gone 26 September), `present_blit`, `dlss_bridge.c`, `keep_render_scale` (after M3), `rsf_observer_present_fn` | Replaced by the classifier naming the layers, `fullscreen_pass`/`composite`, the orchestrator session. Interface-layer promotion was on this list and is back, because extraction was measured to discolour the frame; see the M2 notes in the tracker | - -## Architecture - -### Module map and link direction - -``` -sdk/game/ rsf_game_sdk (INTERFACE, MIT) game_api.h (ABI 2), game_frame.h (new) -runtime/contract/ rsf_contract (INTERFACE) backend.h, presentation_types.h -> GameSDK -runtime/graphics/ rsf_graphics (STATIC) frame_tap (ABI 7), allocation_watch (was d3d11_observer, ABI 5), - scene_promote (was scene_reinsert), fullscreen_pass (from present_blit), - d3d11_state (+draw_state_save/restore), overlay_renderer, depth_replay, - motion_decode, resource_roles, resource_ref, texture_dump, overlay_input -runtime/presentation/ rsf_presentation (STATIC) present_intercept, swapchain_facade, d3d12_bridge, shared_surface, - presentation_ring, ui_layer, hudless, composite, present_loop, d3d12_util.h - -> Graphics, Contract, d3d12 -runtime/backends/dlss|fsr|xess/ rsf_backend_ (STATIC, RSF_HAVE_) backend_.h; _session, _sr, _fg (+xell) - -> Contract, d3d11, d3d12, dxgi -runtime/backends/rsf-upscaler/ Rust crate, kept; capability model + #[repr(C)] mirror (abi.rs), FG fields -runtime/orchestrator/ rsf_orchestrator_core (OBJECT) session, settings, backend_registry (+negotiate), sr_pipeline (was dlss_pipeline), - frame_assembly (on backend.h), frame_sequencer, overlay_host (moved), status - -> Contract, Graphics, Presentation, Backend{DLSS,FSR,XeSS} -games/ac7/ rsf_ac7_rules (STATIC, replaces rsf_ac7_scene_color) scene_color (kept), frame_tail, ui_rules, widget_targets, - screen_policy, graphics_settings, patches, ui_shader_overrides -> GameSDK, Graphics, Contract - rsf_game_ac7 (SHARED) plugin.cpp implements hooks -loader/proxy/ rsf_proxy_dinput8 (SHARED) carrier: DirectInput forward, ini, decrypt wait + patch application, hotkeys -> commands - -> LoaderDiagnostics, OrchestratorCore, AC7Rules, AC7View (still one dinput8.dll to deploy) -``` - -Backends never include presentation; presentation never includes a backend header (calls -`rsf_fg_provider` through the vtable the orchestrator supplies); `games/ac7` includes neither; -`sdk/game` includes nothing else. `frame_assembly.h` stops including `dlss.h`. - -### Vendor-neutral contract: `runtime/contract/include/rescaleframe/backend.h` - -Enums: `rsf_vendor {NONE, NVIDIA, INTEL, AMD}` (Rust order), `rsf_gfx_api` bitmask `{D3D11, D3D12, -VULKAN}`, `rsf_quality {NATIVE, QUALITY, BALANCED, PERFORMANCE, ULTRA_PERFORMANCE, ULTRA_QUALITY}`, -`rsf_lifetime {ONLY_NOW, UNTIL_NEXT_PRESENT}`, `rsf_ui_mode` bitmask `{NONE, BACKBUFFER_UI, -HUDLESS_UI, BACKBUFFER_HUDLESS, BACKBUFFER_HUDLESS_UI}`, `rsf_motion_units`, `rsf_latency_mode {NONE, -XELL, PCL}`, `rsf_sr_route {NONE, NATIVE_D3D11, BRIDGE_D3D12}`, `rsf_backend_result` (`OK, -INVALID_ARGUMENT, ABI_MISMATCH, NOT_COMPILED, LOAD_FAILED, MISSING_ENTRY_POINT, INIT_FAILED, -NOT_SUPPORTED, NOT_READY, FEATURE_FAILED, STALE_RESOURCES, NEEDS_RESTART, WRONG_API`). - -Structs (all `struct_size` first): `rsf_backend_probe_desc {game_api, adapter_luid, d3d11_device, -d3d12_device, runtime_directory_utf8, log}`; `rsf_backend_caps {vendor, name, availability, sr_apis, -fg_apis, reconstructs_camera_motion, needs_exposure, max_generated_frames, ui_modes, -supported_lifetimes, fg_owns_swapchain, sr_fg_share_session, latency_modes, -fg_requires_latency_markers, supports_dynamic_fg, driver versions, refusal_utf8}`. - -`rsf_sr_provider {probe, open(rsf_sr_open_desc), plan(rsf_sr_plan), evaluate(session, -command_context, rsf_sr_frame), release_resources, close}` — `rsf_sr_frame` carries frame_id, -resource_generation, the five textures with D3D12 states, sizes, quality, jitter, motion scale and -sentinel, `rsf_camera_frame`, reset, frame time. SR inputs are always `ONLY_NOW`. - -`rsf_fg_provider {probe, create_swapchain(rsf_fg_swapchain_desc → rsf_fg_swapchain_result -{present_chain, d3d12 proxies, effective max frames, effective ui mode}), set_options(enabled, -generated_frames, ui_mode), tag_frame(session, command_list, rsf_fg_frame), after_present, resize, -latency_marker, latency_sleep, get_status, destroy_swapchain}` — `rsf_fg_frame` carries frame_id -(0 when ambiguous), present_index, generation, `rsf_fg_resource {resource, state, rect, format, -lifetime, generation}` for depth/motion/hudless/ui/backbuffer, sizes, unjittered view/projection and -clip↔prev-clip, jitter, camera, frame time, reset, interpolate, generated_frames. - -Each vendor header exports `rsf__sr_provider()` / `rsf__fg_provider()`; without headers the -getters exist and `probe` returns `NOT_COMPILED`; with headers and no DLL, `LOAD_FAILED` with the -path. `backend_registry.h`: `rsf_backend_registry_probe_all` and `rsf_negotiate(settings, caps[3], -game_inputs) → rsf_backend_choice {sr_vendor, fg_vendor, sr_route, ui_mode, latency, -generated_frames, restart_required}` plus reasons (the Rust `Reasons` + `FG_NEEDS_BRIDGE`, -`SR_FG_SESSION_CONFLICT`, `UI_MODE_UNSUPPORTED`). Vendor mapping per call (Streamline `slInit` -manual hooking / `slUpgradeInterface` / `slDLSSGSetOptions` with `enableUserInterfaceRecomposition` -and `eEnableFullscreenMenuDetection` / tags `eValidUntilPresent`, nulled when `interpolate == 0`; -FFX `ffxCreateContext` upscale + `FrameGenerationSwapChainForHwndDX12` + `FrameGeneration` + -`Hudless`, `RegisterUiResourceDX12{USE_PREMUL_ALPHA | ENABLE_INTERNAL_UI_DOUBLE_BUFFERING}`, -`PrepareV2` with `frameID = present_index`; XeSS `xessD3D11/D3D12Init`, -`xefgSwapChainD3D12InitFromSwapChainDesc` + `GetSwapChainPtr(IDXGISwapChain4)`, -`SetUiCompositionState`, `TagFrameResource` for HUDLESS/DEPTH/MV/UI/BACKBUFFER, `SetPresentId`, -`xellD3D12CreateContext` + markers) is in the appendix's vendor table and the architecture design. - -### Frame record: `sdk/game/include/rescaleframe/game_frame.h` (MIT) - -`rsf_frame_id` (u64, plugin-assigned at the input boundary, monotonic; 0 = none), -`rsf_frame_phase {INPUT, SIMULATION, RENDER_SUBMIT, SR_EVALUATED, HUDLESS_CAPTURED, UI_COMPLETE, -PRESENTED}`, `rsf_screen_class {UNKNOWN, MENU, BRIEFING, HANGAR, FLIGHT, REPLAY, VIDEO, LOADING}`, -`rsf_latency_marker` (XeLL numbering), flags `RESET, NO_SR, NO_FG, AMBIGUOUS_ID, UI_DIVERTED`. -`rsf_frame_record {frame_id, session_id, view_id, resource_generation, phase, flags, screen, render -and output sizes, input_qpc, frame_time_ms, rsf_camera_frame camera}`. `rsf_camera_frame` moves here -unchanged. Assignment: plugin → `frame_id`, `screen`, camera; orchestrator → generation (bumped on -resize, render-size change, surface/FG-chain recreation), frame time; bridge → `present_index` -(contiguous, non-TEST presents; FFX `frameID`, XeFG `presentId`). Without the outer -`FEngineLoop::Tick` hook the sequencer uses the latest begun frame and sets `AMBIGUOUS_ID`; DLSS-G -(`fg_requires_latency_markers`) then gets `interpolate = 0` with the reason reported; FFX and XeFG -interpolate on `present_index`. MFG: `RSF_FG_MULTIPLIER` 2/3/4 → generated 1/2/3, bounded by caps; -reservation at `create_swapchain`, active count via `set_options`; changing the reservation is -`NEEDS_RESTART`. - -### Presentation bridge: `runtime/presentation` - -Intercept (`present_intercept`): `IDXGIFactory::CreateSwapChain` (vtable 10, from a factory we -create), `IDXGIFactory2::CreateSwapChainForHwnd` (15), `D3D11CreateDeviceAndSwapChain` (IAT), and -`ID3D11Device` slots 3/5/11/12/15 once the device is known (`allocation_watch`). Installed from the -carrier's first worker at attach. A chain created before the hook armed → BRIDGED refused with -`restart_required = INTERCEPT_LATE`. - -Facade (`swapchain_facade`, `SwapChainFacade final : IDXGISwapChain4`): PASSTHROUGH wraps the game's -chain and runs composite + overlay in `Present`; BRIDGED never creates the game's chain, returns the -D3D11 side of `game_backbuffer` from `GetBuffer(0)`, synthesises descs, forwards fullscreen state, -`DXGI_PRESENT_TEST` forwards only. Inner chain by FG owner: DLSS_G → Streamline proxy chain on the -`slUpgradeInterface`d factory/device/queue; FSR_FG → the chain FFX created; XEFG → the proxy from -`xefgSwapChainD3D12GetSwapChainPtr`; no owner → our own flip-model `CreateSwapChainForHwnd` -(`FLIP_DISCARD`, `max(2, requested)` buffers, tearing when supported, MSAA degrades to PASSTHROUGH). -Owners are fixed at creation; a vendor or mode change is `NEEDS_RESTART`. - -D3D12 side (`d3d12_bridge`, `shared_surface`, `presentation_ring`): same-adapter `D3D12CreateDevice` -(12_0), one DIRECT queue, per-slot allocators and lists; `ID3D12Fence` shared → -`ID3D11Device5::OpenSharedFence`; surfaces created on D3D11 with `SHARED | SHARED_NTHANDLE`, opened -on D3D12, generation-stamped. Surface set: `game_backbuffer` (game format, RTV+SRV), `hudless[ring]` -(game format), `ui[ring]` (`R8G8B8A8_UNORM`, RTV+SRV+UAV), `depth[ring]` (`R32_FLOAT`, render size), -`motion[ring]` (`R16G16_FLOAT`, decoded), `present_copy[ring]` (D3D12-only), and `sr_*` when -`sr_route == BRIDGE_D3D12`. - -Per-Present protocol (BRIDGED, non-TEST, render thread): (1) `s = present_index % ring`, CPU wait on -`slot_fence[s]`; (2) `CopyResource(hudless[s], game_backbuffer)`; (3) composite `ui[s]` over -`game_backbuffer`, then overlay; (4) depth/motion from this interval's SR gate into `depth[s]`, -`motion[s]`, else `interpolate = 0`; (5) `ctx4->Signal(fence11, ++v)`, `queue->Wait(fence12, v)`; -(6) list `s`: barriers, `CopyResource(present_copy[s], game_backbuffer)`, transitions to the tagged -states, `fg->tag_frame`, execute; (7) `present_chain->Present`, `fg->after_present`; (8) -`queue->Signal(fence12, ++v)`, `slot_fence[s] = v`, `ctx4->Wait(fence11, v)`; (9) clear -`ui[(s+1)%ring]` to `{0,0,0,0}`, `present_index++`, `rsf_frame_tap_end_frame`. Without an FG owner, -(6)–(7) copy into the real back buffer, so the bridge is testable before any vendor. SR through the -bridge: at the tap gate D3D11 copies scene colour/depth/motion/exposure into `sr_*`, signals; D3D12 -evaluates into `sr_out`, signals; `ctx4->Wait`, then the gate binds `sr_out` as scene colour. - -Resize: full fence drain, release surfaces and real-buffer references, `fg->resize` or -`present_chain->ResizeBuffers`, recreate on size/format change, `generation++`. Minimised/zero size -→ `interpolate = 0`. `DEVICE_REMOVED/RESET` → `bridge_state = dead`, forward-only. Loading, video, -menu, cuts → `NO_FG` → `interpolate = 0`, null tags for DLSS-G, `reset` from `RESET`. - -### UI layer, HUD-less, composite (`ui_layer`, `hudless`, `composite`, `fullscreen_pass`) - -- `ui[ring]`: `R8G8B8A8_UNORM`, back-buffer extent, RTV+SRV+UAV, premultiplied, cleared `{0,0,0,0}` - after every Present and at creation, never bound with a DSV, shared when BRIDGED, plain when - PASSTHROUGH; `written_this_frame` gates the composite and the tag. -- `hudless[ring]`: `CopyResource` of the graded back buffer before the composite (HUD-less by - construction when extraction is on; on the seam when a classified UI draw is not diverted). -- `composite`: `Final = UI.rgb + (1 − UI.a) × Scene.rgb` with `ONE / INV_SRC_ALPHA` - (`rsf_blend_premultiplied`, taken from `overlay_renderer.cpp:543-551`), point sampler, no depth; - modes `UI`, `DEBUG_SR` (replaces F7's tonemapped blit), `DEBUG_UI` (layer on black). Built on - `fullscreen_pass`, which is `present_blit`'s pipeline made target-agnostic (RTV-taking entry point, - scissor saved, alpha passed through); `present_blit` is deleted. -- egui draws after the composite into the same bound target (PASSTHROUGH) or into `ui[s]` after the - game's UI (BRIDGED), so it is on real and generated frames alike and in no FG input. -- If extraction is on and the compositor cannot run, UI is routed straight to the back buffer and the - reason logged; a broken compositor never yields a UI-less session silently. - -## UI extraction mechanics (D3D11 path) - -### Identification (plugin rule in `games/ac7/src/ui_rules.cpp`, mechanism in runtime) - -Registries (from `allocation_watch` hooks `CreateInputLayout` 11, `CreateVertexShader` 12, -`CreatePixelShader` 15, `CreateTexture2D` 5; records attached with `SetPrivateData` under a -ReScaleFrame GUID so pointer reuse cannot alias): -- **Slate layouts**: element signature `R32G32B32A32_FLOAT@0, R32G32_FLOAT@16, R32G32_FLOAT@24, - B8G8R8A8_UNORM@32, R16G16_UINT@36` (5 elements; accept a 6th per-instance `R32G32B32A32_FLOAT`), - match by format/offset/slot not semantic names; stride 40 checked at draw time from the tap's - vertex-buffer shadow. UE creates one layout object per (declaration, VS) — register every match. -- **Canvas layouts**: `FSimpleElementVertex` (`R32G32B32A32_FLOAT@0, R32G32_FLOAT@16, - R32G32B32A32_FLOAT@24, B8G8R8A8_UNORM@40`, stride 44) — verify against - `BatchedElements.cpp`/`FSimpleElementVertexDeclaration::InitRHI` before coding. -- **Widget render targets**: `B8G8R8A8_TYPELESS/UNORM`, RT|SRV, mip 1, array 1, sample 1, extent in - `RSF_UI_WIDGET_DRAW_SIZES` (default 1920x1080); cap 32, retained, evicted on address reuse. - Confirmed at draw time: a Slate-layout draw whose target is one of these is *widget - rasterisation* — never diverted, and the target is marked confirmed. -- **Shader hashes**: CRC32C of bytecode at creation; `RSF_UI_SHADER_FORCE_VS/PS`, - `RSF_UI_SHADER_SKIP_VS/PS` (hex lists) resolved to pointer sets at creation; per-draw cost is a - pointer-set compare. `PSSetShader` (context slot 9) shadowed like `VSSetShader`. - -Classifier `rsf_ac7_ui_classify(const rsf_draw_desc*) → rsf_draw_class {SCENE, UI, UI_MODULATE, -SKIP}` in order: (1) override table hit; (2) Slate/Canvas layout AND `rtv0` is the back buffer (or -the viewport RT) → `UI`; Slate layout into a widget RT → widget-raster, left alone; (3) indexed, -`element_count == 6`, one target, no UAVs, a widget RT in PS slot 0..3, target neither a widget RT -nor the back buffer, translucent blend → `UI` (`DestBlend == SRC_COLOR` → `UI_MODULATE`); (4) -`SCENE`. Runs on the render thread inside the draw hook, allocation-free, on shadowed data only. -`RSF_UI_TRACE=1` logs every decision for the first N draws per screen. - -**Decide once per shader, then cache the verdict by hash.** The failure this frame keeps repeating -is deciding from bindings on every draw: a running game leaves more bound than it reads, so a rule -of the form "the one that matches" eventually matches a second thing. Luma's UE path avoids it by -separating the two questions (`main.cpp:719-800`). A shader hash is first a *candidate*, from the -cheap facts alone. The first time a candidate actually draws, it is confirmed against a conjunction -of the resources bound at that moment — for Luma's TAA, two colour targets and a depth and a -velocity, all at the view's aspect ratio and no smaller than the view. The verdict is then written -into the per-hash record and every later draw of that shader is a pointer compare that never looks -at bindings again. We adopt the shape: `rsf_ac7_ui_classify` stays the pure per-draw rule, but its -result for a given shader is memoised on first confirmation, and a shader whose confirming draw -never appears stays a candidate rather than being promoted on a partial match. This is also what -makes the `UNKNOWN` count meaningful, since a stale binding can no longer graduate to `UI` merely by -being present in a later frame. - -### Divert primitive (in `frame_tap`, ABI 7) - -Pre-draw in all four draw hooks (`Draw`, `DrawIndexed`, `DrawInstanced`, `DrawIndexedInstanced`; -indirect/auto never diverted): prefilter by pointer compares (layout ∈ set, PS slot 0..3 ∈ widget -RTs, VS/PS ∈ force set) → build `rsf_draw_desc` from the shadow → `classify` → refuse with a counted -reason when `target_count != 1`, UAVs bound, target is the layer, no layer, widget-raster, or skip -hash. Save from the shadow only (`bound_view` — the actually bound RTV, so a plan-substituted target -restores to its promoted view; `geometry_depth`; viewports/scissors — the RS hooks shadow always, not -only while a plan is active; blend state/factor/mask from the new `OMSetBlendState` (35) shadow; -`OMSetDepthStencilState` (36) shadowed for the trace). Bind through the **originals** (never the -context's own methods): `original_set_targets(1, &layer_rtv, nullptr)`, viewport/scissor scaled per -producer (Slate/Canvas into the back buffer: 1.0; quads into a render-res target: `layer_extent / -target_extent` from the shadowed descriptor, never the plan's fixed scale), patched blend state when -the rule says so. First divert of the frame clears the layer if the ring didn't. Forward. Restore via -originals; count `draws_diverted[producer]`, `blend_states_patched`, `modulate_draws`, refusals by -reason; push a trace record for the first `RSF_UI_TRACE_DRAWS`. `ReentryGuard` becomes a depth -counter before any hook issues context calls. `rsf_frame_tap_geometry` gains an appended `diverted` -flag so `depth_replay` skips diverted draws. Status appends: `draws_diverted`, per-producer counts, -`divert_refused` + last reason, `blend_states_patched`, `modulate_draws`, `layer_clears`, -`widget_raster_draws`, `candidates_seen`. - -**Skip and copy, where retargeting is not safe.** Retargeting keeps the game's own draw and moves -where it lands, which is what the widget quads need. A draw that cannot be retargeted — several -targets, unordered access views, a producer whose destination we would have to reinterpret — can -still be handled by cancelling it and issuing our own: Luma's draw hook returns a `Skip` override -and, where it has already produced the result, copies its own texture into the target the game was -about to write (`main.cpp:800-825`). It is strictly more invasive, so it is the fallback and not the -default, but naming it now matters because the refusal counters above are otherwise a list of cases -with no route. `RSF_UI_DIVERT_MODE=retarget|skip` per producer, `retarget` default. - -### Reinsertion becomes `scene_promote` - -Built 26 September, after M2's runs reversed the premise (see the tracker). Tail = -`{composite, ui_targets[], chain_targets[], scene_color, reconstruction, render size}`. The -`ui_targets` are back, and named differently: each is a target the classifier saw a widget quad -drawn into, collected on every candidate draw, aged out after 120 presents without one, and never -found by a format or shape rule. `chain_targets` are the eight-bit render-resolution inputs of -composite draws that are neither the composite nor a layer (`0x308E2770` in the log), each -confirmed by a watch on the draw that writes it reading the composite, with the composite watched -again every 300 presents; an intermediate filled by copy is reported as never drawn into while -watched, and the `CopyResource` hook (context slot 47) that would cover it exists as a pass-through -for the vtable refresh and does not yet redirect. `depth_policy` stays (`RSF_REINSERT_DEPTH`); the -quads bind the scene's depth, so `depth_mismatches` climbs by design and the default drops the -depth at that binding. Restake keeps its 240-frame trigger and clears the chain with the composite; -the layers age out on their own; the relooks are gone; diversion is independent of the plan. - -## Game plugin: `games/ac7` - -- `frame_tail.cpp`: composite identification (input ≥ half the target's height, eight-bit family), - chain discovery, re-identification on render-size change or composite-watch drift. Relooks and the - hunt are gone. -- `screen_policy.cpp`: `rsf_screen_class` from three facts — video (`UManaComponent::Play/Stop` - hooks; `AUIManagerActor::ManaComponent 0x0F10`, `EManaComponentStatus::Playing == 5`; Ghidra task; - VIDEO never reported until located), graphics context (hook on `FUN_1405f4590`: 0/5 → FLIGHT, 1 → - MENU/BRIEFING/HANGAR until a fact separates them), no scene pass → LOADING. Maps - `RSF_POLICY_` rows (`sr:,fg:,ui:,scale:`) to `NO_SR/NO_FG`, extraction, and the per-context - render scale. Defaults: FLIGHT/REPLAY `sr:1,fg:1,ui:1,scale:50`; BRIEFING/HANGAR - `sr:1,fg:0,ui:1,scale:50`; MENU `sr:0,fg:0,ui:1,scale:100`; VIDEO/LOADING `sr:0,fg:0,ui:0,scale:100`. -- `graphics_settings.cpp`: `rsf_ac7_render_scale_apply(percent, context)` through - `FGraphicsSettingsManager` (`FUN_1405f5260` loads six per-context values via `FUN_1405f4590`; - FName globals `DAT_14356eec0..ef18`; `FUN_14015fb40` references `r.ScreenPercentage` at - `0x14265cbd8`), expected-byte guarded; jitter sequence length stays a console write; the cvar write - remains the announced fallback. Replaces `set_screen_percentage`/`keep_render_scale`. -- `patches.cpp`: the existing four sites as a table `{name, rva, expected[], replacement[]}` applied - by the carrier after decryption. `ui_shader_overrides.c` + `ReScaleFrame.ac7.ui.ini`. -- `plugin.cpp` implements the ABI 2 hooks table; `rendering_ready` stays 0 until SR runs through - `hooks.prepare/start` and is game-tested. - -## Game SDK ABI 2 - -`game_api.h` includes `game_frame.h`; `rsf_game_plugin_api` appends `rsf_game_hooks_api {prepare, -start, quiesce, stop, classify_draw, screen_policy, apply_render_scale, fill_camera}`; -`rsf_host_api {log, frame_begin, frame_phase, frame_flags, latency_marker, latency_sleep, -setting_get, patch_code}`; `rsf_draw_desc` (layout, shaders and hashes, rtv0 facts, blend and DS -state facts, topology/element/instance/stride, viewport, first 16 PS SRVs). Textures never cross the -SDK; the plugin says which draw is what and what the camera is. `tests/plugin_contract.cpp` keeps -`rendering_ready == 0`, adds hooks-table presence, a synthetic Slate-layout draw classifying `UI`, -`entry(1, ...) == ABI_MISMATCH`; `tests/sdk_c_header.c` compiles both headers as C. - -## Configuration and overlay - -New keys (all read once at attach, env over ini, unknown keys logged once; every mechanism has an -off switch): `RSF_UI_CLASSIFY`, `RSF_UI_EXTRACT` (0 until game-tested), `RSF_UI_DIVERT_SLATE/WIDGET/ -CANVAS`, `RSF_UI_DEPTH`, `RSF_UI_BLEND_PATCH`, `RSF_UI_CLEAR_ORIGINAL`, `RSF_UI_WIDGET_DRAW_SIZES`, -`RSF_UI_TRACE`, `RSF_UI_TRACE_DRAWS`, `RSF_UI_COMPOSITE`, `RSF_UI_HUDLESS`, `RSF_UI_ALPHA_CHECK(_FRAMES)`, -`RSF_UI_SHADER_FORCE_VS/PS`, `RSF_UI_SHADER_SKIP_VS/PS`, `RSF_UI_SHADER_OVERRIDES`; `RSF_POLICY_MENU/ -BRIEFING/HANGAR/FLIGHT/REPLAY/VIDEO/LOADING`; `RSF_SCREEN_PERCENTAGE_PATCH`, `RSF_VIDEO_DETECT`; -`RSF_PRESENTATION auto|d3d11|bridge`, `RSF_BRIDGE_RING`, `RSF_BRIDGE_LIFETIME`; `RSF_SR_VENDOR`, -`RSF_SR_QUALITY` (alias `RSF_DLSS_QUALITY`), `RSF_SR_MIP_BIAS`, `RSF_SR_DYNAMIC_RESOLUTION`, -`RSF_VIEW_READ`, `RSF_UI_DIVERT_MODE`, `RSF_FG`, `RSF_FG_VENDOR`, `RSF_FG_MULTIPLIER`, -`RSF_LATENCY`; `RSF_SL_BIN` (alias `RSF_STREAMLINE_BIN`), `RSF_FFX_BIN`, `RSF_XESS_BIN`; -`RSF_DEPTH_POLICY`. Removed: `RSF_UI_HUNT_*`, `RSF_DLSS_OUTPUT_*`. The 13 undocumented existing keys -get documented. `docs/review.md` finding 5 closes with `tests/config_parse.cpp` (the parser already -does hex and honest zero; the docs are stale). - -Overlay ABI 3 (append-only, `abi.rs` offset tests pin `size_of` and the first appended offset — -note `rsf_overlay_stats` is 124 bytes of fields padded to 128, so the first append lands at 124): -stats gain `sr_vendor_effective, sr_route, fg_vendor_effective, fg_multiplier_requested/effective, -frames_generated, ui_extraction_on, ui_draws_diverted, ui_draws_modulate, ui_layer_generation, -hudless_available, bridge_state, present_index, restart_required, screen_class, -latency_mode_effective, fg_last_vendor_result`; intent gains `sr_vendor, fg_vendor, fg_multiplier, -ui_extraction, depth_policy, composite_mode` (+ `_changed`); the existing `quality`/`enabled` intents -get wired. The panel shows requested and effective side by side; nothing is a rate. - -## Build, vendoring, CI - -`vendor/fidelityfx/{include, bin/x64}` and `vendor/xess/{inc, bin/x64}` beside `vendor/streamline` -(gitignored); `RSF_HAVE_FFX`/`RSF_HAVE_XESS` discovery mirroring the DLSS target (cache path, `EXISTS` -probe, `SYSTEM`/`/external:W0` includes, `NOT_COMPILED` without headers). All three runtimes loaded -by absolute path (`LOAD_FAILED` with path, never a loader error). `rsf_presentation` and the backends -link `d3d12`; barrier helpers in `d3d12_util.h` (no `d3dx12.h`). CI: a two-leg matrix on -`windows-2022` — `vendor: none` and `vendor: headers` (pinned sparse clones of Streamline 2.12.0, -FidelityFX-SDK, intel/xess into `vendor/`) so every `RSF_HAVE_*` branch compiles; `cargo test ---workspace --locked` added to `eng/verify.ps1` and CI (review finding 8); device fixtures on WARP -with the debug layer (any `D3D11_MESSAGE_SEVERITY_ERROR` fails). `docs/dependencies.md` gains -FidelityFX (MIT headers/DLLs, notice file) and XeSS (Intel Simplified Software License, binary -redistribution terms to confirm) rows and the DLSS-G/PCL/Reflex DLLs; note that the Community -Shaders bridges were studied, not copied. - -## Milestones (each ends deployed to the AC7 install and judged by one run of the standard route) - -Standard route: title → main menu → hangar → briefing (F8 at the menu, F9, F6 at the briefing, F10 -once) → mission (takeoff, cockpit view, HUD view, F10 in flight) → pause → results/replay → back to -menu through a mission load → one video. Deploy topic `.local/m-/` with backups and -`deployment.json`; `eng/deploy-ac7.sh` (refuses while the game runs, hashes, records, never -overwrites the user's ini, `--rollback `); `eng/collect-run.sh` + `tools/summarize-run.py` -extract the pass/fail lines into the research note. Every milestone ships the attach banner (`rsf: -build +g[-dirty]