Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d28fba96f5 |
No files matched your search
@@ -19,6 +19,31 @@ GitHub release body, so a missing section will mean an empty release note.
|
||||
|
||||
### Added
|
||||
|
||||
- **The SDK 2.x loader is the fourth AMD row, because three loader-shipping titles read silent
|
||||
behind the leaf-only build.** The owner's run on #110 (thirteen captures, nine titles, one launch
|
||||
each) landed rows A1–A3 exactly as pre-committed — Lies of P `Fsr3` / `FsrFg` / `118.98 → 238.02
|
||||
(×2)` with the two per-frame counts agreeing at 1.00, `none` by count with frame generation off;
|
||||
Hell Is Us `FSR (3.1 or 4 …)` / `FsrFg` / ×2 — and produced a row the table lacked: Dying Light:
|
||||
The Beast at FSR + FSR frame generation, KCD2 at FSR and Black Myth: Wukong at FSR each dispatched
|
||||
**zero** times at any leaf export while the leaves sat in the census. The game calls the loader's
|
||||
export, and the signed loader reaches its providers through an object rather than the leaves'
|
||||
`ffxDispatch`, so "five identical export tables leave it no other route" was wrong about the
|
||||
loader. `amd_fidelityfx_loader_dx12.dll` is now an inventory row alongside the three leaves, the
|
||||
`static_assert` that refused it asserts the opposite with the measurement in its message, the
|
||||
loader stub forwards through the leaves' FrameLedger-named *direct* entry (never their export) to
|
||||
model what was measured, `--probe-ffx-resolve` asserts the forward touched no leaf export, and a
|
||||
third harness topology (`--ffx-topology ue`: the two effect DLLs called directly, no loader) keeps
|
||||
the leaf detours exercised now that the loader case never reaches them. The K = 1 control with
|
||||
all four modules hooked, and the consumer's `frames/upscale-drained`, are what would read 2× for a
|
||||
loader that re-entered an export. Also from the run: Expedition 33 at FSR upscaling under DLSS
|
||||
frame generation ×3 printed `×2.97`, *technology not identified*, from the UPSCALE count; Cyberpunk
|
||||
at FSR 3 generates through the 1.1.x monolith (`FsrFg`) while upscaling through the deferred FSR
|
||||
3.0 route; and **Rune Factory: Guardians of Azuma is HANDOFF 7b's statically linked title** — the
|
||||
monolith ships beside it and is never loaded, yet the Streamline token count still read
|
||||
`59.99 → 119.95 (×2 FG)`, so the ceiling for such a title is the trio with the vendor missing, not
|
||||
Presented FPS alone. Owed: the three loader titles against §H11 row R6. `20_OPEN_QUESTIONS` §H11
|
||||
carries the run table; `HANDOFF` 7b/7c and `spike-notes` §9 carry the corrections.
|
||||
|
||||
- **AMD identity is measured through the ffx-api leaves, and the first non-NVIDIA vendor
|
||||
reaches the record.** HANDOFF item 7c. Lies of P at FSR 3.1 + frame generation printed
|
||||
`upscaler: N/A … frame generation: N/A` plus a census WARNING because the three AMD modules
|
||||
|
||||
+4
-2
@@ -246,8 +246,10 @@ F_app = Σ fgEvaluations (APPLICATION frames, counted at the
|
||||
> frame-generation **PREPARE** once per application frame carrying `frameID` (documented by the
|
||||
> vendor as *"must increment by exactly one for each frame"*), and a **FRAMEGENERATION** dispatch
|
||||
> per generated batch, sent back through the same export from the title's own callback. The Overlay
|
||||
> detours `ffxDispatch` on the three modules that actually run the effects — the SDK 1.1.x monolith
|
||||
> and the two SDK 2.x effect DLLs, never the 2.x loader that forwards to them — and:
|
||||
> detours `ffxDispatch` on the four modules a game calls — the SDK 1.1.x monolith, the two SDK 2.x
|
||||
> effect DLLs, **and the SDK 2.x loader**, which turned out to be the entry on loader-shipping titles
|
||||
> with the effect DLLs' exports silent behind it (measured the evening the leaf-only build shipped;
|
||||
> §H11 row R6) — and:
|
||||
>
|
||||
> - `fgEvaluations` is the number of **new** `frameID`s the PREPARE dispatches carried between two
|
||||
> presents — this vendor's `slGetNewFrameToken`, keyed the same way (a monotone maximum, so a
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ Targets:
|
||||
- `fl-probe-hookprofile` → build-profile probes for `/guard:cf` and `-D_HAS_EXCEPTIONS=0` (`20_OPEN_QUESTIONS` §H1/§H3)
|
||||
- `fl-probe-guard` → measures the Windows APIs the guard is built on, unelevated (`spike-notes.md` §1). Not the guard, and takes no injection rights.
|
||||
- `fl_stub_sl_interposer` → `sl.interposer.dll`, and `fl_stub_sl_common` → `sl.common.dll` (`src/native/tools/vendor-stubs/`). **Fixtures, never shipped**, built under `FL_BUILD_TOOLS`; nothing `12_BUILD` publishes references them. They export the **measured** vendor names from `docs/vendor-exports.json` so the Overlay's symbol resolution is observable, and the second is a **decoy** exporting the same name from a different module — without it, "we resolve module-scoped" is a property no test can falsify. Their **output filenames are the vendor's and their version blocks are ours**: `fl_add_version_resource` takes the real filename so a file called `sl.interposer.dll` in our build tree still says plainly that it is FrameLedger's, which `19_SAFETY` requires of everything we build.
|
||||
- `fl_stub_ffx_dx12` → `amd_fidelityfx_dx12.dll`, `fl_stub_ffx_upscaler` → `amd_fidelityfx_upscaler_dx12.dll`, `fl_stub_ffx_fg` → `amd_fidelityfx_framegeneration_dx12.dll` — the three AMD **leaves** — and `fl_stub_ffx_loader` → `amd_fidelityfx_loader_dx12.dll`, a **forwarding decoy** bound to the two 2.x leaves so `--hold-presenting-ffx` can push every dispatch through a loader the Overlay must not hook (2026-09-04). Same rules as the Streamline stubs: fixtures, never shipped, vendor filenames with our version blocks.
|
||||
- `fl_stub_ffx_dx12` → `amd_fidelityfx_dx12.dll`, `fl_stub_ffx_upscaler` → `amd_fidelityfx_upscaler_dx12.dll`, `fl_stub_ffx_fg` → `amd_fidelityfx_framegeneration_dx12.dll` — the three AMD **leaves** — and `fl_stub_ffx_loader` → `amd_fidelityfx_loader_dx12.dll`, a **forwarding stand-in** bound to the two 2.x leaves through their FrameLedger-named *direct* entry — the way the real loader was measured to bypass the leaves' exports — so `--hold-presenting-ffx` can push every dispatch through a loader that is hooked along with the leaves and prove the count reads 1× (2026-09-04). Same rules as the Streamline stubs: fixtures, never shipped, vendor filenames with our version blocks.
|
||||
- **`fl_fidelityfx_headers`** → an INTERFACE target over the five vendored FidelityFX ffx-api headers (`src/native/third_party/fidelityfx/`, tag v2.3.0, MIT by exception). Three include directories because upstream's headers include each other by relative path; include directories only and nothing to link — no `.lib` is vendored — and `hookinventory-check` Pass C reads the Overlay's export table because `ffx_api.h` declares its entry points `__declspec(dllexport)` unconditionally.
|
||||
- **`fl_streamline_headers`** → an INTERFACE target over the vendored MIT Streamline headers (`src/native/third_party/streamline/`). Include directories only, **never linked**: `SL_API` entry points are `extern "C"` imports, and linking one would make `sl.interposer.dll` a load-time dependency of `FrameLedger.Overlay.dll`, which would stop the Overlay loading in every game that ships no Streamline — in the loader, before any of our code runs, with no message anywhere.
|
||||
|
||||
|
||||
@@ -83,14 +83,14 @@ Prefer hooking the **vtable entry** over inline-patching for COM methods (cleane
|
||||
|
||||
Every hook must be listed here with a purpose. Anything not on this list is not allowed to exist (`19_SAFETY` review checklist).
|
||||
|
||||
> **This table is a SPECIFICATION. As of 2026-09-04 the Overlay installs ELEVEN DETOURS —
|
||||
> the eight of 2026-09-03 plus three `ffxDispatch` trampolines, one per AMD leaf — and the
|
||||
> FidelityFX row below is the ninth ✅.** The counts differed until 2026-09-03, because a
|
||||
> **This table is a SPECIFICATION. As of 2026-09-04 the Overlay installs TWELVE DETOURS —
|
||||
> the eight of 2026-09-03 plus four `ffxDispatch` trampolines, one per AMD module a game
|
||||
> calls — and the FidelityFX row below is the ninth ✅.** The counts differed until 2026-09-03, because a
|
||||
> row is a *capability* and a detour is a *patch*, and the FG-count row rode on the
|
||||
> evaluate detour; it has its own now, `sl.interposer.dll!slGetNewFrameToken`. The AMD row
|
||||
> is the opposite shape — **one row-family, three modules, three patches from one
|
||||
> template body** — because the three leaves export the same five names and each must be
|
||||
> patched at its own address; and its family is published only once **every leaf the
|
||||
> is the opposite shape — **one row-family, four modules, four patches from one
|
||||
> template body** — because the three leaves and the SDK 2.x loader export the same five
|
||||
> names and each must be patched at its own address; and its family is published only once **every leaf the
|
||||
> process has loaded** is patched, which is `PublishHookFamily`'s own rule and was measured
|
||||
> mattering before it was applied (a fixture caught the window between the two 2.x leaves'
|
||||
> patches, in which UPSCALE dispatches were counted and the PREPARE and FRAMEGENERATION
|
||||
@@ -150,7 +150,7 @@ Every hook must be listed here with a purpose. Anything not on this list is not
|
||||
| NGX parameter accessors (`NVSDK_NGX_Parameter_SetI/GetI/SetUI`) — **exported by `sl.common.dll` only; see below** | `Width`/`Height` (render) vs `OutWidth`/`OutHeight` (output), `PerfQualityValue` (quality preset), sharpness |
|
||||
| ✅ Streamline: `slEvaluateFeature` · ⏳ `slInit`, `slSetFeatureLoaded`, `slSetConstants`, `slGetFeatureRequirements` | Feature set actually active when the game goes through SL rather than NGX directly (`kFeatureDLSS`, `DLSS_G`, `DLSS_RR`, `Reflex`, `NIS`). **Built 2026-08-09**, identity only: one MinHook detour on `sl.interposer.dll!slEvaluateFeature`, resolved **module-scoped** and installed lazily by the watchdog. Sets `FL_MEASURED_UPSCALER` + `FL_HOOK_UPSCALER_IDENTITY`; decodes `kFeatureDLSS`/`kFeatureNIS` and reports `FL_UPSCALER_UNKNOWN` for anything else. **Never `FL_UPSCALER_NONE`** — a Streamline-only writer cannot see FFX, XeSS or NGX-direct, and `NONE` is the only one of the three states that may be aggregated as a negative |
|
||||
| ✅ Streamline: `slSetTag` | The **global** resource tags, where a title states the size of the buffer it is upscaling *from*: `kBufferTypeScalingInputColor`'s extent → `renderW/H`. **Built 2026-08-15** (`FL_HOOK_UPSCALER_PARAMS`), and it is an ALTERNATIVE to the local tags in `slEvaluateFeature`'s `inputs`, not a layer over them — `sl_core_api.h:258` says global and local tags "do NOT interact", so a title using one yields nothing from the other and both are read. Published only on a frame where an evaluation was also seen, because a tag is viewport state that outlives any one frame. This row was MISSING from this table while the hook shipped, which is the gap the banner above now names |
|
||||
| ✅ **FidelityFX ffx-api: `ffxDispatch` on the three LEAVES** — `amd_fidelityfx_dx12.dll` (SDK 1.1.x monolith), `amd_fidelityfx_upscaler_dx12.dll`, `amd_fidelityfx_framegeneration_dx12.dll` — **never `amd_fidelityfx_loader_dx12.dll`** · ⏳ FSR 3.0 host route `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale` / `ffxFsr3DispatchFrameGeneration` · ~~`ffxFsr2ContextCreate`~~ · ~~`ffxCreateContext`~~ | **Built 2026-09-04** (`HANDOFF` item 7c). One observer behind three trampolines reads the DESCRIPTOR the title passed — head type first, body only after the type matched a constant from the vendored MIT headers (`third_party/fidelityfx/`, tag v2.3.0): **UPSCALE** → identity (`FSR3` from the monolith, `FSR_UNVERSIONED` from the 2.x upscaler DLL, which hosts FSR 3.1 and FSR 4 behind one type) + `renderSize` → `renderW/H` (quality and sharpness `0xFF`: the dispatch carries neither) + one COUNT; **PREPARE / PREPARE_V2** → `frameID` counted on a *new* index only — this vendor's `slGetNewFrameToken`, the `fgEvaluations` producer once a title has ever prepared, with the UPSCALE count as the fallback for a title that never does; **FRAMEGENERATION** → `fgMode = FSR_FG` on that present. Rule 4: the argument of the API we hooked, never `context`, `pNext`, a command list or a resource. **Why the leaves and not the loader:** all four modules export only the five ffx-api names, so the loader can reach an effect DLL only through the effect DLL's own export; a UE5 title ships the two leaves with no loader at all; hooking loader and leaf counts every dispatch twice. `ffxCreateContext` is deliberately NOT a row — nothing it carries fills a field the dispatch does not, and its honest family would collide with `slEvaluateFeature`'s under the installer's equality binding. The family is compound (`IDENTITY \| PARAMS \| FG_EVALUATIONS`), pinned by `static_assert`s that also bind the leaf table to the rows both ways and refuse the loader as a row. Streamline keeps precedence for the count once it has ever issued a token, so every §S31-validated title is byte-identical. Second count: the consumer prints `frames/upscale-drained`, the AMD `tokens/batch`. **FSR 3.0** (Cyberpunk's `ffx_fsr3_x64.dll`, named exports) is its own later PR — ten host headers from tag v1.1.4, and one title here to test on |
|
||||
| ✅ **FidelityFX ffx-api: `ffxDispatch` on the FOUR modules a game calls** — `amd_fidelityfx_dx12.dll` (SDK 1.1.x monolith), `amd_fidelityfx_upscaler_dx12.dll`, `amd_fidelityfx_framegeneration_dx12.dll`, **and `amd_fidelityfx_loader_dx12.dll`** (added the evening of 2026-09-04: three loader-shipping titles at FSR produced zero dispatches at any leaf export, so the loader is where their calls arrive) · ⏳ FSR 3.0 host route `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale` / `ffxFsr3DispatchFrameGeneration` · ~~`ffxFsr2ContextCreate`~~ · ~~`ffxCreateContext`~~ | **Built 2026-09-04** (`HANDOFF` item 7c). One observer behind three trampolines reads the DESCRIPTOR the title passed — head type first, body only after the type matched a constant from the vendored MIT headers (`third_party/fidelityfx/`, tag v2.3.0): **UPSCALE** → identity (`FSR3` from the monolith, `FSR_UNVERSIONED` from the 2.x upscaler DLL, which hosts FSR 3.1 and FSR 4 behind one type) + `renderSize` → `renderW/H` (quality and sharpness `0xFF`: the dispatch carries neither) + one COUNT; **PREPARE / PREPARE_V2** → `frameID` counted on a *new* index only — this vendor's `slGetNewFrameToken`, the `fgEvaluations` producer once a title has ever prepared, with the UPSCALE count as the fallback for a title that never does; **FRAMEGENERATION** → `fgMode = FSR_FG` on that present. Rule 4: the argument of the API we hooked, never `context`, `pNext`, a command list or a resource. **Why all four:** a UE5 title ships the two leaves with no loader and calls their exports; a loader-shipping title calls the loader's export and the signed loader reaches its providers through an object, not the leaves' exports (measured: Dying Light: The Beast, KCD2, Wukong). The morning's "never the loader" rested on the export tables alone and was reversed by the run. What guards against a loader that DID re-enter a leaf's export is the K = 1 control with all four hooked and the consumer's `frames/upscale-drained`, both of which read 2× in that case. `ffxCreateContext` is deliberately NOT a row — nothing it carries fills a field the dispatch does not, and its honest family would collide with `slEvaluateFeature`'s under the installer's equality binding. The family is compound (`IDENTITY \| PARAMS \| FG_EVALUATIONS`), pinned by `static_assert`s that also bind the leaf table to the rows both ways and refuse the loader as a row. Streamline keeps precedence for the count once it has ever issued a token, so every §S31-validated title is byte-identical. Second count: the consumer prints `frames/upscale-drained`, the AMD `tokens/batch`. **FSR 3.0** (Cyberpunk's `ffx_fsr3_x64.dll`, named exports) is its own later PR — ten host headers from tag v1.1.4, and one title here to test on |
|
||||
| XeSS: `xessD3D12CreateContext`, `xessD3D12Init`, `xessD3D12Execute` | `outputResolution`, `qualitySetting`, XeSS version; `xess_fg` variants for XeFG |
|
||||
| ✅ **Application frames per present** (`fgEvaluations`) — **`sl.interposer.dll!slGetNewFrameToken` since 2026-09-03** | Native vs Displayed frame counts at Tier 1 — see `03_METRICS` §Frame Generation. **The producer is the frame-token export**: Streamline hands a title one token per application frame and the title must ask; the detour counts distinct tokens between two presents (pointer changes, nothing dereferenced), `FL_HOOK_FG_EVALUATIONS` is its family, and it installs on every Streamline 2 title including the ones that evaluate nothing through `slEvaluateFeature`. Rule 4: the out-parameter of an API we hooked. Premise and its gate in `03_METRICS`; pre-committed table in `20_OPEN_QUESTIONS` §S31. *The row as it stood before:* ~~NGX/SL/FFX/XeSS FG feature evaluations per present. **Built 2026-08-15 for Streamline, and MEASURED TO YIELD NOTHING ON THAT ROUTE**~~ — `slEvaluateFeature(kFeatureDLSS_G)` is never called by Cyberpunk 2077 (0 across ~14,000 batches, four FG settings), so this row installs, is honest, and counts zero; see `docs/HANDOFF.md` item 3. Built on the detour that was already there: `kFeatureDLSS_G` contributes to a saturating COUNT in the same word the feature bits live in (`fl_sl_seen.h`) rather than to a bit, because a bit collapses several evaluations between two presents into one — and under multi-frame generation that is the common case, not the edge. The row's family is therefore compound (`FL_HOOK_UPSCALER_IDENTITY \| FL_HOOK_FG_EVALUATIONS`), pinned by a `static_assert` because `hookinventory-check` reads that column as an opaque identifier. **Counts EVALUATIONS, not generated frames** — the 2026-08-14 owner ruling; the multiplier lives in `sl::DLSSGOptions`, which is only reachable by the route §2b refused. ~~Non-NVIDIA FG vendors are **deferred with a written rationale**: `amd_fidelityfx_framegeneration_dx12.dll` 3.1.5 exports only the five generic `ffx*` entry points, identical to five sibling modules, so identity is in the arguments and we have no headers~~ — **AMD has a producer since 2026-09-04** (the FidelityFX row above: the PREPARE dispatch's `frameID`, or the UPSCALE count on a title that never prepares, feeds `fgEvaluations` when Streamline has never issued a token); Intel stays at the census (`20_OPEN_QUESTIONS` §Scope decisions, by licence); the FSR 3.0 host DLLs are deferred to their own PR |
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ Rules for this document:
|
||||
| — | **No `v1 → v2` migration** | Nothing shipped, so no such database exists. `0001_init.sql` creates the current schema |
|
||||
| — | ~~**Multi-process titles are refused as `TargetAmbiguous` in v1**~~ — **the Chromium case is RESOLVED the same day (2026-09-03), by the vendor's own label** | Chromium-based runtimes — NW.js, Electron, RPG Maker MV/MZ, a large share of the VN catalogue — run several processes from ONE image path (browser, renderer, GPU), and *Flower in Us* refused as `TargetAmbiguous`. The presenting process is Chromium's GPU process, which owns no window, so "the one with the window" and "the parent" were both wrong picks. **What resolves it:** Chromium marks that process with `--type=gpu-process` on its own command line. `TargetResolver` now reads each candidate's command line through `NtQueryInformationProcess(ProcessCommandLineInformation)` — **served by the kernel, no `ReadProcessMemory`, no PEB walk, `PROCESS_QUERY_LIMITED_INFORMATION` only**, which is the rule-4 line `HeldProcessHandle` already draws — and resolves only when **exactly one** readable candidate carries the flag as a whole argument. Two GPU processes (two instances), none, or any unreadable candidate still refuse. §S27 is untouched: consent is keyed on the path, every candidate is that path, the guard scans the pid chosen, and `--pid` stays forbidden. **Measured the same evening, and the first rule did not fire:** *Flower in Us* runs **six** processes — browser, `crashpad-handler`, three `utility`, `renderer` — and **no `--type=gpu-process` at all**. NW.js runs the GPU **in-process, in the browser**, which is the one process Chromium leaves untyped. Second rule added: exactly one untyped candidate, every other candidate typed, no GPU process ⇒ the browser is the target; two untyped candidates are two instances and refuse. The refusal line now prints the tree (`browser=1, renderer=1, utility=3, …`) so the next unknown shape is data rather than a bare `TargetAmbiguous`. **Still unmeasured:** whether the Overlay loads and sees presents inside that browser process |
|
||||
| — | **Intel XeSS / XeFG identity is closed at the census — no hook on any `libxess*.dll` export** (decided 2026-09-04, delegated by the owner) | The XeSS SDK failed `18_GPU_VENDOR_APIS` §Checklist (Intel Simplified Software License: binary-only grant, no reverse engineering, termination; headers forbid copying), so no declaration may be vendored or re-declared. The signature-free counter that seemed to survive that — an assembly thunk on a named export — still inline-patches Intel's code inside the game process, which the same licence forbids as *modification*; it would also be the only entry outside `FL_HOOK_GUARD` and a second build language, for identity alone. An Intel title therefore reports upscaler `NOT_REPORTED` and, with `libxess_fg.dll` in the census, Presented FPS under rule 6's *"MAY include generated frames"* qualifier — honest, and the same answer NGX-direct got. **Reversal condition:** Intel relicenses the headers so the checklist clears; then §H11's AMD route applies to Intel verbatim |
|
||||
| — | **A title whose upscaler or frame generation is compiled into its executable is Presented FPS + the census's qualifier, in attach mode, and that is the ceiling** (recorded 2026-09-04) | No module for the census, no export for the inventory: nothing by name. What survives static linking is behaviour on interfaces we hook — the FSR3 frame-generation proxy swapchain at *creation* (launch mode only, §S1 deferred) and queue-side cadence with no vendor name on it (rung 3 at best, and without an application-frame count). The report's qualifier already names the hole ("statically linked FSR3-FG … outside what this can see"). **No installed title has this shape** — every FSR title here ships its DLLs — so this row is a boundary, not a deferral of work: find such a title before costing anything (`HANDOFF` item 7b) |
|
||||
| — | **A title whose upscaler or frame generation is compiled into its executable is Presented FPS + the census's qualifier, in attach mode, and that is the ceiling for IDENTITY** (recorded 2026-09-04; **one such title found the same evening**) | No module for the census, no export for the inventory: nothing by name. What survives static linking is behaviour on interfaces we hook — the FSR3 frame-generation proxy swapchain at *creation* (launch mode only, §S1 deferred) and queue-side cadence with no vendor name on it. ~~**No installed title has this shape**~~ — **Rune Factory: Guardians of Azuma has it**: `amd_fidelityfx_dx12.dll` ships beside the executable and is never loaded (the census has no AMD module), FSR frame generation is on, and the report read `59.99 → 119.95 (×2 FG)`, *technology not identified* — because on a UE5 title **Streamline's frame token is requested whether or not NVIDIA's features are the ones running**, so the application-frame COUNT survives static linking even though the identity cannot. The ceiling is therefore lower than this row first said: the trio with an unidentified technology, not Presented FPS alone (§H11's run table). Identity for such a title stays out of reach by name |
|
||||
| — | ~~**Tier 2 requires an elevated Agent**~~ | **CLOSED 2026-08-28 by the two-rung ladder.** The requirement came from Windows restricting ETW trace sessions; there is no ETW rung, so **no capture tier needs elevation**. Elevation is optional everywhere and buys exactly two things (CPU temperatures via PawnIO, attaching to elevated targets — ADR-9). An unelevated Agent whose Tier-1 attempt fails lands on Tier 2, which is what every unhooked session lands on regardless of privilege |
|
||||
|
||||
---
|
||||
@@ -94,7 +94,7 @@ or it becomes the next stale status claim this file exists to record.
|
||||
| **S29** | 🔴 **open, new 2026-08-05 — five ✅ and two ◐, counted off the glyphs below on 2026-08-20** | (a) ◐ **CORRECTED**: the honesty assertion *is* in the merge gate, natively (`fl_guard`, 20.58 s on CI); only the **managed** drain is ungated, and §S19(b) is **not** a prerequisite of the feature hooks — the original claim was wrong and had been used to re-order the work. **Sharpened 2026-08-06:** fixing §S19(b) alone would still gate nothing, because `build.ps1`'s `-SkipIntegration` applies `--filter 'Category!=Integration'` and excludes the class *before* the guard is ever asked. Two independent mechanisms produce one absence, and `ci.yml` must drop the switch too; (b) ✅ `fl_vtable_indices` now pins the Overlay's indices through a shared header; (c) ✅ **closed 2026-08-06 by deleting `ShouldUnhookAsync`** — zero production callers, strictly weaker than `ScanOnceAsync`, and inverted in polarity; the gate's public instance surface is now pinned to `{StartAsync}`; (d) ◐ `vklayer-blastradius` case 3 is now an assertion, but the script still runs only by hand; (e) ✅ **closed 2026-08-06 host-side**, with a held process handle and a classifier that takes no elapsed-time parameter, so a frozen `writeIndex` can never end a session; (f) ✅ **closed 2026-08-20**: the normative contradiction between CLAUDE.md rule 7 and `03_METRICS` about inline RayQuery is settled the way the entry proposed — AS-build activity proves ray tracing is happening, *naming the technique* is what needs a DXIL scan — and rule 7 is amended in the PR that wrote the hooks. Its second half closes with it: `FL_MEASURED_RT` now has a producer (both command-list detours, installed off the game's own device), so all three conjuncts of the `No` branch are live and **`Yes` and `No` are both reachable for the first time**, proved by injection in both directions; (g) ✅ the present-only writer claimed `FL_MEASURED_OUTPUT_RES` unconditionally, including on records with no size |
|
||||
| **S30** | ✅ **closed 2026-08-15** | Answered on the title that raised it: with Ray Reconstruction on, Cyberpunk 2077 evaluates `kFeatureDLSS_RR` on every application frame and `kFeatureDLSS` **not once**, so RR was doing the upscaling and the decode had no arm for it. Evidence rather than inference: `renderW/H` are published only on a frame that drained an evaluation and read 1485×835 = 0.58 × 2560×1440, so the scaling-input tag arrives ON the RR evaluation. Two further defects fell out — the pre-committed decision table had two holes, and the fix contaminated the census that found it (it derived the id from the decoded byte) |
|
||||
| **S31** | ✅ **resolved 2026-09-04 — row P1, and `tokens/batch = 1.00`** | Is a drained Streamline batch an application frame? **Yes.** The `slGetNewFrameToken` count (#103, #105) reads 1.00 / 2.99 / 3.99 against Cyberpunk's own off / ×3 / ×4 and 4.00 on Hell Is Us, and on every leg with batches the two counts agree to the frame. Two independent per-frame API counts are the oracle four instruments could not be. `fg_factor` is published; `none` is reachable by counting. *(The row as it stood while open:)* ◐ **row P2, 2026-08-27 — the ORACLE is retired, the QUESTION is not** | Is a drained Streamline batch an application frame? The PresentMon 2.x `FrameType` test, with its decision table pre-committed BEFORE the run and `tools/frametype-oracle.ps1` producing the input as two dimensionless ratios. **Two obstacles measured before it could be run**: the console binary will not start a trace session unelevated on the dev box (exit 6; the account is in neither Administrators nor Performance Log Users, and the running shared service does not help), and `--track_frame_type` is a **beta** option whose own help says it needs application or driver instrumentation of the Intel-PresentMon provider — so it may be as unavailable as `fl-baseline-probe` proved to be. Two of the table's six rows retire it outright. Blocks HANDOFF item 3's producer decision |
|
||||
| **H11** | ◐ **AMD ffx-api BUILT 2026-09-04; Intel closed at the census by licence; FSR 3.0 host route deferred to its own PR** | XeFG and FSR3-FG identity. The AMD half is measured: the three ffx-api leaves are hooked (never the loader), the vendored MIT headers (tag v2.3.0) decode the dispatch descriptor, and the pre-committed acceptance table below awaits the owner's three launches. Intel's SDK failed the licence checklist, so XeSS/XeFG stay at the census (§Scope decisions). `ffx_fsr3_x64.dll` (FSR 3.0, Cyberpunk only here) needs ten host headers from tag v1.1.4 and is deferred with that costing written |
|
||||
| **H11** | ◐ **AMD ffx-api BUILT and RUN 2026-09-04 (A1–A3 accepted; the loader row added the same evening after three loader titles read silent); Intel closed at the census by licence; FSR 3.0 host route deferred to its own PR** | XeFG and FSR3-FG identity. The AMD half is measured on nine titles: the three ffx-api leaves AND the SDK 2.x loader are hooked (the loader turned out to be the game's entry on loader-shipping titles, with the leaves silent behind it), the vendored MIT headers (tag v2.3.0) decode the dispatch descriptor, and rows A1–A3 landed as pre-committed. Owed: the three loader titles again, against row R6. Intel's SDK failed the licence checklist, so XeSS/XeFG stay at the census (§Scope decisions). `ffx_fsr3_x64.dll` (FSR 3.0, Cyberpunk only here) needs ten host headers from tag v1.1.4 and is deferred with that costing written |
|
||||
|
||||
~~**Six items are ❓ and one is 🚫.**~~ **Recounted 2026-08-05: TWELVE items block
|
||||
exit criterion 2, not seven, and the undercount came from reading only the ❓ rows.**
|
||||
@@ -3332,6 +3332,55 @@ load-bearing rather than stylistic.
|
||||
> | **R4** | `frames/upscale-drained ≈ 2.00` with FG off: two upscale contexts per frame, or a doubled count on a title that never prepares | investigate before publishing |
|
||||
> | **R5** | UE5 with both vendors loaded and tokens ≠ prepares per frame: Streamline wins by the latch; the census line prints the disagreement | record; revisit precedence |
|
||||
>
|
||||
|
||||
> **RUN, 2026-09-04 evening — thirteen captures across nine titles, one launch each (`E:\frameledger-runs\2026-09-04\`).
|
||||
> Rows A1–A3 accepted; one row the table did not have was found, and it reversed a design decision the same day.**
|
||||
>
|
||||
> | Title / setting | Shape | `upscaler` | `frame generation` | Trio / FPS | `frames/upscale-drained` |
|
||||
> |---|---|---|---|---|---|
|
||||
> | **Lies of P**, FSR + FG (A1) | monolith | `Fsr3`, render 854×480 | `FsrFg` | `118.98 → 238.02 (×2 FG)` | **1.00**, fg-dispatch/frame 1.00 |
|
||||
> | **Lies of P**, FSR, FG off (A2) | monolith | `Fsr3` | **`none`** by count (3506 frames / 3504 presents) | `FPS: 59.56` | 1.00 |
|
||||
> | **Hell Is Us**, FSR + FG (A3) | UE5, two leaves, no loader | `FSR (3.1 or 4 …)`, 1707×961 | `FsrFg` | `85.7 → 171.35 (×2)` | 1.00, fg-dispatch/frame 1.00 |
|
||||
> | **Hell Is Us**, FSR, FG off | same | same | `none` | `FPS: 104.18` | 1.00 |
|
||||
> | **Expedition 33**, FSR upscale + **DLSS frame generation ×3** | UE5, two leaves | `FSR (3.1 or 4 …)`, 1707×961 | `Active (technology not identified)` — no FRAMEGENERATION dispatch, no Streamline token; the count came from the UPSCALE dispatches | `67.51 → 200.66 (×2.97 FG)` | 1.00 (fg-dispatch/frame 0.00) |
|
||||
> | **Expedition 33**, FSR, FG off | same | same | `none` | `FPS: 85.12` | 1.00 |
|
||||
> | **Cyberpunk 2077**, FSR 3 + FG | FSR 3.0 host DLLs for upscaling, the **1.1.x monolith for frame generation** | `N/A` (upscale is `ffx_fsr3upscaler_x64.dll`, the deferred route) — render 1506×847 from PREPARE | `FsrFg` (4261 generated batches) | `72.93 → 145.76 (×2)` | — (no UPSCALE dispatch; count = Streamline tokens 4266) |
|
||||
> | **Dying Light: The Beast**, FSR + **FSR FG** | loader + two leaves | `N/A` | `N/A` — **zero dispatches at any leaf export** | `Presented 146.54`, WARNING | census: no FSR identity, no FSR_FG |
|
||||
> | **KCD2**, FSR (×2 runs) | loader + upscaler leaf | `N/A` | `N/A` — zero leaf dispatches | `Presented 58.8`, cannot-include shape (no FG runtime) | — |
|
||||
> | **Black Myth: Wukong**, FSR | monolith + loader 2.1.0 | `N/A` | `none` (Streamline tokens = presents) — zero leaf dispatches | `FPS: 41.11` | — |
|
||||
> | **Rune Factory**, **FSR FG** (×2 runs) | **statically linked**: `amd_fidelityfx_dx12.dll` is on disk and NOT in the census | `N/A` | `Active (technology not identified)`, count from Streamline tokens | `59.99 → 119.95 (×2 FG)` | — |
|
||||
>
|
||||
> **What it settles.** A1–A3 land exactly as pre-committed, on both vendor shapes the leaf rows
|
||||
> reach (the 1.1.x monolith; the UE5 pair with no loader), with the two per-frame counts agreeing to
|
||||
> the frame every time and `none` reached by count on every FG-off leg. **The Expedition 33 FG leg is
|
||||
> the mixed-vendor case the table did not name:** FSR upscaling with NVIDIA's ×3 frame generation on
|
||||
> top — no FRAMEGENERATION dispatch, no Streamline token (UE5 drives DLSS-G through NGX), so the
|
||||
> UPSCALE count carried the application frames and the report said *active, technology not
|
||||
> identified* at ×2.97 against the title's own ×3. Honest and correct. **Cyberpunk at FSR 3 splits
|
||||
> across two AMD generations:** the FSR 3.0 host DLLs upscale (the deferred route, so `upscaler: N/A`)
|
||||
> while frame generation goes through the 1.1.x monolith, which the row sees — `FsrFg` at ×2.
|
||||
>
|
||||
> **What it reversed — row R6, which the table lacked: the SDK 2.x LOADER is the game's entry, and
|
||||
> the leaves stay silent behind it.** Dying Light: The Beast (FSR + FSR FG, which neither Steam's
|
||||
> counter nor DLSS Swapper could see either), KCD2 (FSR) and Wukong (FSR) produced **zero**
|
||||
> dispatches at any leaf export while the leaves sat in the census. The morning's argument — five
|
||||
> identical export tables, so the loader can only reach a leaf through the leaf's export — was
|
||||
> wrong about the loader: the MIT source shows an *external provider object* and the signed loader
|
||||
> evidently calls it, not `ffxDispatch`. **So the loader is a row** (the PR after this run), the
|
||||
> stub forwards through the leaves' direct entry to model what was measured, and the K = 1 control
|
||||
> with all four modules hooked is what would show a loader that re-entered an export (2.0). Owed:
|
||||
> the three loader titles again, against **R6-accept** = identity + count as the leaf rows give,
|
||||
> `frames/upscale-drained ≈ 1.00`; **R6-double** = `presents/frame ≈ 0.5·K` → the loader re-enters
|
||||
> an export on that version and the leaf rows must yield to it.
|
||||
>
|
||||
> **And 7b's title exists after all: Rune Factory: Guardians of Azuma links FSR 3 frame generation
|
||||
> statically.** The 1.1.x monolith ships beside the executable and is never loaded — the census has
|
||||
> no AMD module at all — yet FSR FG is on and the Streamline token count still measured ×2.00
|
||||
> against the title's own setting, so the report printed the trio with *technology not identified*.
|
||||
> That is better than the ceiling §Scope decisions predicted (Presented FPS + qualifier): on a UE5
|
||||
> title Streamline's token is there even when the upscaler and FG are AMD's, so the application-frame
|
||||
> count survives static linking. The identity does not, and cannot.
|
||||
>
|
||||
> **Still deferred, with the costing written:** the FSR 3.0 host route — `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale`
|
||||
> / `ffxFsr3DispatchFrameGeneration`, named exports, no struct decode for identity — needs ten
|
||||
> host headers from tag `v1.1.4` (`main` dropped `ffx_fsr3.h`), whose closure reaches
|
||||
|
||||
+30
-18
@@ -731,10 +731,15 @@ hole; it does not close it.
|
||||
- **The only cheap improvement is wording**, and it is already in: the qualifier says
|
||||
*statically linked FSR3-FG … outside what this can see*. If a title is found, the first PR is
|
||||
a `spike-notes` row and a `20_OPEN_QUESTIONS` §Scope entry with the measured shape, not code.
|
||||
- **Measured 2026-09-04: no such title is installed.** Both Steam libraries scanned to full
|
||||
depth — every FSR title ships its DLLs (the SDK 1.1.x monolith, the SDK 2.x effect DLLs, or
|
||||
Red Dead Redemption 2's `ffx_fsr2_api_*` set); the module topology per title is in
|
||||
`spike-notes` §9. So this item stays a boundary row in §Scope decisions, not work.
|
||||
- ~~**Measured 2026-09-04: no such title is installed.**~~ **Found the same evening, by running
|
||||
rather than by scanning: Rune Factory: Guardians of Azuma.** The scan was right that every FSR
|
||||
title *ships* its DLLs — Rune Factory ships the 1.1.x monolith — and wrong to read shipping as
|
||||
loading: with FSR frame generation on, the census has **no AMD module at all**, so the plugin's
|
||||
FSR 3 is compiled in. And the ceiling is better than this entry feared: Streamline's frame
|
||||
token is requested on that UE5 title regardless, so the count read `59.99 → 119.95 (×2 FG)`,
|
||||
*technology not identified* — the trio, with the vendor missing. Identity by name stays out of
|
||||
reach; §Scope decisions carries the corrected row. A disk scan cannot find this shape; a
|
||||
capture with the census line can.
|
||||
|
||||
#### ~~7c. AMD and Intel identity, measured rather than inferred~~ — **AMD LANDED 2026-09-04; Intel closed; the owner's three launches are owed**
|
||||
|
||||
@@ -745,14 +750,18 @@ the K = 1 / K = 4 pair runs on both vendor shapes, and the acceptance table is p
|
||||
`20_OPEN_QUESTIONS` §H11 (rows A1–A3, R1–R5). Status is in `CHANGELOG.md` and §H11. **Three
|
||||
corrections to the entry below, each of which changed what got built:**
|
||||
|
||||
- **Scope to the LEAVES, not "the facade".** Step 2 says *"module-scope every row to the facade
|
||||
… the plugin modules are called by the facade"*. Measured: SDK 2.x's `amd_fidelityfx_loader_dx12.dll`
|
||||
contains no effect code and can reach an effect DLL only through the effect DLL's own five
|
||||
exports; Hell Is Us and Expedition 33 ship the two effect DLLs with **no loader at all** (the UE
|
||||
plugin compiles the MIT loader source in). So the rows are the three leaves — the 1.1.x
|
||||
monolith and the two 2.x effect DLLs — and the loader is refused as a row by `static_assert`.
|
||||
Hooking "the facade" on a loader-shipping title would have hooked the forwarder, and hooking
|
||||
both would have counted every dispatch twice.
|
||||
- **Scope to the modules a GAME CALLS — the three leaves AND the SDK 2.x loader — not "the
|
||||
facade", and this bullet reversed itself within the day.** Step 2 says *"module-scope every row
|
||||
to the facade … the plugin modules are called by the facade"*. The morning's build hooked the
|
||||
three leaves only and refused the loader by `static_assert`, arguing that five identical export
|
||||
tables leave the loader no route to a leaf but the leaf's own export, so hooking both would
|
||||
double-count. The UE5 half held — Hell Is Us and Expedition 33 ship the two effect DLLs with
|
||||
**no loader** and their dispatches arrive at the leaves, 1×. **The loader half did not:** Dying
|
||||
Light: The Beast at FSR + FSR FG, KCD2 at FSR and Wukong at FSR produced **zero** dispatches at
|
||||
any leaf export (§H11's run table, row R6). The signed loader reaches its providers through an
|
||||
object, not an export. So the row set is *whatever module the game calls*: four rows, the
|
||||
loader's stub forwards through the leaves' direct entry to model the measurement, and the
|
||||
K = 1 control with all four hooked is what would show a loader that re-entered an export.
|
||||
- **`ffxCreateContext` is not a row.** Identity comes off the UPSCALE dispatch's type — per
|
||||
frame, so it says *running* rather than *created* — and a create-context row's honest family
|
||||
is `UPSCALER_IDENTITY` alone, which collides with `slEvaluateFeature`'s under the installer's
|
||||
@@ -761,12 +770,15 @@ corrections to the entry below, each of which changed what got built:**
|
||||
since 2026-08-14, self-tested. Pass C gained the **export** table instead, because `ffx_api.h`
|
||||
declares its entry points `__declspec(dllexport)` unconditionally.
|
||||
|
||||
**What the owner's runs settle** (one launch each, §H11's table): A1 Lies of P at FSR + FG prints
|
||||
`upscaler: Fsr3` / `frame generation: FsrFg` and the trio at ≈ ×2 with `frames/upscale-drained ≈ 1.00`;
|
||||
A2 the same title with FG off reads `none` by count; A3 Hell Is Us at FSR prints the
|
||||
`FSR (3.1 or 4 …)` identity and shows which vendor's count the latch chose. **The FSR 3.0 host
|
||||
route (`ffx_fsr3_x64.dll`, step 3 below) is deferred to its own PR** — ten host headers from
|
||||
`v1.1.4`, one title here to test on.
|
||||
**Run 2026-09-04 evening, thirteen captures, §H11's table:** A1–A3 landed as pre-committed
|
||||
(`Fsr3` / `FsrFg` / ×2.00 / 1.00 on Lies of P; `none` by count with FG off; `FSR (3.1 or 4 …)` /
|
||||
`FsrFg` / ×2 on Hell Is Us), Expedition 33 showed the mixed-vendor shape (FSR upscale + DLSS FG ×3
|
||||
→ *active, technology not identified* at ×2.97), Cyberpunk at FSR 3 split across two AMD
|
||||
generations, and **Rune Factory turned out to be 7b's statically linked title** with the Streamline
|
||||
token count still reading ×2. **Owed after the loader row lands:** Dying Light: The Beast at
|
||||
FSR + FSR FG, KCD2 at FSR, Wukong at FSR — against row R6. **The FSR 3.0 host route
|
||||
(`ffx_fsr3_x64.dll`, step 3 below) is deferred to its own PR** — ten host headers from `v1.1.4`;
|
||||
Cyberpunk at FSR 3 is its oracle and already prints `FsrFg` from the monolith beside it.
|
||||
|
||||
<details>
|
||||
<summary>The entry as it stood, kept for the reasoning it carries</summary>
|
||||
|
||||
+20
-5
@@ -1705,11 +1705,26 @@ one launch per capture, consent granted after launch. Exit codes and full report
|
||||
| Cyberpunk 2077 (also) | `ffx_fsr3_x64.dll`, `ffx_backend_dx12_x64.dll`, `ffx_frameinterpolation_x64.dll`, `ffx_fsr3upscaler_x64.dll`, `ffx_opticalflow_x64.dll` | FSR 3.0 host DLLs, named exports — the deferred route |
|
||||
|
||||
Every module in the ffx-api family exports the same five names and nothing else
|
||||
(`vendor-exports.json`), so the loader can only reach a leaf through the leaf's own export —
|
||||
which is why the rows are the leaves and never the loader. **No statically linked FSR title is
|
||||
installed** (HANDOFF 7b): every FSR title above ships its DLLs. **Owed, one launch each, against
|
||||
`20_OPEN_QUESTIONS` §H11's table:** Lies of P at FSR + FG (A1) and FSR alone (A2), Hell Is Us at
|
||||
FSR (A3) — read the `ffx dispatch census` line and the trio.
|
||||
(`vendor-exports.json`) — which the morning read as "the loader can only reach a leaf through
|
||||
the leaf's own export, so the rows are the leaves and never the loader". **The evening's run
|
||||
reversed that** (below): on the three loader-shipping titles the leaves' exports stayed silent
|
||||
while FSR ran, so the loader is the game's entry and is now a row. ~~**No statically linked FSR
|
||||
title is installed**~~ — shipping is not loading: Rune Factory ships the monolith and never
|
||||
loads it.
|
||||
|
||||
- **2026-09-04 evening, thirteen captures across nine titles under the leaf-only build (#110), one
|
||||
launch each** — the full table with the settings the owner set is in `20_OPEN_QUESTIONS` §H11.
|
||||
In one line each: **Lies of P** `Fsr3` / `FsrFg` / `118.98 → 238.02 (×2)` / counts agree 1.00,
|
||||
and `none` by count with FG off; **Hell Is Us** `FSR (3.1 or 4 …)` / `FsrFg` / ×2 / 1.00, and
|
||||
`none` with FG off; **Expedition 33** FSR upscale under DLSS FG ×3 → `×2.97`, *technology not
|
||||
identified*, count from UPSCALE dispatches (no PREPARE, no token); **Cyberpunk** at FSR 3: the FSR
|
||||
3.0 host DLLs upscale (`upscaler: N/A`, deferred route) while the 1.1.x monolith generates
|
||||
(`FsrFg`, 4261 batches, ×2); **Dying Light: The Beast** (FSR + FSR FG), **KCD2** (FSR) and
|
||||
**Wukong** (FSR): **zero dispatches at any leaf export**, `upscaler: N/A` — the loader-row
|
||||
reversal; **Rune Factory** (FSR FG): no AMD module in the census, `59.99 → 119.95 (×2)` from
|
||||
Streamline tokens, *technology not identified* — 7b's statically linked title, with the count
|
||||
surviving and the identity not. **Owed after the loader row:** the three loader titles again,
|
||||
against row R6.
|
||||
|
||||
## 10 · Telemetry layering
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ static_assert((kFamilyEvaluateFeature & static_cast<uint32_t>(fl::FL_HOOK_FG_EVA
|
||||
|
||||
// --- AMD FidelityFX, through the ffx-api facade (2026-09-04, HANDOFF item 7c) ----
|
||||
//
|
||||
// ONE FAMILY, THREE ROWS, THREE MODULES, AND EVERY ROW IS THE SAME EXPORT NAME.
|
||||
// ONE FAMILY, FOUR ROWS, FOUR MODULES, AND EVERY ROW IS THE SAME EXPORT NAME.
|
||||
// `ffxDispatch` is the single call an ffx-api title routes every per-frame piece
|
||||
// of work through -- the upscale, the frame-generation PREPARE, and the generated
|
||||
// batch -- and the DESCRIPTOR it is handed says which (ffxApiHeader::type, a value
|
||||
@@ -141,32 +141,39 @@ static_assert((kFamilyEvaluateFeature & static_cast<uint32_t>(fl::FL_HOOK_FG_EVA
|
||||
// a compound constant, and it must differ from all three single-bit values above
|
||||
// because InstallByFamily binds by EQUALITY (dllmain.cpp).
|
||||
//
|
||||
// WHY THESE THREE MODULES, AND WHY NOT A FOURTH. Measured on installed titles,
|
||||
// 2026-09-04:
|
||||
// WHY THESE FOUR MODULES. Measured on installed titles, 2026-09-04:
|
||||
//
|
||||
// amd_fidelityfx_dx12.dll SDK 1.1.x MONOLITH -- Lies of P, Cyberpunk 2077,
|
||||
// Rune Factory, Black Myth: Wukong (1.0.1.41314)
|
||||
// amd_fidelityfx_upscaler_dx12.dll SDK 2.x effect DLL: the FSR 3.1 AND FSR 4 providers
|
||||
// amd_fidelityfx_framegeneration_dx12.dll SDK 2.x effect DLL: FSR 3.1 / FSR 4 frame generation
|
||||
// and the frame-generation swapchain
|
||||
// amd_fidelityfx_loader_dx12.dll SDK 2.x LOADER: no effect code, forwards to the two above
|
||||
// amd_fidelityfx_loader_dx12.dll SDK 2.x LOADER: no effect code, hands the game's
|
||||
// calls to the two above
|
||||
//
|
||||
// All four export the same five names and nothing else (docs/vendor-exports.json),
|
||||
// so the loader can reach an effect DLL only through the effect DLL's OWN exports
|
||||
// -- and a UE5 title ships the two effect DLLs with NO loader at all (Hell Is Us,
|
||||
// Expedition 33: the engine plugin compiles the MIT loader source in and calls the
|
||||
// leaves directly). Every route therefore ends at a LEAF, and the leaves are what
|
||||
// is hooked. Hooking the loader as well would count each dispatch TWICE on a
|
||||
// loader-shipping title, straight into fg_factor -- the exact defect the module
|
||||
// column exists to prevent, one vendor over. The loader's name is kept here ONLY
|
||||
// so a static_assert below can refuse it as a row, and so the fixtures can build a
|
||||
// forwarding decoy that proves the leaf count reads 1x with a loader in the chain.
|
||||
// THE ROW SET IS "WHATEVER MODULE THE GAME CALLS", AND THAT WAS MEASURED TWICE IN
|
||||
// ONE DAY, WITH OPPOSITE ANSWERS FOR THE LOADER. The first version of this table
|
||||
// hooked the three leaves and refused the loader as a row, on the argument that all
|
||||
// four modules export only the five ffx-api names, so the loader could reach an
|
||||
// effect DLL only through the effect DLL's own export -- and hooking both would
|
||||
// count every dispatch twice. The UE5 half of that held: Hell Is Us and Expedition
|
||||
// 33 ship the two effect DLLs with NO loader (the engine plugin compiles the MIT
|
||||
// loader source in) and their dispatches arrive at the leaves' exports, 1x. The
|
||||
// loader half did not: Dying Light: The Beast at FSR + FSR frame generation, Kingdom
|
||||
// Come: Deliverance II at FSR and Black Myth: Wukong at FSR each produced ZERO
|
||||
// dispatches at any leaf export while the leaves sat in the census -- the game
|
||||
// calls the LOADER's export, and however the signed loader reaches its providers
|
||||
// afterwards (the MIT source shows an "external provider" object, not an export
|
||||
// call), it is not through the leaves' ffxDispatch. So the loader IS the game's
|
||||
// entry on a loader-shipping title, and it is a row. The two counts the consumer
|
||||
// prints against each other (frames/upscale-drained) and the K = 1 control in the
|
||||
// fixtures are what would show a loader that re-entered a leaf's export: 2x on both.
|
||||
//
|
||||
// The effect-DLL split is NOT a guess about the vendor's internals: the FidelityFX
|
||||
// SDK's own getting-started text says the loader "only manages the loading of
|
||||
// effect type DLLs" and is "interface- and behavior-compatible with
|
||||
// amd_fidelityfx_dx12.dll". The monolith IS its own leaf -- SDK 1.1.x compiled the
|
||||
// providers in -- which is why it is a row and the loader is not.
|
||||
// providers in.
|
||||
inline constexpr uint32_t kFamilyFfxDispatch = static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_IDENTITY) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_PARAMS) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS);
|
||||
@@ -200,18 +207,22 @@ enum FfxLeaf : uint32_t {
|
||||
kFfxLeafMonolith = 0, // amd_fidelityfx_dx12.dll -- SDK 1.1.x, FSR 3.1 only
|
||||
kFfxLeafUpscaler = 1, // amd_fidelityfx_upscaler_dx12.dll -- SDK 2.x, FSR 3.1 or FSR 4
|
||||
kFfxLeafFrameGeneration = 2, // amd_fidelityfx_framegeneration_dx12.dll -- SDK 2.x
|
||||
kFfxLeafCount = 3,
|
||||
kFfxLeafLoader = 3, // amd_fidelityfx_loader_dx12.dll -- SDK 2.x, the game's entry on
|
||||
// a loader-shipping title (measured: its leaves' exports stay silent)
|
||||
kFfxLeafCount = 4,
|
||||
};
|
||||
|
||||
inline constexpr const wchar_t* kFfxLeafModules[kFfxLeafCount] = {
|
||||
L"amd_fidelityfx_dx12.dll",
|
||||
L"amd_fidelityfx_upscaler_dx12.dll",
|
||||
L"amd_fidelityfx_framegeneration_dx12.dll",
|
||||
L"amd_fidelityfx_loader_dx12.dll",
|
||||
};
|
||||
|
||||
// NOT A ROW, and asserted so below. Named here for the static_assert and for the
|
||||
// forwarding decoy in tools/vendor-stubs, nowhere else.
|
||||
inline constexpr const wchar_t* kFfxLoaderModule = L"amd_fidelityfx_loader_dx12.dll";
|
||||
// The loader by name, for the fixtures: the decoy in tools/vendor-stubs stands in
|
||||
// for it and forwards to the two 2.x leaves the way the measurement says the real
|
||||
// one does -- NOT through their exports.
|
||||
inline constexpr const wchar_t* kFfxLoaderModule = kFfxLeafModules[kFfxLeafLoader];
|
||||
|
||||
// constexpr string compares, so the bindings below are COMPILE errors rather than
|
||||
// runtime disagreements nobody runs. Case-sensitive: they compare this file's
|
||||
@@ -264,16 +275,18 @@ inline int FfxLeafOf(const wchar_t* module) noexcept {
|
||||
// DOES carry -- that the DLSS-G plugin does not request tokens for the frames it
|
||||
// generates -- is what 20_OPEN_QUESTIONS §S31's pre-committed table exists to test
|
||||
// against a title's own x2 / x4 before a ratio near 1 may be read as "none".
|
||||
// THE THREE ffxDispatch ROWS ARE THE LEAVES, spelled as literals because Pass A's
|
||||
// parser reads literals; the static_asserts under the table bind these spellings to
|
||||
// kFfxLeafModules in both directions, so neither list can gain or lose a module alone.
|
||||
// THE FOUR ffxDispatch ROWS ARE THE MODULES A GAME CALLS, spelled as literals
|
||||
// because Pass A's parser reads literals; the static_asserts under the table bind
|
||||
// these spellings to kFfxLeafModules in both directions, so neither list can gain or
|
||||
// lose a module alone.
|
||||
#define FL_HOOK_INVENTORY(X) \
|
||||
X(L"sl.interposer.dll", "slEvaluateFeature", fl::inventory::kFamilyEvaluateFeature) \
|
||||
X(L"sl.interposer.dll", "slSetTag", fl::FL_HOOK_UPSCALER_PARAMS) \
|
||||
X(L"sl.interposer.dll", "slGetNewFrameToken", fl::FL_HOOK_FG_EVALUATIONS) \
|
||||
X(L"amd_fidelityfx_dx12.dll", "ffxDispatch", fl::inventory::kFamilyFfxDispatch) \
|
||||
X(L"amd_fidelityfx_upscaler_dx12.dll", "ffxDispatch", fl::inventory::kFamilyFfxDispatch) \
|
||||
X(L"amd_fidelityfx_framegeneration_dx12.dll", "ffxDispatch", fl::inventory::kFamilyFfxDispatch)
|
||||
X(L"amd_fidelityfx_framegeneration_dx12.dll", "ffxDispatch", fl::inventory::kFamilyFfxDispatch) \
|
||||
X(L"amd_fidelityfx_loader_dx12.dll", "ffxDispatch", fl::inventory::kFamilyFfxDispatch)
|
||||
|
||||
// THE LEAF TABLE AND THE ROWS ARE BOUND TO EACH OTHER AT COMPILE TIME, BOTH WAYS.
|
||||
// A leaf without a row would be a trampoline slot nothing installs into; a row
|
||||
@@ -309,16 +322,20 @@ constexpr bool AnyRowNames(const wchar_t* module) noexcept {
|
||||
}
|
||||
static_assert(FfxDispatchRowExistsFor(kFfxLeafModules[kFfxLeafMonolith]) &&
|
||||
FfxDispatchRowExistsFor(kFfxLeafModules[kFfxLeafUpscaler]) &&
|
||||
FfxDispatchRowExistsFor(kFfxLeafModules[kFfxLeafFrameGeneration]),
|
||||
FfxDispatchRowExistsFor(kFfxLeafModules[kFfxLeafFrameGeneration]) &&
|
||||
FfxDispatchRowExistsFor(kFfxLeafModules[kFfxLeafLoader]),
|
||||
"every ffx leaf needs its ffxDispatch row, spelled identically -- a leaf with no row is a trampoline "
|
||||
"slot nothing installs into");
|
||||
static_assert(EveryFfxDispatchRowIsALeaf(),
|
||||
"an ffxDispatch row names a module the leaf table does not know -- InstallByFamily would resolve it "
|
||||
"and find no trampoline slot, and install nothing without saying so");
|
||||
static_assert(!AnyRowNames(kFfxLoaderModule),
|
||||
"amd_fidelityfx_loader_dx12.dll is a FORWARDER and must never be a row: it reaches the effect DLLs "
|
||||
"through their own ffxDispatch exports, so hooking it as well counts every dispatch twice, straight "
|
||||
"into fg_factor");
|
||||
// The reverse of what this line said on the morning of 2026-09-04, and the evening's
|
||||
// measurement is why: three loader-shipping titles at FSR produced zero dispatches at
|
||||
// any leaf export, so the loader is where a game's calls arrive and it MUST be a row.
|
||||
static_assert(AnyRowNames(kFfxLoaderModule),
|
||||
"amd_fidelityfx_loader_dx12.dll is the game's entry on a loader-shipping title (Dying Light: The "
|
||||
"Beast, KCD2, Wukong measured 2026-09-04: zero dispatches at any leaf export while FSR ran), so "
|
||||
"without a row those titles read N/A");
|
||||
|
||||
// Does this module speak the Streamline 2 ABI the vendored headers describe?
|
||||
//
|
||||
|
||||
@@ -769,10 +769,11 @@ constexpr uint64_t kTagValid = 1ull << 32;
|
||||
|
||||
// --- AMD FidelityFX through the ffx-api leaves (HANDOFF item 7c, 2026-09-04) -----
|
||||
//
|
||||
// ONE OBSERVER, THREE TRAMPOLINES. The three leaves in fl_hook_inventory.h each
|
||||
// export their own ffxDispatch, so each needs its own MinHook target, its own
|
||||
// trampoline and its own liveness latch -- and one observer, because what the detour
|
||||
// does with a descriptor does not depend on which leaf it arrived at.
|
||||
// ONE OBSERVER, FOUR TRAMPOLINES. The four modules in fl_hook_inventory.h -- three
|
||||
// leaves and the SDK 2.x loader -- each export their own ffxDispatch, so each needs
|
||||
// its own MinHook target, its own trampoline and its own liveness latch -- and one
|
||||
// observer, because what the detour does with a descriptor does not depend on which
|
||||
// module it arrived at.
|
||||
//
|
||||
// WHAT IS READ, AND FROM WHERE (CLAUDE.md rule 4). Only the descriptor the title
|
||||
// passed to the API we hooked: its head type, and -- once the type has matched a
|
||||
@@ -1121,8 +1122,8 @@ void ObserveFfxDispatch(uint32_t leaf, const ffxDispatchDescHeader* desc) noexce
|
||||
}
|
||||
}
|
||||
|
||||
// Three trampolines from one template, one per leaf slot: MinHook needs a distinct
|
||||
// detour address per patched target, and the leaf index is what lets the trampoline
|
||||
// Four trampolines from one template, one per module slot: MinHook needs a distinct
|
||||
// detour address per patched target, and the slot index is what lets the trampoline
|
||||
// find its own original. Every argument forwarded untouched, the original called
|
||||
// exactly once on every path including the fault path.
|
||||
template <uint32_t Leaf>
|
||||
@@ -1144,6 +1145,8 @@ void* FfxDispatchDetour(uint32_t leaf) noexcept {
|
||||
return reinterpret_cast<void*>(&Hook_FfxDispatchT<fl::inventory::kFfxLeafUpscaler>);
|
||||
case fl::inventory::kFfxLeafFrameGeneration:
|
||||
return reinterpret_cast<void*>(&Hook_FfxDispatchT<fl::inventory::kFfxLeafFrameGeneration>);
|
||||
case fl::inventory::kFfxLeafLoader:
|
||||
return reinterpret_cast<void*>(&Hook_FfxDispatchT<fl::inventory::kFfxLeafLoader>);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
@@ -1365,8 +1368,8 @@ bool InstallByFamily(const wchar_t* module, const char* symbol, uint32_t family)
|
||||
reinterpret_cast<void**>(&g_origSlGetNewFrameToken), g_frameTokensLive);
|
||||
}
|
||||
if (family == fl::inventory::kFamilyFfxDispatch) {
|
||||
// THREE ROWS, ONE ARM: the row's MODULE picks the trampoline and the latch slot,
|
||||
// because the three leaves export the same name and each must be patched at its
|
||||
// FOUR ROWS, ONE ARM: the row's MODULE picks the trampoline and the latch slot,
|
||||
// because the four modules export the same name and each must be patched at its
|
||||
// own address. Per-leaf latches rather than one, so that on a UE5 title -- two
|
||||
// leaves, loaded in whatever order the engine's plugin loads them -- the watchdog
|
||||
// keeps trying the leaf that is not in yet after the other one is.
|
||||
@@ -1795,15 +1798,16 @@ void RecordPresent(IDXGISwapChain* sc, UINT syncInterval, UINT flags) noexcept {
|
||||
// giving RR its own upscaler value would resurrect the conflation v3 removed.
|
||||
rec.upscaler = FL_UPSCALER_DLSS;
|
||||
} else if (ffxUpscales != 0u) {
|
||||
// AN UPSCALE DISPATCH REACHED AN ffx-api LEAF THIS PRESENT, and which leaf
|
||||
// AN UPSCALE DISPATCH REACHED AN ffx-api MODULE THIS PRESENT, and which one
|
||||
// decides the byte. The SDK 1.1.x monolith (amd_fidelityfx_dx12.dll) hosts
|
||||
// FSR 3.1 and nothing else, so it is FSR3 as a fact. The SDK 2.x upscaler
|
||||
// DLL hosts FSR 3.1 AND FSR 4 behind the same UPSCALE type, the provider is
|
||||
// chosen at context creation by an opaque version id, and the dispatch does
|
||||
// not carry it -- so from that leaf the honest byte is "FSR, version not
|
||||
// named" (fl_shm.h §FL_UPSCALER_FSR_UNVERSIONED): FSR3 would be right on
|
||||
// every non-RDNA4 machine and a fabrication on one, and UNKNOWN would print
|
||||
// the very N/A this arm exists to remove.
|
||||
// not carry it -- so from that leaf, and from the SDK 2.x loader that fronts
|
||||
// it, the honest byte is "FSR, version not named" (fl_shm.h
|
||||
// §FL_UPSCALER_FSR_UNVERSIONED): FSR3 would be right on every non-RDNA4
|
||||
// machine and a fabrication on one, and UNKNOWN would print the very N/A
|
||||
// this arm exists to remove.
|
||||
rec.upscaler = g_ffxUpscaleLeaf.load(std::memory_order_relaxed) == fl::inventory::kFfxLeafMonolith + 1u
|
||||
? static_cast<uint8_t>(FL_UPSCALER_FSR3)
|
||||
: static_cast<uint8_t>(FL_UPSCALER_FSR_UNVERSIONED);
|
||||
|
||||
@@ -3260,10 +3260,11 @@ struct FfxObservation {
|
||||
// off -- for the reason ObserveFg gives: two hand-written cases let one acquire a
|
||||
// tolerance the other does not have, and the pair stops discriminating the moment
|
||||
// they differ.
|
||||
bool ObserveFfx(int presentsPerEval, bool topology2x, bool prepare, fl::FlUpscaler expected, FfxObservation& out) {
|
||||
bool ObserveFfx(int presentsPerEval, const wchar_t* topology, bool prepare, fl::FlUpscaler expected,
|
||||
FfxObservation& out) {
|
||||
Child child;
|
||||
std::wstring cmd = std::wstring(L"\"") + FL_HARNESS_EXE + L"\" --real --presents-per-eval " +
|
||||
std::to_wstring(presentsPerEval) + (topology2x ? L" --ffx-topology 2x" : L" --ffx-topology 1x") +
|
||||
std::to_wstring(presentsPerEval) + L" --ffx-topology " + topology +
|
||||
(prepare ? L"" : L" --ffx-no-prepare") + L" --hold-presenting-ffx 14";
|
||||
STARTUPINFOW si{};
|
||||
si.cb = sizeof(si);
|
||||
@@ -3429,17 +3430,20 @@ void AssertFfxWindow(const FfxObservation& obs, int k) {
|
||||
|
||||
} // namespace
|
||||
|
||||
TEST_CASE("FSR through the SDK 2.x leaves behind a loader: identified, extent exact, and the count tracks K",
|
||||
TEST_CASE("FSR through the SDK 2.x loader: identified, extent exact, the count tracks K, and nothing is counted twice",
|
||||
"[guard][inject][shm][ffx]") {
|
||||
// THE LOADER IS IN THE CHAIN AND IS NOT HOOKED. Every dispatch enters through the
|
||||
// loader decoy's ffxDispatch and reaches a leaf through the leaf's, so a writer that
|
||||
// had a row for the loader would count each one twice -- and the K = 1 control below
|
||||
// would read 2.0 where it must read 1.0. That is the property the rows' leaf-only
|
||||
// scoping claims, made falsifiable.
|
||||
// THE LOADER IS IN THE CHAIN AND IS HOOKED, AND SO ARE THE LEAVES BEHIND IT. The
|
||||
// game calls the loader's export -- measured on Dying Light: The Beast, KCD2 and
|
||||
// Wukong, whose leaf exports stayed silent under the leaf-only build -- and the
|
||||
// stub forwards the way the real one was measured to: through the leaves' direct
|
||||
// entry, not their export. So every dispatch is counted once, at the loader, and
|
||||
// the K = 1 control below reads 1.0. A loader that re-entered a leaf's export would
|
||||
// be counted at both and read 2.0 here, which is exactly the shape the row set
|
||||
// must never ship.
|
||||
for (const int k : {1, 4}) {
|
||||
CAPTURE(k);
|
||||
FfxObservation obs;
|
||||
REQUIRE(ObserveFfx(k, /*topology2x=*/true, /*prepare=*/true, fl::FL_UPSCALER_FSR_UNVERSIONED, obs));
|
||||
REQUIRE(ObserveFfx(k, L"2x", /*prepare=*/true, fl::FL_UPSCALER_FSR_UNVERSIONED, obs));
|
||||
AssertFfxWindow(obs, k);
|
||||
|
||||
// The census sees the two SDK 2.x leaves by name and NOT the monolith -- and
|
||||
@@ -3461,7 +3465,7 @@ TEST_CASE("the SDK 1.1.x monolith is FSR3; with no PREPARE the count falls back
|
||||
for (const int k : {1, 4}) {
|
||||
CAPTURE(k);
|
||||
FfxObservation obs;
|
||||
REQUIRE(ObserveFfx(k, /*topology2x=*/false, /*prepare=*/k > 1, fl::FL_UPSCALER_FSR3, obs));
|
||||
REQUIRE(ObserveFfx(k, L"1x", /*prepare=*/k > 1, fl::FL_UPSCALER_FSR3, obs));
|
||||
AssertFfxWindow(obs, k);
|
||||
|
||||
CHECK((obs.census & fl::FL_CENSUS_AMD_FFX_DX12) != 0u);
|
||||
@@ -3470,6 +3474,24 @@ TEST_CASE("the SDK 1.1.x monolith is FSR3; with no PREPARE the count falls back
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("the UE5 shape: the two SDK 2.x leaves called directly, no loader in the process",
|
||||
"[guard][inject][shm][ffx]") {
|
||||
// Hell Is Us and Expedition 33 -- the engine plugin compiles the MIT loader in and
|
||||
// calls the effect DLLs' exports itself. With the loader hooked as well, this is the
|
||||
// case that keeps the LEAF detours exercised: the loader case above never reaches
|
||||
// them (the forward is direct), so a leaf trampoline that stopped working would be
|
||||
// invisible there. K = 4 only: no forwarder is in this chain, so the double-count
|
||||
// control has nothing to control for, and the frame-generation shape is the one
|
||||
// that touches both leaves.
|
||||
FfxObservation obs;
|
||||
REQUIRE(ObserveFfx(4, L"ue", /*prepare=*/true, fl::FL_UPSCALER_FSR_UNVERSIONED, obs));
|
||||
AssertFfxWindow(obs, 4);
|
||||
|
||||
CHECK((obs.census & fl::FL_CENSUS_AMD_FFX_UPSCALER) != 0u);
|
||||
CHECK((obs.census & fl::FL_CENSUS_AMD_FFX_FRAMEGENERATION) != 0u);
|
||||
CHECK((obs.census & fl::FL_CENSUS_AMD_FFX_DX12) == 0u);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
struct RtObservation {
|
||||
|
||||
@@ -24,7 +24,7 @@ target_compile_definitions(hook-harness PRIVATE
|
||||
FL_STUB_SL_INTERPOSER=L"$<TARGET_FILE:fl_stub_sl_interposer>"
|
||||
FL_STUB_SL_COMMON=L"$<TARGET_FILE:fl_stub_sl_common>"
|
||||
FL_STUB_SL_INTERPOSER_V1=L"$<TARGET_FILE:fl_stub_sl_interposer_v1>"
|
||||
# The three AMD leaves and the loader decoy (tools/vendor-stubs, same rule:
|
||||
# The three AMD leaves and the loader stand-in (tools/vendor-stubs, same rule:
|
||||
# absolute paths, never a name a game directory could satisfy).
|
||||
FL_STUB_FFX_DX12=L"$<TARGET_FILE:fl_stub_ffx_dx12>"
|
||||
FL_STUB_FFX_UPSCALER=L"$<TARGET_FILE:fl_stub_ffx_upscaler>"
|
||||
@@ -115,13 +115,13 @@ add_test(NAME fl_upscaler_resolve COMMAND hook-harness --probe-upscaler-resolve)
|
||||
add_test(NAME fl_sl_abi_guard COMMAND hook-harness --probe-sl-abi)
|
||||
|
||||
# AMD's version of the scoping argument, one step further along. Four modules
|
||||
# export the same five ffx-api names -- three LEAVES and the SDK 2.x LOADER that
|
||||
# forwards to two of them -- and the Overlay hooks the leaves only, because a
|
||||
# dispatch on a loader-shipping title crosses two exports of the same name and
|
||||
# hooking both would count it twice. This probe drives the Overlay's own resolver
|
||||
# against all four, and then pushes dispatches THROUGH the loader decoy to prove the
|
||||
# forwarding fixture the [ffx] injected cases rest on actually forwards -- the
|
||||
# vacuity guard for a K = 1 control that would otherwise be about nothing.
|
||||
# export the same five ffx-api names -- three LEAVES and the SDK 2.x LOADER -- and
|
||||
# the Overlay hooks all four, because a game calls whichever it shipped against and
|
||||
# the loader was MEASURED not to re-enter the leaves' exports (three loader titles at
|
||||
# FSR, zero leaf dispatches, 2026-09-04). This probe drives the Overlay's own resolver
|
||||
# against all four, then pushes dispatches THROUGH the loader stand-in and asserts
|
||||
# they reached exactly one leaf, once, and touched no leaf export -- the vacuity guard
|
||||
# for a K = 1 control that would otherwise be about nothing.
|
||||
add_test(NAME fl_ffx_resolve COMMAND hook-harness --probe-ffx-resolve)
|
||||
|
||||
# The inputs walk against malformed input. A unit probe rather than an injected
|
||||
|
||||
@@ -61,10 +61,13 @@
|
||||
// an FSR title does: one UPSCALE and one PREPARE (issued twice,
|
||||
// same frameID) per application frame, one FRAMEGENERATION per
|
||||
// frame at K > 1, then K presents (--presents-per-eval K)
|
||||
// --ffx-topology 1x|2x
|
||||
// --ffx-topology 1x|2x|ue
|
||||
// which vendor shape --hold-presenting-ffx stands in: 2x (default)
|
||||
// is the SDK 2.x pair of effect DLLs behind the LOADER decoy, 1x
|
||||
// the SDK 1.1.x monolith sending the pre-V2 PREPARE
|
||||
// is the SDK 2.x pair of effect DLLs behind the LOADER (the game
|
||||
// calls the loader; the loader forwards NOT through the leaves'
|
||||
// exports -- measured), 1x the SDK 1.1.x monolith sending the
|
||||
// pre-V2 PREPARE, ue the UE5 shape: the two effect DLLs called
|
||||
// directly, no loader
|
||||
// --ffx-no-prepare drop the PREPARE dispatch: the frame-generation-OFF shape, where
|
||||
// the Overlay must count UPSCALE dispatches instead
|
||||
//
|
||||
@@ -1996,18 +1999,20 @@ bool ProbeUpscalerResolve() {
|
||||
//
|
||||
// Four modules export the same five names here, exactly as on a loader-shipping
|
||||
// title, and the property under test is fl_hook_inventory.h's: the Overlay's own
|
||||
// resolver returns each LEAF's own export, never the loader's, and refuses a module
|
||||
// of a leaf's name that does not speak the five-export ABI. The second half is a
|
||||
// VACUITY GUARD for the [ffx] injected cases: a dispatch pushed through the loader
|
||||
// decoy must arrive at exactly one leaf, counted once -- or the K = 1 control in
|
||||
// those cases would be proving something about a forwarder that did not forward.
|
||||
// resolver returns each module's OWN export -- four distinct addresses, the loader's
|
||||
// among them -- and refuses a module of a hooked name that does not speak the
|
||||
// five-export ABI. The second half is a VACUITY GUARD for the [ffx] injected cases: a
|
||||
// dispatch pushed through the loader stand-in must arrive at exactly one leaf, once,
|
||||
// through the leaf's DIRECT entry and not its export (the measured shape) -- or the
|
||||
// K = 1 control in those cases would be proving something about a forwarder that
|
||||
// did not forward, or that forwarded the way the real one does not.
|
||||
// ---------------------------------------------------------------------------
|
||||
using StubFfxCountFn = unsigned int(STDMETHODCALLTYPE*)(uint64_t);
|
||||
using StubFfxPlainCountFn = unsigned int(STDMETHODCALLTYPE*)();
|
||||
using StubLoaderBindFn = void(STDMETHODCALLTYPE*)(HMODULE, HMODULE);
|
||||
|
||||
bool ProbeFfxResolve() {
|
||||
std::printf("\n[ffx] leaf-scoped resolution of ffxDispatch, with the loader decoy present and forwarding\n");
|
||||
std::printf("\n[ffx] module-scoped resolution of ffxDispatch on all four AMD modules, and the loader's forward\n");
|
||||
|
||||
const HMODULE monolith = LoadStubExactly(FL_STUB_FFX_DX12);
|
||||
const HMODULE upscaler = LoadStubExactly(FL_STUB_FFX_UPSCALER);
|
||||
@@ -2045,10 +2050,11 @@ bool ProbeFfxResolve() {
|
||||
Check(fl::inventory::FfxLeafOf(L"amd_fidelityfx_framegeneration_dx12.dll") ==
|
||||
static_cast<int>(fl::inventory::kFfxLeafFrameGeneration),
|
||||
"amd_fidelityfx_framegeneration_dx12.dll is the frame-generation leaf");
|
||||
Check(fl::inventory::FfxLeafOf(fl::inventory::kFfxLoaderModule) < 0, "the loader is not a leaf");
|
||||
Check(fl::inventory::FfxLeafOf(fl::inventory::kFfxLoaderModule) == static_cast<int>(fl::inventory::kFfxLeafLoader),
|
||||
"the loader has its own slot: it is the game's entry on a loader-shipping title (measured 2026-09-04)");
|
||||
Check(fl::inventory::FfxLeafOf(nullptr) < 0, "a null module name is not a leaf");
|
||||
|
||||
// No inventory row names the loader -- walked at runtime here as well as
|
||||
// An inventory row names the loader -- walked at runtime here as well as
|
||||
// asserted at compile time in the header, so the property has two witnesses.
|
||||
bool loaderIsARow = false;
|
||||
#define FL_PROBE_ROW(mod, sym, family) \
|
||||
@@ -2057,7 +2063,7 @@ bool ProbeFfxResolve() {
|
||||
}
|
||||
FL_HOOK_INVENTORY(FL_PROBE_ROW)
|
||||
#undef FL_PROBE_ROW
|
||||
Check(!loaderIsARow, "no FL_HOOK_INVENTORY row names amd_fidelityfx_loader_dx12.dll");
|
||||
Check(loaderIsARow, "an FL_HOOK_INVENTORY row names amd_fidelityfx_loader_dx12.dll");
|
||||
|
||||
// THE PROPERTY: the Overlay's own resolver returns each leaf's OWN export.
|
||||
void* fromMonolith = fl::inventory::ResolveScoped(L"amd_fidelityfx_dx12.dll", "ffxDispatch");
|
||||
@@ -2072,9 +2078,11 @@ bool ProbeFfxResolve() {
|
||||
Check(fromMonolith != nullptr && fromUpscaler != nullptr && fromFg != nullptr && fromMonolith != fromUpscaler &&
|
||||
fromUpscaler != fromFg && fromMonolith != fromFg,
|
||||
"three leaves, three DIFFERENT addresses - a name-only resolver could not tell them apart");
|
||||
Check(fromUpscaler != reinterpret_cast<void*>(GetProcAddress(loader, "ffxDispatch")) &&
|
||||
fromFg != reinterpret_cast<void*>(GetProcAddress(loader, "ffxDispatch")),
|
||||
"and none of them is the loader's export");
|
||||
void* fromLoader = fl::inventory::ResolveScoped(fl::inventory::kFfxLoaderModule, "ffxDispatch");
|
||||
Check(fromLoader == reinterpret_cast<void*>(GetProcAddress(loader, "ffxDispatch")),
|
||||
"ResolveScoped returned the loader's own export");
|
||||
Check(fromLoader != nullptr && fromLoader != fromUpscaler && fromLoader != fromFg && fromLoader != fromMonolith,
|
||||
"and it is a fourth address - the loader is patched at its own export, not at a leaf's");
|
||||
|
||||
// The ABI arm, both directions.
|
||||
Check(fl::inventory::SpeaksExpectedAbi(L"amd_fidelityfx_upscaler_dx12.dll", upscaler),
|
||||
@@ -2102,11 +2110,15 @@ bool ProbeFfxResolve() {
|
||||
reinterpret_cast<StubFfxCountFn>(reinterpret_cast<void*>(GetProcAddress(fg, "FlStubFfxDispatchCount")));
|
||||
auto countMono =
|
||||
reinterpret_cast<StubFfxCountFn>(reinterpret_cast<void*>(GetProcAddress(monolith, "FlStubFfxDispatchCount")));
|
||||
auto exportsUp = reinterpret_cast<StubFfxPlainCountFn>(
|
||||
reinterpret_cast<void*>(GetProcAddress(upscaler, "FlStubFfxExportCalls")));
|
||||
auto exportsFg =
|
||||
reinterpret_cast<StubFfxPlainCountFn>(reinterpret_cast<void*>(GetProcAddress(fg, "FlStubFfxExportCalls")));
|
||||
Check(bind != nullptr && loaderDispatch != nullptr && forwarded != nullptr && countUp != nullptr &&
|
||||
countFg != nullptr && countMono != nullptr,
|
||||
countFg != nullptr && countMono != nullptr && exportsUp != nullptr && exportsFg != nullptr,
|
||||
"the fixtures export their binding and counting entry points");
|
||||
if (bind == nullptr || loaderDispatch == nullptr || forwarded == nullptr || countUp == nullptr ||
|
||||
countFg == nullptr || countMono == nullptr) {
|
||||
countFg == nullptr || countMono == nullptr || exportsUp == nullptr || exportsFg == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2138,6 +2150,12 @@ bool ProbeFfxResolve() {
|
||||
Check(countUp(FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE_V2) == 0u, "not the upscaler leaf");
|
||||
Check(countUp(FFX_API_DISPATCH_DESC_TYPE_UPSCALE) == 1u, "and the upscaler's own count did not move");
|
||||
Check(forwarded() == 2u, "the loader forwarded exactly the two calls that had a provider");
|
||||
// THE MEASURED SHAPE, reproduced: a forward through the loader does NOT enter the
|
||||
// leaf's ffxDispatch export. With all four modules hooked, that is what keeps a
|
||||
// dispatch on a loader-shipping title counted once rather than twice.
|
||||
Check(exportsUp() == 0u && exportsFg() == 0u,
|
||||
"neither leaf's EXPORT was entered by the forward - the loader reached the direct entry, as the real "
|
||||
"one was measured to bypass the leaf exports");
|
||||
return g_failures == 0;
|
||||
}
|
||||
|
||||
@@ -2348,43 +2366,62 @@ int HoldPresentingFg(Gfx& g, int seconds, bool real, int presentsPerEval) {
|
||||
// --ffx-no-prepare drops the PREPARE entirely: the frame-generation-off shape, where
|
||||
// the Overlay must fall back to the UPSCALE count and K = 1 must still read 1.0.
|
||||
// ---------------------------------------------------------------------------
|
||||
int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, bool topology2x, bool prepare) {
|
||||
HMODULE entry = nullptr;
|
||||
if (topology2x) {
|
||||
const HMODULE upscaler = LoadStubExactly(FL_STUB_FFX_UPSCALER);
|
||||
const HMODULE fg = LoadStubExactly(FL_STUB_FFX_FG);
|
||||
const HMODULE loader = LoadStubExactly(FL_STUB_FFX_LOADER);
|
||||
if (upscaler == nullptr || fg == nullptr || loader == nullptr) {
|
||||
Check(false, "the SDK 2.x stubs (two leaves and the loader decoy) loaded for the ffx hold");
|
||||
return 1;
|
||||
}
|
||||
auto bind =
|
||||
reinterpret_cast<StubLoaderBindFn>(reinterpret_cast<void*>(GetProcAddress(loader, "FlStubLoaderBind")));
|
||||
if (bind == nullptr) {
|
||||
Check(false, "the loader decoy exports FlStubLoaderBind");
|
||||
return 1;
|
||||
}
|
||||
bind(upscaler, fg);
|
||||
entry = loader;
|
||||
} else {
|
||||
entry = LoadStubExactly(FL_STUB_FFX_DX12);
|
||||
if (entry == nullptr) {
|
||||
// Which module the fixture calls: 1x = the monolith, 2x = the loader (which forwards to
|
||||
// the two leaves through their DIRECT entry, as measured), ue = the two leaves called
|
||||
// directly with no loader in the process, the UE5 shape.
|
||||
enum class FfxTopology { Monolith, Loader, Ue };
|
||||
|
||||
int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, FfxTopology topology, bool prepare) {
|
||||
HMODULE upEntry = nullptr; // where UPSCALE goes
|
||||
HMODULE fgEntry = nullptr; // where PREPARE and FRAMEGENERATION go
|
||||
if (topology == FfxTopology::Monolith) {
|
||||
upEntry = fgEntry = LoadStubExactly(FL_STUB_FFX_DX12);
|
||||
if (upEntry == nullptr) {
|
||||
Check(false, "the SDK 1.1.x monolith stub loaded for the ffx hold");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
const HMODULE upscaler = LoadStubExactly(FL_STUB_FFX_UPSCALER);
|
||||
const HMODULE fg = LoadStubExactly(FL_STUB_FFX_FG);
|
||||
if (upscaler == nullptr || fg == nullptr) {
|
||||
Check(false, "the SDK 2.x leaf stubs loaded for the ffx hold");
|
||||
return 1;
|
||||
}
|
||||
if (topology == FfxTopology::Loader) {
|
||||
const HMODULE loader = LoadStubExactly(FL_STUB_FFX_LOADER);
|
||||
if (loader == nullptr) {
|
||||
Check(false, "the loader stub loaded for the ffx hold");
|
||||
return 1;
|
||||
}
|
||||
auto bind =
|
||||
reinterpret_cast<StubLoaderBindFn>(reinterpret_cast<void*>(GetProcAddress(loader, "FlStubLoaderBind")));
|
||||
if (bind == nullptr) {
|
||||
Check(false, "the loader stub exports FlStubLoaderBind");
|
||||
return 1;
|
||||
}
|
||||
bind(upscaler, fg);
|
||||
upEntry = fgEntry = loader;
|
||||
} else {
|
||||
upEntry = upscaler;
|
||||
fgEntry = fg;
|
||||
}
|
||||
}
|
||||
auto dispatch = reinterpret_cast<PfnFfxDispatch>(reinterpret_cast<void*>(GetProcAddress(entry, "ffxDispatch")));
|
||||
if (dispatch == nullptr) {
|
||||
Check(false, "the entry module exports ffxDispatch");
|
||||
auto dispatchUp = reinterpret_cast<PfnFfxDispatch>(reinterpret_cast<void*>(GetProcAddress(upEntry, "ffxDispatch")));
|
||||
auto dispatchFg = reinterpret_cast<PfnFfxDispatch>(reinterpret_cast<void*>(GetProcAddress(fgEntry, "ffxDispatch")));
|
||||
if (dispatchUp == nullptr || dispatchFg == nullptr) {
|
||||
Check(false, "the entry module(s) export ffxDispatch");
|
||||
return 1;
|
||||
}
|
||||
const bool topology2x = topology != FfxTopology::Monolith;
|
||||
const char* topologyName = topology == FfxTopology::Monolith ? "SDK 1.1.x (monolith)"
|
||||
: topology == FfxTopology::Loader ? "SDK 2.x (two leaves behind the loader)"
|
||||
: "UE5 (two leaves, no loader)";
|
||||
|
||||
const int k = presentsPerEval < 1 ? 1 : presentsPerEval;
|
||||
const UINT flags = real ? 0u : DXGI_PRESENT_TEST;
|
||||
std::printf(" presenting for %d second(s) [%s], ffx-api %s, one UPSCALE%s per %d present(s)%s\n", seconds,
|
||||
real ? "REAL" : "DXGI_PRESENT_TEST",
|
||||
topology2x ? "SDK 2.x (two leaves behind the loader)" : "SDK 1.1.x (monolith)",
|
||||
prepare ? " + PREPARE x2" : " (no PREPARE)", k, k > 1 ? " + one FRAMEGENERATION" : "");
|
||||
real ? "REAL" : "DXGI_PRESENT_TEST", topologyName, prepare ? " + PREPARE x2" : " (no PREPARE)", k,
|
||||
k > 1 ? " + one FRAMEGENERATION" : "");
|
||||
std::printf(" renderSize %ux%u on every UPSCALE%s\n", kTaggedRenderW, kTaggedRenderH,
|
||||
prepare ? " and PREPARE" : "");
|
||||
std::fflush(stdout);
|
||||
@@ -2416,18 +2453,18 @@ int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, bool
|
||||
uint64_t frameId = 0;
|
||||
while (GetTickCount64() < until) {
|
||||
++frameId;
|
||||
dispatch(nullptr, &up.header);
|
||||
dispatchUp(nullptr, &up.header);
|
||||
if (prepare) {
|
||||
// TWICE, SAME frameID: the SDK's own sample re-issues the prepare when its
|
||||
// configuration changes, and the vendor's contract is about the INDEX. A
|
||||
// writer that counted calls reads 2.0 at K = 1 here.
|
||||
prep.frameID = frameId;
|
||||
dispatch(nullptr, &prep.header);
|
||||
dispatch(nullptr, &prep.header);
|
||||
dispatchFg(nullptr, &prep.header);
|
||||
dispatchFg(nullptr, &prep.header);
|
||||
}
|
||||
if (k > 1) {
|
||||
gen.frameID = frameId;
|
||||
dispatch(nullptr, &gen.header);
|
||||
dispatchFg(nullptr, &gen.header);
|
||||
}
|
||||
++frames;
|
||||
for (int i = 0; i < k; ++i) {
|
||||
@@ -2523,8 +2560,8 @@ int main(int argc, char** argv) {
|
||||
// Which vendor shape --hold-presenting-ffx stands in, and whether the title
|
||||
// issues a PREPARE at all. Pre-pass arguments, like --presents-per-eval, so one
|
||||
// hold mode drives every combination and the tests assert one expression.
|
||||
bool ffxTopology2x = true;
|
||||
bool ffxPrepare = true;
|
||||
FfxTopology ffxTopology = FfxTopology::Loader;
|
||||
bool ffxPrepare = true;
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (std::strcmp(argv[i], "--real") == 0) {
|
||||
@@ -2546,7 +2583,10 @@ int main(int argc, char** argv) {
|
||||
presentsPerEval = 1;
|
||||
}
|
||||
} else if (std::strcmp(argv[i], "--ffx-topology") == 0 && i + 1 < argc) {
|
||||
ffxTopology2x = std::strcmp(argv[++i], "1x") != 0;
|
||||
const char* t = argv[++i];
|
||||
ffxTopology = std::strcmp(t, "1x") == 0 ? FfxTopology::Monolith
|
||||
: std::strcmp(t, "ue") == 0 ? FfxTopology::Ue
|
||||
: FfxTopology::Loader;
|
||||
} else if (std::strcmp(argv[i], "--ffx-no-prepare") == 0) {
|
||||
ffxPrepare = false;
|
||||
}
|
||||
@@ -2568,8 +2608,7 @@ int main(int argc, char** argv) {
|
||||
ok = HoldPresentingFg(g, std::atoi(argv[++i]), real, presentsPerEval) == 0 && ok;
|
||||
ranSomething = true;
|
||||
} else if (std::strcmp(argv[i], "--hold-presenting-ffx") == 0 && i + 1 < argc) {
|
||||
ok =
|
||||
HoldPresentingFfx(g, std::atoi(argv[++i]), real, presentsPerEval, ffxTopology2x, ffxPrepare) == 0 && ok;
|
||||
ok = HoldPresentingFfx(g, std::atoi(argv[++i]), real, presentsPerEval, ffxTopology, ffxPrepare) == 0 && ok;
|
||||
ranSomething = true;
|
||||
} else if (std::strcmp(argv[i], "--hold-presenting-upscaled") == 0 && i + 1 < argc) {
|
||||
ok = HoldPresentingUpscaled(g, std::atoi(argv[++i]), real, sl::kFeatureDLSS) == 0 && ok;
|
||||
|
||||
@@ -62,13 +62,13 @@ set_target_properties(fl_stub_sl_interposer_v1 PROPERTIES
|
||||
|
||||
# --- AMD FidelityFX (ffx-api) -------------------------------------------------
|
||||
#
|
||||
# THREE LEAVES AND A FORWARDER. The three modules the Overlay hooks all export the
|
||||
# same five ffx-api names (docs/vendor-exports.json), and so does the SDK 2.x
|
||||
# loader, which forwards to the two effect DLLs and is deliberately NOT an
|
||||
# inventory row. The fixture reproduces exactly that shape: the harness binds the
|
||||
# loader stub to the two 2.x leaf stubs and dispatches THROUGH it, so "the leaf
|
||||
# count reads 1x with a loader in the chain" is a property the [ffx] tests can
|
||||
# falsify rather than a comment in fl_hook_inventory.h.
|
||||
# THREE LEAVES AND THE LOADER, ALL FOUR HOOKED. The four modules export the same
|
||||
# five ffx-api names (docs/vendor-exports.json). The loader was first a decoy that
|
||||
# must never be hooked; three loader-shipping titles at FSR then produced zero
|
||||
# dispatches at any leaf export (2026-09-04), so it is a row, and this stub forwards
|
||||
# to the two 2.x leaves through their DIRECT entry -- the measured shape -- so "a
|
||||
# dispatch through the loader is counted once with everything hooked" is a property
|
||||
# the [ffx] tests can falsify rather than a comment in fl_hook_inventory.h.
|
||||
#
|
||||
# Distinct output names, so no output-directory games are needed here.
|
||||
fl_add_vendor_stub(fl_stub_ffx_dx12 "amd_fidelityfx_dx12" stub_amd_fidelityfx_dx12.cpp)
|
||||
|
||||
@@ -1,39 +1,38 @@
|
||||
// THE FORWARDING DECOY. A module named `amd_fidelityfx_loader_dx12.dll`, exporting
|
||||
// the SAME five names as the leaves -- and it must never be hooked.
|
||||
// THE LOADER STAND-IN. A module named `amd_fidelityfx_loader_dx12.dll`, exporting
|
||||
// the SAME five names as the leaves, forwarding to the two SDK 2.x leaf stubs --
|
||||
// and, since the evening of 2026-09-04, an inventory row like them.
|
||||
//
|
||||
// WHY A FORWARDER AND NOT A PLAIN DECOY. stub_sl_common.cpp's decoy proves module
|
||||
// scoping by exporting a name from the wrong module. The AMD hazard is one step
|
||||
// further along: on a loader-shipping title (Dying Light: The Beast, Kingdom Come II,
|
||||
// Black Myth: Wukong) the game calls the LOADER's ffxDispatch, and the loader
|
||||
// calls the EFFECT DLL's ffxDispatch -- the only route it has, since the effect
|
||||
// DLLs export nothing else. Every logical dispatch therefore crosses TWO exports of
|
||||
// the same name, and a writer that hooked both would count each one twice, straight
|
||||
// into fg_factor (03_METRICS: fg_factor = presents / F_app, so a doubled count
|
||||
// HALVES the factor -- reporting x2 frame generation as none). The inventory hooks
|
||||
// the leaves only, and this stub is what makes "the leaf count reads 1x with a
|
||||
// loader in the chain" a property a test can falsify: the harness binds it to the
|
||||
// two SDK 2.x leaf stubs and dispatches THROUGH it, and the leaf counters and the
|
||||
// Overlay's records had better agree with the number of calls the harness made.
|
||||
// WHAT WAS MEASURED, AND WHAT IT REVERSED. This file first shipped as a decoy that
|
||||
// must never be hooked, on the argument that the effect DLLs export only the five
|
||||
// ffx-api names, so the real loader could reach them only through their exports,
|
||||
// and hooking both would count each dispatch twice. Then three loader-shipping
|
||||
// titles ran FSR under the leaf-only build -- Dying Light: The Beast (FSR + FSR
|
||||
// frame generation), Kingdom Come: Deliverance II, Black Myth: Wukong -- and every
|
||||
// one produced ZERO dispatches at any leaf export while the leaves sat in the
|
||||
// census. The game calls the loader's export; however the signed loader reaches
|
||||
// its providers afterwards, it is not through the leaves' ffxDispatch. So the
|
||||
// loader is where those titles' calls arrive, and it is a row.
|
||||
//
|
||||
// The negative is asserted at compile time, not merely by the fixture: the loader's
|
||||
// name is bound to fl::inventory::kFfxLoaderModule, and both fl_hook_inventory.h
|
||||
// and this file refuse a row for it.
|
||||
// THIS STUB THEREFORE FORWARDS THE WAY THE MEASUREMENT SAYS: through the leaves'
|
||||
// FrameLedger-named DIRECT entry (FlStubFfxDispatchDirect), never through their
|
||||
// export. That is what makes the K = 1 control in the [ffx] cases discriminating
|
||||
// with all four modules hooked: a loader that DID re-enter a leaf's export would
|
||||
// be counted at both, and the control would read 2x. The leaves also count export
|
||||
// entries separately (FlStubFfxExportCalls), so --probe-ffx-resolve asserts the
|
||||
// forward did not touch the export at all.
|
||||
//
|
||||
// IT IS A FIXTURE, NOT A CLAIM ABOUT THE REAL LOADER'S INTERNALS. What is measured
|
||||
// is the export tables (docs/vendor-exports.json: five names, all four modules) and
|
||||
// the SDK's own description of the loader as containing no effect code; how the
|
||||
// signed binary routes internally is not ours to read, and it does not matter
|
||||
// here: with only those five exports, forwarding is the only way through.
|
||||
// IT IS A FIXTURE, NOT A CLAIM ABOUT THE REAL LOADER'S INTERNALS beyond the one
|
||||
// measured fact: the leaf exports stay silent behind it.
|
||||
|
||||
#include <ffx_api.h>
|
||||
|
||||
#include "stub_common.h"
|
||||
|
||||
static_assert(!fl::stub::InventoryHasRow(fl::inventory::kFfxLoaderModule, "ffxDispatch"),
|
||||
"amd_fidelityfx_loader_dx12.dll became an inventory row -- hooking the loader AND a leaf counts every "
|
||||
"dispatch twice on a loader-shipping title, straight into fg_factor");
|
||||
static_assert(fl::inventory::FfxLeafOfExact(fl::inventory::kFfxLoaderModule) < 0,
|
||||
"the loader is not a leaf, and the leaf table must not say otherwise");
|
||||
static_assert(fl::stub::InventoryHasRow(fl::inventory::kFfxLoaderModule, "ffxDispatch"),
|
||||
"amd_fidelityfx_loader_dx12.dll lost its inventory row -- on a loader-shipping title the game calls "
|
||||
"THIS module's export and the leaves stay silent (measured 2026-09-04), so those titles would read N/A");
|
||||
static_assert(fl::inventory::FfxLeafOfExact(fl::inventory::kFfxLoaderModule) == fl::inventory::kFfxLeafLoader,
|
||||
"the loader's slot in the module table moved");
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -58,7 +57,9 @@ void Bind(Bound& b, HMODULE h) {
|
||||
b.destroy = reinterpret_cast<PfnFfxDestroyContext>(reinterpret_cast<void*>(GetProcAddress(h, "ffxDestroyContext")));
|
||||
b.configure = reinterpret_cast<PfnFfxConfigure>(reinterpret_cast<void*>(GetProcAddress(h, "ffxConfigure")));
|
||||
b.query = reinterpret_cast<PfnFfxQuery>(reinterpret_cast<void*>(GetProcAddress(h, "ffxQuery")));
|
||||
b.dispatch = reinterpret_cast<PfnFfxDispatch>(reinterpret_cast<void*>(GetProcAddress(h, "ffxDispatch")));
|
||||
// DISPATCH GOES THROUGH THE DIRECT ENTRY, NOT THE EXPORT -- see the header comment.
|
||||
b.dispatch =
|
||||
reinterpret_cast<PfnFfxDispatch>(reinterpret_cast<void*>(GetProcAddress(h, "FlStubFfxDispatchDirect")));
|
||||
}
|
||||
|
||||
// Route by EFFECT ID, which is what the real loader's provider lookup keys on
|
||||
@@ -135,8 +136,9 @@ FFX_API_ENTRY ffxReturnCode_t ffxQuery(ffxContext* context, ffxQueryDescHeader*
|
||||
return b->query(context, desc);
|
||||
}
|
||||
|
||||
// The same name the leaves export, one hop earlier. If the Overlay ever hooks this
|
||||
// one, the K = 1 control in the [ffx] tests reads 2x and goes red.
|
||||
// The same name the leaves export, one hop earlier -- and hooked, since the measurement.
|
||||
// The forward below reaches the leaf's DIRECT entry, so with all four modules hooked the
|
||||
// Overlay sees this dispatch exactly once.
|
||||
FFX_API_ENTRY ffxReturnCode_t ffxDispatch(ffxContext* context, const ffxDispatchDescHeader* desc) {
|
||||
if (desc == nullptr) {
|
||||
return FFX_API_RETURN_ERROR_PARAMETER;
|
||||
|
||||
@@ -53,6 +53,37 @@ volatile LONG g_prepareV2 = 0;
|
||||
volatile LONG g_frameGeneration = 0;
|
||||
volatile LONG g_other = 0;
|
||||
volatile LONG g_contexts = 0;
|
||||
// Calls that entered through the EXPORT, as opposed to the direct entry below. The
|
||||
// loader decoy forwards through the direct entry -- the shape measured on the
|
||||
// loader-shipping titles, whose leaf exports stayed silent -- so a test can assert
|
||||
// that a dispatch pushed through the loader was counted once, at the leaf, and did
|
||||
// NOT re-enter this export (which is the double count the Overlay's loader row
|
||||
// would produce if the real loader forwarded that way).
|
||||
volatile LONG g_exportCalls = 0;
|
||||
|
||||
ffxReturnCode_t DispatchBody(const ffxDispatchDescHeader* desc) {
|
||||
if (desc == nullptr) {
|
||||
return FFX_API_RETURN_ERROR_PARAMETER;
|
||||
}
|
||||
switch (desc->type) {
|
||||
case FFX_API_DISPATCH_DESC_TYPE_UPSCALE:
|
||||
InterlockedIncrement(&g_upscale);
|
||||
break;
|
||||
case FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE:
|
||||
InterlockedIncrement(&g_prepare);
|
||||
break;
|
||||
case FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE_V2:
|
||||
InterlockedIncrement(&g_prepareV2);
|
||||
break;
|
||||
case FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION:
|
||||
InterlockedIncrement(&g_frameGeneration);
|
||||
break;
|
||||
default:
|
||||
InterlockedIncrement(&g_other);
|
||||
break;
|
||||
}
|
||||
return FFX_API_RETURN_OK;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -93,27 +124,22 @@ FFX_API_ENTRY ffxReturnCode_t ffxQuery(ffxContext* context, ffxQueryDescHeader*
|
||||
// Overlay read it from the argument and not from anything this stub produced.
|
||||
FFX_API_ENTRY ffxReturnCode_t ffxDispatch(ffxContext* context, const ffxDispatchDescHeader* desc) {
|
||||
(void)context;
|
||||
if (desc == nullptr) {
|
||||
return FFX_API_RETURN_ERROR_PARAMETER;
|
||||
}
|
||||
switch (desc->type) {
|
||||
case FFX_API_DISPATCH_DESC_TYPE_UPSCALE:
|
||||
InterlockedIncrement(&g_upscale);
|
||||
break;
|
||||
case FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE:
|
||||
InterlockedIncrement(&g_prepare);
|
||||
break;
|
||||
case FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE_V2:
|
||||
InterlockedIncrement(&g_prepareV2);
|
||||
break;
|
||||
case FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION:
|
||||
InterlockedIncrement(&g_frameGeneration);
|
||||
break;
|
||||
default:
|
||||
InterlockedIncrement(&g_other);
|
||||
break;
|
||||
}
|
||||
return FFX_API_RETURN_OK;
|
||||
InterlockedIncrement(&g_exportCalls);
|
||||
return DispatchBody(desc);
|
||||
}
|
||||
|
||||
// The DIRECT entry: the same counting, NOT through the ffx-api export, which is how
|
||||
// the loader decoy reaches this leaf -- the shape the real loader was measured to
|
||||
// have. FrameLedger-named, so nothing here pretends to be part of a vendor API, and
|
||||
// never an inventory row.
|
||||
__declspec(dllexport) ffxReturnCode_t FlStubFfxDispatchDirect(ffxContext* context, const ffxDispatchDescHeader* desc) {
|
||||
(void)context;
|
||||
return DispatchBody(desc);
|
||||
}
|
||||
|
||||
// How many dispatches entered through the EXPORT (the hooked one), whichever type.
|
||||
__declspec(dllexport) unsigned int FlStubFfxExportCalls() {
|
||||
return static_cast<unsigned int>(InterlockedCompareExchange(&g_exportCalls, 0, 0));
|
||||
}
|
||||
|
||||
// FrameLedger-named observers, so nothing here pretends to be part of a vendor API.
|
||||
|
||||
Reference in new issue
Block a user