Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8190f4f9c
|
||
|
|
d072094567
|
No files matched your search
@@ -35,6 +35,26 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- **Three more of Streamline's calls are hooked inside a game, only where Advanced metrics was asked for** (owner
|
||||
decisions D129–D131): `slIsFeatureSupported`, `slIsFeatureLoaded` and `slSetFeatureLoaded` — whether Streamline
|
||||
says a feature is supported (its answer, a refusal included), whether it is loaded, and the game switching a
|
||||
feature off and on while it runs. No vendor struct is read for these: the feature's id, a result code, a yes or
|
||||
no. **The adapter a game names when it asks whether a feature is supported is never read**, and the build now
|
||||
refuses code that names what identifies it. As with the four hooks before them, none of the three patches is made
|
||||
in a game no session has asked. Nothing is shown of them yet: the Agent and the App read them in a later pull
|
||||
request. No layout change (5), no schema change (23).
|
||||
- **`slInit` is not hooked, and will not be** (D129). A game starts Streamline once, before FrameLedger can be in
|
||||
it — also when FrameLedger starts the game itself — so a hook there would be a patch that reads nothing.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **A stop that restores many patches no longer leaves its last lines out of the Overlay's log.** Restoring a patch
|
||||
takes about 160 ms, and the wait for the stop's log lines was two seconds whatever the number of patches: with
|
||||
fifteen the log ended "the stop was still writing". The patches were restored; the log did not say so. The wait
|
||||
is now sized to the number of patches a game can hold.
|
||||
|
||||
### Changed
|
||||
|
||||
- **The limitations, the accuracy statement and the user guide no longer say that most sessions will show nothing
|
||||
|
||||
@@ -152,6 +152,13 @@ What the region is, as a contract between the two sides:
|
||||
does not empty them** — the one group that is a fact about the process and not about a session — and
|
||||
`FL_ADV_VALID_SL_FEATURES` stays set with them. `FL_HOOK_SL_FEATURE_VERSION` (bit 15) and
|
||||
`FL_HOOK_SL_FEATURE_REQUIREMENTS` (bit 16) are published with their patches, in a process that was asked.
|
||||
- **Word 1 of a slot carries more since 0.1.0-beta.45** (no layout change): bit 2 `slIsFeatureSupported` answered,
|
||||
with the `sl::Result` it gave in bits 8..15 (0 is `eOk`; a refusal is kept, it is the answer; `0xFF` a code a byte
|
||||
cannot carry); bit 3 `slIsFeatureLoaded` answered and bit 4 what it said; bit 5 the game switched the feature off
|
||||
through `slSetFeatureLoaded`, bit 6 on. **Bits 5 and 6 are a session's and a new request clears them**; every
|
||||
other bit of the word is a fact about the process and stays, as the slot does. A feature Streamline refused has
|
||||
a slot with only that word in it. `FL_HOOK_SL_FEATURE_SUPPORTED` (bit 17), `FL_HOOK_SL_FEATURE_LOADED` (18) and
|
||||
`FL_HOOK_SL_SET_FEATURE_LOADED` (19) are published with their patches.
|
||||
- The Vulkan layer never writes it. `ShmLayoutMirrorTests.TheAdvancedStateMirrorMatches` checks every member's
|
||||
offset against `fl-layout-dump`; `ShmRingReaderTests` the three reads and that the request is stored either way.
|
||||
|
||||
|
||||
@@ -194,9 +194,10 @@ Every hook must be listed here with a purpose. Anything not on this list is not
|
||||
|---|---|
|
||||
| NGX: `NVSDK_NGX_D3D11/D3D12/VULKAN_CreateFeature`, `EvaluateFeature`, `ReleaseFeature` | Which NGX feature is *actually created and evaluated per frame*: SuperSampling (DLSS), RayReconstruction (DLSS-D), FrameGeneration (DLSS-G) |
|
||||
| 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`~~ *(its own row below since beta.43)*, ~~`slGetFeatureRequirements`~~ *(its own row below since beta.44, with `slGetFeatureVersion`)* | Feature set actually active when the game goes through SL rather than NGX directly (`kFeatureDLSS`, `DLSS_G`, `DLSS_RR`, `Reflex`, `NIS`; since beta.34 `kFeatureDLSS_NR` — DLSS 5's neural rendering, its own fact bit and family `FL_HOOK_SL_NEURAL_RENDERING`, D84; rule 4: the `feature` argument of the API hooked, nothing else). **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. **Since 0.1.0-beta.40 (Advanced metrics train B, D111), and only while the Agent asks** (`FlControlBlock.advancedRequested`): the `sl::DLSSOptions` a title chains into `inputs` — the struct the quality mode is read from — is read further: `outputWidth`/`outputHeight`, `preExposure`, `exposureScale`, `colorBuffersHDR`, the five presets of version 1, and where the struct's own `structVersion` proves them present `ultraQualityPreset` and `useAutoExposure` (≥ 2) and `alphaUpscalingEnabled` (≥ 3) — §Which struct version carries which field. Rule 4: more members of the same argument of the same call; `fl_adv_fields.h` is the one place, `tools/overlay-fields-check.ps1` holds it. No new patch site. **Measured** (the header's own functions, `/O2 /guard:cf /Qspectre /MT`, 20 M calls × 3): +9.5–11.7 ns per evaluation that chains the options while asked; with the word at 0, one relaxed load and a branch not taken — below what the bench resolves. Most titles set these through `slDLSSSetOptions`, which is not an export, and read N/A (train D) |
|
||||
| ✅ Streamline: `slEvaluateFeature` · ~~⏳ `slInit`~~ *(not hooked, and not to be: owner decision D129, 2026-11-12 — its row below says why)*, ~~`slSetFeatureLoaded`~~ *(its own row below since beta.45)*, ~~`slSetConstants`~~ *(its own row below since beta.43)*, ~~`slGetFeatureRequirements`~~ *(its own row below since beta.44, with `slGetFeatureVersion`)* | Feature set actually active when the game goes through SL rather than NGX directly (`kFeatureDLSS`, `DLSS_G`, `DLSS_RR`, `Reflex`, `NIS`; since beta.34 `kFeatureDLSS_NR` — DLSS 5's neural rendering, its own fact bit and family `FL_HOOK_SL_NEURAL_RENDERING`, D84; rule 4: the `feature` argument of the API hooked, nothing else). **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. **Since 0.1.0-beta.40 (Advanced metrics train B, D111), and only while the Agent asks** (`FlControlBlock.advancedRequested`): the `sl::DLSSOptions` a title chains into `inputs` — the struct the quality mode is read from — is read further: `outputWidth`/`outputHeight`, `preExposure`, `exposureScale`, `colorBuffersHDR`, the five presets of version 1, and where the struct's own `structVersion` proves them present `ultraQualityPreset` and `useAutoExposure` (≥ 2) and `alphaUpscalingEnabled` (≥ 3) — §Which struct version carries which field. Rule 4: more members of the same argument of the same call; `fl_adv_fields.h` is the one place, `tools/overlay-fields-check.ps1` holds it. No new patch site. **Measured** (the header's own functions, `/O2 /guard:cf /Qspectre /MT`, 20 M calls × 3): +9.5–11.7 ns per evaluation that chains the options while asked; with the word at 0, one relaxed load and a branch not taken — below what the bench resolves. Most titles set these through `slDLSSSetOptions`, which is not an export, and read N/A (train D) |
|
||||
| ✅ Streamline: `slSetConstants` (0.1.0-beta.43, Advanced metrics train B; owner decisions D111–D116, D122) | **What the game tells Streamline about a frame**, once per frame and viewport, read from the `sl::Constants` it passes — rule 4: an argument of the call hooked, and of it only the members named here. **Read:** `jitterOffset`, `mvecScale`, `cameraNear`, `cameraFar`, `cameraFOV`, `cameraAspectRatio` and the seven `Boolean`s (`depthInverted`, `cameraMotionIncluded`, `motionVectors3D`, `reset`, `orthographicProjection`, `motionVectorsDilated`, `motionVectorsJittered`). **Never read:** the five matrices (bytes 32..351 of the struct), `cameraPinholeOffset`, and the camera's position and three axes (bytes 368..423) — `tools/overlay-fields-check.ps1` refuses their names anywhere in code loaded into a game, and ctest `fl_adv_fields` publishes two structs that differ in every one of those bytes and gets the same bytes out. **The one row that is not installed unless asked for** (D111): `InstallByFamily` returns before it resolves the symbol in a process the Agent has never asked for Advanced metrics — resolving takes a reference on the module — so with the option off the export's first bytes are the file's (`fl_guard` `[advanced]` reads them from the target). Once asked, the patch goes in on that watchdog tick and stays for the life of the process; the detour forwards without looking while the request is off, and after a stop (`MayObserve`). **Every call** checks the struct's GUID and a `structVersion` of at least 1 before any member is read, and the viewport handle's the same way; every member read is one version 1 carries, so a version-1 struct laid against unreadable memory is read whole without a fault (the same ctest). **Summaries are the first viewport's**: a title with two viewports sets constants for each every frame, and "the last value" across them would flip twice a frame; the call count is of every viewport. `FLT_MAX` is Streamline's "not set" here and is kept nowhere (D119's plane at infinity is FidelityFX's). Family `FL_HOOK_SL_CONSTANTS` (bit 13), published with the patch: it entitles no field of a frame record, and tells "hooked, never called" from "not hooked". **Measured overhead** (the detour's body on the headers, the Overlay's flags, 20 million calls a run, three runs): not asked **+0.57 / +0.60 / +0.58 ns**; asked, the summarised viewport **+19.61 / +19.54 / +19.79 ns**; asked, another viewport +5.83 / +6.01 / +5.62 ns. |
|
||||
| ✅ Streamline: `slGetFeatureVersion` and `slGetFeatureRequirements` (0.1.0-beta.44, Advanced metrics train B's third step; owner decisions D111–D116, D122) | **What Streamline answers when the game asks about a feature** — which version it is, and what it requires. Two rows, two patches, two detours of one shape: **the original runs first, exactly once, on every path, with both arguments forwarded untouched**, and the struct the game passed is read only when the original said `eOk` — a refusal leaves the struct as the game made it, which is not an answer. Rule 4: an argument of the call hooked, read after the call, and of it only the members named here. **Read from `sl::FeatureVersion`:** `versionSL`, `versionNGX`. **Read from `sl::FeatureRequirements`:** `flags`, `maxNumCPUThreads`, `maxNumViewports`, `numRequiredTags`, `osVersionDetected`, `osVersionRequired`, `driverVersionDetected`, `driverVersionRequired`. **Never read:** `requiredTags` — the pointer the count belongs to — and everything after `driverVersionRequired`: the Vulkan queue counts and the pointers to the names of extensions and features. **No pointer of the game's is followed** (`tools/overlay-fields-check.ps1`, parameters `fv` and `fr`; ctest `fl_adv_fields`: two answers that differ only in those bytes publish the same region, and an answer cut off where the Vulkan members begin, laid against unreadable memory, is read without a fault; the injected `fl_guard` case's stub hands back wild pointers and no fault is counted). **Installed only where asked for** (D111), as `slSetConstants` is: `InstallByFamily` returns before it resolves either symbol in a process the Agent has never asked for Advanced metrics; once in, a patch stays for the life of the process and its detour forwards without looking while the request is off. **They are the first two rows of the table**: a game asks these while it starts, the watchdog patches rows in the table's order, and each patch stops the game's threads for a moment (0.1–0.25 s apart in the owner's logs of 2026-11-12, where `slSetConstants` was the fifth Streamline patch in, 1.9–7.8 s after the attach). In a process never asked they are passed over and the order changes nothing. ~~**Most sessions will still have missed the calls** — an attach after the game's start-up is the usual case — and the session then says the call was hooked and the game did not ask again.~~ *(Measured 2026-11-12, the owner's eight sessions on beta.44: both calls were read in six of six Streamline sessions on five games — Unreal's Streamline plugin asks again after the attach, Cyberpunk 2077 asks again for requirements and not for versions. A game that asks only while starting still reads "hooked, not asked again".)* Three conditions before a read, as for `slSetConstants`: the Agent is asking, observing has not stopped, and the struct carries its own GUID and a version of at least 1 on this call (a struct with another GUID is not kept: the injected case sends one). Every member read is version 1's (§Which struct version carries which field). **Twelve slots** in region 5 (`FlAdvancedState.features`, layout 5 as it was), one per feature in the order first asked about; the last answer about a feature is the one kept; a thirteenth feature is not kept. **A new request does not empty them**: what version a feature is and what it requires are facts about the process, and a second session of a game that kept running would otherwise have nothing where the first had the answer — the one group `Reset` leaves, with its bit of the mask. Streamline 1.x is refused before anything is resolved (`SpeaksStreamline2`). Families `FL_HOOK_SL_FEATURE_VERSION` (bit 15) and `FL_HOOK_SL_FEATURE_REQUIREMENTS` (bit 16), each published with its patch; neither entitles a field of a frame record. **Measured overhead** (the detours' bodies on the headers, the Overlay's flags, 20 million calls a run, three runs, eight features asked about in turn): the version — not asked **+0.58 / +0.61 / +0.58 ns**, asked **+14.82 / +14.54 / +14.47 ns**; the requirements — not asked **+0.58 / +0.63 / +0.61 ns**, asked **+20.88 / +21.01 / +20.96 ns**. A game makes these calls a handful of times. |
|
||||
| ✅ Streamline: `slIsFeatureSupported`, `slIsFeatureLoaded`, `slSetFeatureLoaded` (0.1.0-beta.45; owner decisions D129–D131) | **Whether a feature is supported, whether it is loaded, and the game switching it on and off.** Three rows, three patches. Rule 4: bare arguments and results of the calls hooked, and no vendor struct at all — the feature's id; the `sl::Result` `slIsFeatureSupported` returned, **every result**, since a refusal is the answer to that question (the original runs first, both arguments forwarded untouched); the `bool` `slIsFeatureLoaded` wrote, read only when it returned `eOk`; the `bool` the game passed to `slSetFeatureLoaded`, noted before the call. **The adapter `slIsFeatureSupported` is asked about is never read** (D131): `sl::AdapterInfo` holds the adapter's LUID or a Vulkan physical device; the detour forwards the reference and `tools/overlay-fields-check.ps1` refuses the names of its members (`deviceLUID`, `deviceLUIDSizeInBytes`, `vkPhysicalDevice`) anywhere in the Overlay and the Vulkan layer — the fixture's adapter carries a wild pointer. **Installed only where asked for** (D111), as the four rows before them. `slIsFeatureSupported` and `slIsFeatureLoaded` follow the two rows of beta.44 at the head of the table; `slSetFeatureLoaded` follows `slSetConstants`. **Kept in word 1 of the feature's slot** (region 5, layout 5 as it was): bit 2 and the result in bits 8..15, bits 3 and 4, bits 5 and 6 — the last two a session's, cleared by a new request; the rest the process's, kept (`fl_adv_fields.h` `kFeatureSessionBits`). A refused feature therefore has a slot now, with nothing in it but that word. The declarations of the three functions are the same from Streamline v2.0.0 to v2.14.16, and `sl::Result` is the same forty codes in the same order at all sixteen tags (`include/sl_result.h`, `05a3c7e3889c` … `8a844b68ff55`), so a code means the same whatever interposer answered. Families `FL_HOOK_SL_FEATURE_SUPPORTED` (bit 17), `FL_HOOK_SL_FEATURE_LOADED` (18), `FL_HOOK_SL_SET_FEATURE_LOADED` (19), each published with its patch. **Measured overhead** (the detours' bodies on the headers, the Overlay's flags, 20 million calls a run, three runs, eight features in turn): `slIsFeatureSupported` — not asked **+1.50 / +1.48 / +1.50 ns**, asked **+11.97 / +11.98 / +12.08 ns**; `slIsFeatureLoaded` — **+1.79 / +1.77 / +1.89 ns**, **+12.35 / +12.31 / +12.33 ns**; `slSetFeatureLoaded` — **+1.44 / +1.47 / +1.80 ns**, **+11.28 / +11.54 / +11.45 ns**. **`slInit` is not a row and will not be** (D129): a game calls it once, before the Overlay is in the process or before a patch can land — launch mode waits for the presentation runtime before it injects, nothing is ever patched on a game's thread (§H2), and a row that exists only for Advanced metrics waits for the Agent's request. **A stop takes about 160 ms for every patch it restores** (measured on the fixture, 0.1.0-beta.45: each `MH_DisableHook` snapshots the system's threads): twelve patches took 1.9 s, fifteen 2.4 s, and the watchdog's wait for the stop's log lines, 2 s until then, is now a quarter of a second for every patch the registry can hold. |
|
||||
| ✅ Streamline: `slSetTag` — **and, since 2026-09-05, every tag's TYPE** (`slTagCensus`; a HUD-less / UI tag marks the present `FL_FG_DLSS_G`, rule 4: the same argument) | The **global** resource tags, where a title states the size of the buffer it is upscaling *from*: `kBufferTypeScalingInputColor`'s extent → `renderW/H` — **or, since 2026-09-05, the size the tagged `sl::Resource` declares when the extent is zero** (`TagSize` in `fl_sl_inputs.h`, shared by all three tag routes; GUID-checked; a Resource declaring no size is still the honest unknown). **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 |
|
||||
| ✅ Streamline: `slSetTagForFrame` — **and every tag's TYPE, as above** | The same global tags through **Streamline 2.8's frame-based entry point**, which deprecates `slSetTag`: `(const FrameToken&, const ViewportHandle&, const ResourceTag*, uint32_t, CommandBuffer*)` — the token first, then exactly `slSetTag`'s list, handed to the same tag walk. **Built 2026-09-04** (`FL_HOOK_UPSCALER_PARAMS`, its own trampoline; the family is now **published when whole** — once every tag export the loaded interposer has is patched — because publishing on the first row entitled records the second was not yet producing, 38 of 41 on the fixture: the ffx leaves' #110 defect again, fixed the same way). Measured need: Dying Light: The Beast (SL 2.8.0) published `Dlss` identity on every batch and the params bit on none across three captures, because a 2.8 title that tags per frame never calls the deprecated export. The token is not read; the frame count stays with `slGetNewFrameToken`. The installer picks this detour by SYMBOL (`kSymbolSlSetTagForFrame`, bound to the row by `static_assert`), not by family, since the two rows share a family bit and differ in signature |
|
||||
| ✅ **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 — *since beta.25 the quality byte is the mode the `ffxQuery` row below names for the dispatched size, `0xFF` when none does*) + one COUNT *(since 0.1.0-beta.43, owner decision D125: **counted at the first source that saw an UPSCALE and at no other** — `g_ffxUpscaleOwner`, `fl::adv::Owns`. Cyberpunk 2077's loader 2.3.0 hands a dispatch on to the leaf's export — its frame-generation dispatch types are logged on the loader and on the leaf — so an UPSCALE through such a loader reaches two hooked modules, and one count per module read K = 1 as 2.0 on the fixture bound that way (`--ffx-topology 2x-export`: 60 presents, 120 counted). No title run so far upscales through one; it is a precaution. Measured on the header with the Overlay's flags: +0.02 to +0.03 ns on the module that is counted, about 4 ns less on the forwarded copy)*; **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 — BUILT 2026-09-05 as a fifth AMD target:** `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale` (Cyberpunk's copy; named export, its own descriptor, vendored from tag **`fsr3-v3.0.4`** — the tag whose twelve `ffxFsr3*` declarations match the shipped module, not the `v1.1.4` first named). Rule 4: the detour reads `renderSize` of the descriptor the title passed and nothing else — never the context, a resource or the command list; the offset is pinned to a literal (1256) so a re-vendoring that moved it fails to compile. Same family and publish point as the four rows (`PublishFfxFamilyIfWhole` waits for a loaded host too), keyed by module in the installer; identity `FSR3` as a fact. `ffxFsr3DispatchFrameGeneration` is deliberately not a row (§H11 carries the reversal condition); the `ffx_fsr3upscaler_x64.dll` leaf is the pre-committed alternative if the facade reads silent (row B2) — never both, or `frames/upscale-drained` reads 2.00. **Since 0.1.0-beta.40 (Advanced metrics train B, D111), and only while the Agent asks:** the UPSCALE arm reads the rest of `ffxDispatchDescUpscale` — `enableSharpening`, `sharpness`, `jitterOffset`, `preExposure`, `cameraNear`, `cameraFar`, `cameraFovAngleVertical`, `flags`, `reset`, `frameTimeDelta` — into process-local summaries (an "ever seen" mask, a largest magnitude, a lowest and highest, a count and a sum; one module's dispatches are counted, so a dispatch that reaches the loader and a leaf is one). Never on the FSR 3.0 host's legacy descriptor, which is vouched Line truncated
|
||||
|
||||
@@ -716,8 +716,9 @@ every `nvapi.` row; nothing is estimated in its place (FR-4.9).
|
||||
|---|---|---|---|
|
||||
| A | 0.1.0-beta.39 | read by the Agent only — NVAPI and LibreHardwareMonitor — storage, the page. **Nothing changes in code loaded into a game** | this section |
|
||||
| B | 0.1.0-beta.40, ~~.41, .42~~ ~~.42, .43~~ .42, .43, .44 *(three releases since D113, 2026-11-11; one was planned. Renumbered 2026-11-12, D118: 0.1.0-beta.41 is a fix release for the sensor library, not part of the train. **Four since D122, the same day**: the second step is beta.42 — no new patch site — and beta.43, the two new hooks; the third step is beta.44)* | inside the game: more fields of the Streamline and FidelityFX calls already hooked, and new hooks on functions `sl.interposer.dll` **exports** (`17_HOOK_ENGINE` §Hook inventory's ⏳ rows); shared-memory layout 5 — §Train B below | a plan of its own; overhead measured; each release after the first waits for the owner's run of the one before |
|
||||
| C | ~~0.1.0-beta.41~~ ~~0.1.0-beta.43~~ ~~0.1.0-beta.44~~ 0.1.0-beta.45 *(D118, D122)* | Reflex latency per frame | a spike, then the owner's go or no |
|
||||
| D | ~~0.1.0-beta.42~~ ~~0.1.0-beta.44~~ ~~0.1.0-beta.45~~ 0.1.0-beta.46 *(D118, D122)* | the Streamline feature state behind `slGetFeatureFunction` — DLSS frame generation's, DLSS's, Reflex's | a spike, then the owner's go or no |
|
||||
| B, a fourth step | 0.1.0-beta.45 *(D130, 2026-11-12)* | six more of Streamline's core calls — is a feature supported, is it loaded, the game switching it, its resources allocated and freed, Streamline shut down | hooks installed only where asked for, as in the second and third steps; `slInit` is not among them (D129) |
|
||||
| C | ~~0.1.0-beta.41~~ ~~0.1.0-beta.43~~ ~~0.1.0-beta.44~~ ~~0.1.0-beta.45~~ after 0.1.0-beta.45 *(D118, D122, D130)* | Reflex latency per frame | a spike — written beside beta.45, a document only — then the owner's go or no |
|
||||
| D | ~~0.1.0-beta.42~~ ~~0.1.0-beta.44~~ ~~0.1.0-beta.45~~ ~~0.1.0-beta.46~~ after train C *(D118, D122, D130)* | the Streamline feature state behind `slGetFeatureFunction` — DLSS frame generation's, DLSS's, Reflex's | a spike, then the owner's go or no |
|
||||
|
||||
Rules 4 and 5, the hook inventory, the measured overhead and the anti-cheat guard bind B, C and D exactly as they bind
|
||||
every hook. `sl::Constants` is read without its camera position, axes and matrices: where the camera is, is where the
|
||||
@@ -820,6 +821,20 @@ planning, the design reviewed against the code before it was approved.
|
||||
into a game stayed 0.1.0-beta.40's, line for line, in a release that fixes something else).
|
||||
- **D112 — `slInit` is not hooked in train B.** A game calls it before FrameLedger attaches, so its preferences
|
||||
would almost never be seen. If it is ever hooked: `applicationId`, `projectId` and the paths are never read.
|
||||
- **D129 — `slInit` is not hooked at all** (owner decision 2026-11-12, asked to reopen D112 and shown what was
|
||||
found). No mode of the shipped product is in the game in time: *Play ▸ Start directly* does not create the game
|
||||
suspended — it waits for the presentation runtime, runs the guard, then injects; nothing is ever patched on a
|
||||
game's thread, so a hook lands some hundred milliseconds after its module appears (`17_HOOK_ENGINE`, the loader
|
||||
lock); and a hook that exists only for Advanced metrics waits for the Agent's request, which comes after the
|
||||
attach. A hook on it would be a patch that reads nothing. `sl.init.preferences` says so in the catalog. Most of
|
||||
what it would have told is read another way: which features are loaded (`slIsFeatureLoaded`), and whether a
|
||||
newer plugin than the game's own is in use (the versions of 0.1.0-beta.44).
|
||||
- **D130 — six more core calls in one release, 0.1.0-beta.45**: `slIsFeatureSupported`, `slIsFeatureLoaded`,
|
||||
`slSetFeatureLoaded`, `slAllocateResources`, `slFreeResources`, `slShutdown`. Trains C and D come after it; train
|
||||
C's spike is written beside it, as a document.
|
||||
- **D131 — the adapter a game asks `slIsFeatureSupported` about is never read**: `sl::AdapterInfo` holds its LUID
|
||||
or a Vulkan physical device. The feature's id and the result are all that is kept, and a build check refuses the
|
||||
names of the struct's members in the code loaded into a game.
|
||||
- **D114 — the field of view is a session's range**, lowest to highest, never a series: a series would say when the
|
||||
player aimed.
|
||||
- **D115 — a tail member is read only where it is proven to be there** (`17_HOOK_ENGINE` §Which struct version
|
||||
|
||||
+11
-4
@@ -216,10 +216,14 @@ Agent's log, eight overlay logs and Windows' application log. Advanced metrics w
|
||||
— said the evening beta.44 came out, to be done if beta.44 passed, and then "update and go on" once these
|
||||
sessions were in. It reopens D112 (`slInit` is not hooked in train B; if ever: never `applicationId`,
|
||||
`projectId`, the paths), and `slIsFeatureSupported` is handed an `sl::AdapterInfo` whose `deviceLUID` and
|
||||
`vkPhysicalDevice` are not to be read (D104). **Planned with the owner before any code**: which other parts,
|
||||
what of each is read, the Privacy Policy's wording, and where train C goes.
|
||||
3. **Train C (Reflex latency per frame) and train D** each begin with a spike and end in the owner's go or no; their
|
||||
release numbers follow from item 2's plan.
|
||||
`vkPhysicalDevice` are not to be read (D104). ~~**Planned with the owner before any code**: which other parts,
|
||||
what of each is read, the Privacy Policy's wording, and where train C goes.~~ **Planned and approved 2026-11-12
|
||||
(D129–D131)**: `slInit` stays out — shown why it cannot be seen, the owner chose so; six calls go in, in one
|
||||
release, **0.1.0-beta.45** — `slIsFeatureSupported`, `slIsFeatureLoaded`, `slSetFeatureLoaded`,
|
||||
`slAllocateResources`, `slFreeResources`, `slShutdown`; Privacy Policy 2.19's wording approved with the plan.
|
||||
Pull requests: three hooks, three hooks, the Agent and the App with the policy, the release.
|
||||
3. **Train C (Reflex latency per frame)**: its spike is written beside beta.45, a document only; code waits for the
|
||||
owner's go after reading it. **Train D** after that, the same way.
|
||||
|
||||
### Left open by this session
|
||||
|
||||
@@ -811,6 +815,9 @@ Where each owner decision is recorded — the file and its section, and a label
|
||||
| D126 | [`19_SAFETY_AND_ANTICHEAT.md`](19_SAFETY_AND_ANTICHEAT.md) §Crash & stability safety | the count of early abnormal ends starts again when the user switches hooking on (the consent grant sets it to 0) — it was never set back, so a game once switched off was switched off again by every single such end, under a reason that says "twice" (Lies of P, 2026-11-12) |
|
||||
| D127 | [`19_SAFETY_AND_ANTICHEAT.md`](19_SAFETY_AND_ANTICHEAT.md) §Crash & stability safety | a fault while a game is closing, which a hooked session does not see (Hogwarts Legacy, the driver's `_nvngx.dll`, hooked or not), is written down and not changed in 0.1.0-beta.44 — seeing it would end a user-mode exception for a fault no hook caused; a decision of its own |
|
||||
| D128 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | a field of view over π is shown as the game gave it, with a row that says it is not radians, and is never converted — Cyberpunk 2077 gives Streamline degrees; converting would store a guess at the unit as the game's word |
|
||||
| D129 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | `slInit` is not hooked at all — asked to reopen D112 and shown that no shipped mode is in the game in time (launch mode waits for the presentation runtime, no patch is ever made on a game's thread, an Advanced-only hook waits for the Agent's request), the owner kept it out; a hook there would be a patch that reads nothing |
|
||||
| D130 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | six more Streamline core calls are hooked in one release, 0.1.0-beta.45 — `slIsFeatureSupported`, `slIsFeatureLoaded`, `slSetFeatureLoaded`, `slAllocateResources`, `slFreeResources`, `slShutdown`; trains C and D come after it, and train C's spike is written beside it as a document |
|
||||
| D131 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Hook inventory | the adapter a game asks `slIsFeatureSupported` about (`sl::AdapterInfo`: a LUID, or a Vulkan physical device) is never read — the feature's id and the result only; a build check refuses the struct's member names in code loaded into a game |
|
||||
| D109 | [`../legal/DISCLAIMER.md`](../legal/DISCLAIMER.md) §5, §5A | asked on 2026-11-11 with both sentences quoted: the Disclaimer goes to 2.15 with the Privacy Policy — PawnIO and the admin mode are no longer "for the CPU temperature" alone; with Advanced metrics on they also read the processor's, the memory's and the motherboard's sensors. The admin mode's disclosure follows (`agent-admin-dialog/2`) |
|
||||
|
||||
---
|
||||
|
||||
@@ -41,4 +41,13 @@ public enum HookFamilies
|
||||
|
||||
/// <summary><c>slGetFeatureRequirements</c> is hooked (0.1.0-beta.44) - only where Advanced metrics was ever asked for.</summary>
|
||||
SlFeatureRequirements = 1 << 16,
|
||||
|
||||
/// <summary><c>slIsFeatureSupported</c> is hooked (0.1.0-beta.45) - only where Advanced metrics was ever asked for.</summary>
|
||||
SlFeatureSupported = 1 << 17,
|
||||
|
||||
/// <summary><c>slIsFeatureLoaded</c> is hooked (0.1.0-beta.45) - only where Advanced metrics was ever asked for.</summary>
|
||||
SlFeatureLoaded = 1 << 18,
|
||||
|
||||
/// <summary><c>slSetFeatureLoaded</c> is hooked (0.1.0-beta.45) - only where Advanced metrics was ever asked for.</summary>
|
||||
SlSetFeatureLoaded = 1 << 19,
|
||||
}
|
||||
@@ -302,6 +302,18 @@ public enum FlHookFamily : uint
|
||||
|
||||
/// <summary><c>slGetFeatureRequirements</c> is hooked (0.1.0-beta.44), under the same conditions.</summary>
|
||||
SlFeatureRequirements = 1u << 16,
|
||||
|
||||
/// <summary>
|
||||
/// <c>slIsFeatureSupported</c> is hooked (0.1.0-beta.45, owner decisions D129-D131). Only in a process that was asked
|
||||
/// for Advanced metrics at least once; it entitles no frame field. The adapter the game asks about is never read.
|
||||
/// </summary>
|
||||
SlFeatureSupported = 1u << 17,
|
||||
|
||||
/// <summary><c>slIsFeatureLoaded</c> is hooked (0.1.0-beta.45), under the same conditions.</summary>
|
||||
SlFeatureLoaded = 1u << 18,
|
||||
|
||||
/// <summary><c>slSetFeatureLoaded</c> is hooked (0.1.0-beta.45), under the same conditions.</summary>
|
||||
SlSetFeatureLoaded = 1u << 19,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -197,6 +197,18 @@ struct Accumulators {
|
||||
// Word 1 of a feature slot: which of the two questions has an answer in it.
|
||||
inline constexpr uint32_t kFeatureVersionAnswered = 1u << 0;
|
||||
inline constexpr uint32_t kFeatureRequirementsAnswered = 1u << 1;
|
||||
// 0.1.0-beta.45: whether it is supported (and the sl::Result that said so, in bits 8..15), whether it is loaded (and
|
||||
// what the answer was), and whether the game was seen to switch it off or on.
|
||||
inline constexpr uint32_t kFeatureSupportAnswered = 1u << 2;
|
||||
inline constexpr uint32_t kFeatureLoadedAnswered = 1u << 3;
|
||||
inline constexpr uint32_t kFeatureLoadedValue = 1u << 4;
|
||||
inline constexpr uint32_t kFeatureSwitchedOff = 1u << 5;
|
||||
inline constexpr uint32_t kFeatureSwitchedOn = 1u << 6;
|
||||
inline constexpr uint32_t kFeatureSupportResultShift = 8u;
|
||||
inline constexpr uint32_t kFeatureSupportResultMask = 0xFFu << kFeatureSupportResultShift;
|
||||
// What of word 1 is a SESSION's -- what the game did while it was watched -- and is cleared by a new request. The
|
||||
// rest is a fact about the process (which version, what it requires, whether it is supported and loaded) and stays.
|
||||
inline constexpr uint32_t kFeatureSessionBits = kFeatureSwitchedOff | kFeatureSwitchedOn;
|
||||
|
||||
// Whether `leaf` is the module whose calls a summary counts: the first one seen, and
|
||||
// from then on only it. A title that goes through the loader has the same call
|
||||
@@ -534,6 +546,55 @@ inline void ObserveSlFeatureRequirements(uint32_t feature, const sl::FeatureRequ
|
||||
NoteBits(a.validMask, FL_ADV_VALID_SL_FEATURES);
|
||||
}
|
||||
|
||||
// Some bits of a word replaced by others, the rest left as they are: two detours may be writing different fields of
|
||||
// the same slot's word 1.
|
||||
inline void PutBits(std::atomic<uint32_t>& word, uint32_t mask, uint32_t bits) noexcept {
|
||||
uint32_t seen = word.load(std::memory_order_relaxed);
|
||||
while ((seen & mask) != bits) {
|
||||
if (word.compare_exchange_weak(seen, (seen & ~mask) | bits, std::memory_order_relaxed)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// What slIsFeatureSupported ANSWERED about a feature (0.1.0-beta.45): the sl::Result itself, whatever it is -- a
|
||||
// refusal is the answer to this question, where for a version or a requirement it is the absence of one. The last
|
||||
// answer is the one kept. The adapter the game asked about is not an argument of this function: the detour never
|
||||
// hands it over, and nothing here could read it (owner decision D131).
|
||||
inline void ObserveSlFeatureSupported(uint32_t feature, uint32_t result, Accumulators& a) noexcept {
|
||||
std::atomic<uint32_t>* slot = FeatureSlot(feature, a);
|
||||
if (slot == nullptr) {
|
||||
return;
|
||||
}
|
||||
const uint32_t code = result > 0xFEu ? 0xFFu : result;
|
||||
PutBits(slot[1], kFeatureSupportResultMask | kFeatureSupportAnswered,
|
||||
(code << kFeatureSupportResultShift) | kFeatureSupportAnswered);
|
||||
NoteBits(a.validMask, FL_ADV_VALID_SL_FEATURES);
|
||||
}
|
||||
|
||||
// What slIsFeatureLoaded ANSWERED (0.1.0-beta.45): the caller is the detour, after the original said OK and wrote
|
||||
// the bool. The last answer is the one kept.
|
||||
inline void ObserveSlFeatureLoaded(uint32_t feature, bool loaded, Accumulators& a) noexcept {
|
||||
std::atomic<uint32_t>* slot = FeatureSlot(feature, a);
|
||||
if (slot == nullptr) {
|
||||
return;
|
||||
}
|
||||
PutBits(slot[1], kFeatureLoadedAnswered | kFeatureLoadedValue,
|
||||
kFeatureLoadedAnswered | (loaded ? kFeatureLoadedValue : 0u));
|
||||
NoteBits(a.validMask, FL_ADV_VALID_SL_FEATURES);
|
||||
}
|
||||
|
||||
// What the game told slSetFeatureLoaded (0.1.0-beta.45): off, on, or over a session both. What the game ASKED --
|
||||
// whether Streamline did it is slIsFeatureLoaded's to say.
|
||||
inline void ObserveSlSetFeatureLoaded(uint32_t feature, bool loaded, Accumulators& a) noexcept {
|
||||
std::atomic<uint32_t>* slot = FeatureSlot(feature, a);
|
||||
if (slot == nullptr) {
|
||||
return;
|
||||
}
|
||||
NoteBits(slot[1], loaded ? kFeatureSwitchedOn : kFeatureSwitchedOff);
|
||||
NoteBits(a.validMask, FL_ADV_VALID_SL_FEATURES);
|
||||
}
|
||||
|
||||
// A NEW REQUEST: the summaries start afresh, so a session's ranges, masks and
|
||||
// counts are its own and not those of the session before it in the same game.
|
||||
// THE WATCHDOG'S. A detour running beside it loses nothing that matters: what it
|
||||
@@ -595,6 +656,16 @@ inline void Reset(Accumulators& a) noexcept {
|
||||
a.slAspectBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.slFlagsSeenTrue.store(0u, relaxed);
|
||||
a.slFlagsSeenFalse.store(0u, relaxed);
|
||||
// The feature slots stay; what of their word 1 is a session's does not (0.1.0-beta.45).
|
||||
for (uint32_t i = 0; i < FL_ADV_FEATURE_SLOTS; ++i) {
|
||||
std::atomic<uint32_t>* slot = &a.features[static_cast<size_t>(i) * FL_ADV_FEATURE_WORDS];
|
||||
if (slot[0].load(relaxed) == 0u) {
|
||||
break;
|
||||
}
|
||||
if ((slot[1].load(relaxed) & kFeatureSessionBits) != 0u) {
|
||||
slot[1].fetch_and(~kFeatureSessionBits, relaxed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copies the accumulators into region 5, under the request they answer. THE
|
||||
|
||||
@@ -126,7 +126,9 @@ inline constexpr uint32_t kFamiliesEvaluateFeatureDoesNotImplement =
|
||||
static_cast<uint32_t>(fl::FL_HOOK_REFLEX) | static_cast<uint32_t>(fl::FL_HOOK_VRAM) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY) | static_cast<uint32_t>(fl::FL_HOOK_SL_CONSTANTS) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_FFX_CONFIGURE) | static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_VERSION) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_REQUIREMENTS);
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_REQUIREMENTS) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_SUPPORTED) | static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_LOADED) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_SET_FEATURE_LOADED);
|
||||
|
||||
static_assert((kFamilyEvaluateFeature & kFamiliesEvaluateFeatureDoesNotImplement) == 0u,
|
||||
"the slEvaluateFeature row claims a family its detour does not implement -- hookinventory-check "
|
||||
@@ -211,7 +213,9 @@ inline constexpr uint32_t kFamiliesFfxDispatchDoesNotImplement =
|
||||
static_cast<uint32_t>(fl::FL_HOOK_REFLEX) | static_cast<uint32_t>(fl::FL_HOOK_VRAM) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY) | static_cast<uint32_t>(fl::FL_HOOK_SL_NEURAL_RENDERING) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_CONSTANTS) | static_cast<uint32_t>(fl::FL_HOOK_FFX_CONFIGURE) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_VERSION) | static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_REQUIREMENTS);
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_VERSION) | static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_REQUIREMENTS) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_SUPPORTED) | static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_LOADED) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_SET_FEATURE_LOADED);
|
||||
|
||||
static_assert((kFamilyFfxDispatch & kFamiliesFfxDispatchDoesNotImplement) == 0u,
|
||||
"the ffxDispatch rows claim a family their detour does not implement -- hookinventory-check reads "
|
||||
@@ -336,6 +340,37 @@ static_assert(kFamilySlFeatureRequirements != kFamilyEvaluateFeature &&
|
||||
"InstallByFamily binds a row by EQUALITY on this value -- a collision would hand "
|
||||
"slGetFeatureRequirements' detour to another export, or another's to it");
|
||||
|
||||
// --- Streamline: slIsFeatureSupported, slIsFeatureLoaded, slSetFeatureLoaded (0.1.0-beta.45, D129-D131) ---
|
||||
//
|
||||
// WHETHER A FEATURE IS SUPPORTED, WHETHER IT IS LOADED, AND THE GAME SWITCHING IT ON AND OFF. Bare arguments and
|
||||
// results, no vendor struct: the feature's id, the sl::Result the question was answered with (a refusal IS the
|
||||
// answer to "is it supported"), the bool slIsFeatureLoaded wrote when it said OK, the bool the game passed to
|
||||
// slSetFeatureLoaded. THE ADAPTER slIsFeatureSupported IS ASKED ABOUT IS NEVER READ (D131): sl::AdapterInfo holds
|
||||
// the adapter's LUID or a Vulkan physical device, and the detour forwards the reference without looking at it --
|
||||
// tools/overlay-fields-check.ps1 refuses the names of its members anywhere in the code loaded into a game.
|
||||
//
|
||||
// INSTALLED ONLY WHERE ASKED FOR (D111), a row and a bit each, like every row that exists only for Advanced metrics.
|
||||
// slInit IS NOT A ROW AND WILL NOT BE (D129): a game calls it once, before this DLL is in the process or before a
|
||||
// patch can land -- nothing is ever patched on a game's thread (17_HOOK_ENGINE, the loader lock) -- so a hook on it
|
||||
// would be a patch that reads nothing.
|
||||
inline constexpr uint32_t kFamilySlFeatureSupported = static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_SUPPORTED);
|
||||
inline constexpr uint32_t kFamilySlFeatureLoaded = static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_LOADED);
|
||||
inline constexpr uint32_t kFamilySlSetFeatureLoaded = static_cast<uint32_t>(fl::FL_HOOK_SL_SET_FEATURE_LOADED);
|
||||
// One bit each, and no earlier family holds any of them: InstallByFamily binds a row by EQUALITY on its family, so
|
||||
// a value shared with another row would hand one export's detour to another.
|
||||
inline constexpr uint32_t kFamiliesOfBeta45FeatureState =
|
||||
kFamilySlFeatureSupported | kFamilySlFeatureLoaded | kFamilySlSetFeatureLoaded;
|
||||
static_assert(kFamilySlFeatureSupported != kFamilySlFeatureLoaded &&
|
||||
kFamilySlFeatureSupported != kFamilySlSetFeatureLoaded &&
|
||||
kFamilySlFeatureLoaded != kFamilySlSetFeatureLoaded,
|
||||
"three rows, three detours, three different families");
|
||||
static_assert(((kFamilyEvaluateFeature | kFamilyFfxDispatch | kFamilyFfxQuery | kFamilySlConstants |
|
||||
kFamilySlFeatureVersion | kFamilySlFeatureRequirements |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_PARAMS) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS)) &
|
||||
kFamiliesOfBeta45FeatureState) == 0u,
|
||||
"an earlier family claims a bit of slIsFeatureSupported, slIsFeatureLoaded or slSetFeatureLoaded");
|
||||
|
||||
// --- AMD FidelityFX: ffxConfigure on the same four modules (0.1.0-beta.43, Advanced metrics train B) ---
|
||||
//
|
||||
// HOW THE GAME CONFIGURES FRAME GENERATION: a title calls ffxConfigure with a frame-generation descriptor, usually
|
||||
@@ -354,6 +389,7 @@ static_assert(kFamilyFfxConfigure != kFamilyEvaluateFeature && kFamilyFfxConfigu
|
||||
kFamilyFfxConfigure != kFamilyFfxQuery && kFamilyFfxConfigure != kFamilySlConstants &&
|
||||
kFamilyFfxConfigure != kFamilySlFeatureVersion &&
|
||||
kFamilyFfxConfigure != kFamilySlFeatureRequirements &&
|
||||
(kFamilyFfxConfigure & kFamiliesOfBeta45FeatureState) == 0u &&
|
||||
kFamilyFfxConfigure != static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_PARAMS) &&
|
||||
kFamilyFfxConfigure != static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS),
|
||||
"InstallByFamily binds a row by EQUALITY on this value -- a collision would hand ffxConfigure's detour "
|
||||
@@ -452,11 +488,14 @@ inline int FfxLeafOf(const wchar_t* moduleName) noexcept {
|
||||
#define FL_HOOK_INVENTORY(X) \
|
||||
X(L"sl.interposer.dll", "slGetFeatureVersion", fl::inventory::kFamilySlFeatureVersion) \
|
||||
X(L"sl.interposer.dll", "slGetFeatureRequirements", fl::inventory::kFamilySlFeatureRequirements) \
|
||||
X(L"sl.interposer.dll", "slIsFeatureSupported", fl::inventory::kFamilySlFeatureSupported) \
|
||||
X(L"sl.interposer.dll", "slIsFeatureLoaded", fl::inventory::kFamilySlFeatureLoaded) \
|
||||
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", "slSetTagForFrame", fl::FL_HOOK_UPSCALER_PARAMS) \
|
||||
X(L"sl.interposer.dll", "slGetNewFrameToken", fl::FL_HOOK_FG_EVALUATIONS) \
|
||||
X(L"sl.interposer.dll", "slSetConstants", fl::inventory::kFamilySlConstants) \
|
||||
X(L"sl.interposer.dll", "slSetFeatureLoaded", fl::inventory::kFamilySlSetFeatureLoaded) \
|
||||
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) \
|
||||
@@ -476,7 +515,7 @@ inline int FfxLeafOf(const wchar_t* moduleName) noexcept {
|
||||
#define FL_COUNT_ROW(mod, sym, family) +1u
|
||||
inline constexpr uint32_t kRowCount = 0u FL_HOOK_INVENTORY(FL_COUNT_ROW);
|
||||
#undef FL_COUNT_ROW
|
||||
static_assert(kRowCount == 20u, "a row was added or removed: say so here, and in 17_HOOK_ENGINE §Hook inventory");
|
||||
static_assert(kRowCount == 23u, "a row was added or removed: say so here, and in 17_HOOK_ENGINE §Hook inventory");
|
||||
|
||||
// A row's "module!symbol", for the native log, built at compile time from the row's own two spellings -- so an
|
||||
// install line names the module it patched, and no second list of names exists to drift from the table
|
||||
|
||||
@@ -1184,7 +1184,18 @@ PFN_SlGetFeatureVersion g_origSlGetFeatureVersion = nullptr;
|
||||
PFN_SlGetFeatureRequirements g_origSlGetFeatureRequirements = nullptr;
|
||||
std::atomic<uint32_t> g_slFeatureVersionLive{0};
|
||||
std::atomic<uint32_t> g_slFeatureRequirementsLive{0};
|
||||
std::atomic<uint32_t> g_frameTokens{0};
|
||||
|
||||
// slIsFeatureSupported, slIsFeatureLoaded, slSetFeatureLoaded (0.1.0-beta.45, Advanced metrics): the same terms.
|
||||
using PFN_SlIsFeatureSupported = ::PFun_slIsFeatureSupported*;
|
||||
using PFN_SlIsFeatureLoaded = ::PFun_slIsFeatureLoaded*;
|
||||
using PFN_SlSetFeatureLoaded = ::PFun_slSetFeatureLoaded*;
|
||||
PFN_SlIsFeatureSupported g_origSlIsFeatureSupported = nullptr;
|
||||
PFN_SlIsFeatureLoaded g_origSlIsFeatureLoaded = nullptr;
|
||||
PFN_SlSetFeatureLoaded g_origSlSetFeatureLoaded = nullptr;
|
||||
std::atomic<uint32_t> g_slFeatureSupportedLive{0};
|
||||
std::atomic<uint32_t> g_slFeatureLoadedLive{0};
|
||||
std::atomic<uint32_t> g_slSetFeatureLoadedLive{0};
|
||||
std::atomic<uint32_t> g_frameTokens{0};
|
||||
// The HIGHEST frame index seen so far, tagged in bit 32 so that index 0 is
|
||||
// distinct from "no frame yet". Measured 2026-09-03 on Cyberpunk 2077
|
||||
// (20_OPEN_QUESTIONS §S31, row P4): the title asks for a token 3 to 4.6 times per
|
||||
@@ -1800,6 +1811,43 @@ sl::Result STDMETHODCALLTYPE Hook_SlGetFeatureRequirements(sl::Feature feature,
|
||||
return result;
|
||||
}
|
||||
|
||||
// Whether Streamline says a feature is supported (0.1.0-beta.45). THE ORIGINAL RUNS FIRST, exactly once, with both
|
||||
// arguments forwarded untouched; what is kept is its RESULT -- every result, since "not supported" is an answer to
|
||||
// this question -- and the feature's id. THE ADAPTER IS FORWARDED AND NEVER LOOKED AT (owner decision D131): it
|
||||
// holds the adapter's LUID or a Vulkan physical device, and no member of it is named anywhere in this DLL.
|
||||
sl::Result STDMETHODCALLTYPE Hook_SlIsFeatureSupported(sl::Feature feature, const sl::AdapterInfo& adapterInfo) {
|
||||
const sl::Result result = g_origSlIsFeatureSupported(feature, adapterInfo);
|
||||
FL_HOOK_GUARD({
|
||||
if (g_advancedRequested.load(std::memory_order_relaxed) != 0u && MayObserve()) {
|
||||
fl::adv::ObserveSlFeatureSupported(static_cast<uint32_t>(feature), static_cast<uint32_t>(result), g_adv);
|
||||
}
|
||||
})
|
||||
return result;
|
||||
}
|
||||
|
||||
// Whether Streamline says a feature is loaded (0.1.0-beta.45): the bool it wrote, read as the byte it is, and only
|
||||
// when it said OK -- a refusal leaves the bool as the game made it.
|
||||
sl::Result STDMETHODCALLTYPE Hook_SlIsFeatureLoaded(sl::Feature feature, bool& loaded) {
|
||||
const sl::Result result = g_origSlIsFeatureLoaded(feature, loaded);
|
||||
FL_HOOK_GUARD({
|
||||
if (result == sl::Result::eOk && g_advancedRequested.load(std::memory_order_relaxed) != 0u && MayObserve()) {
|
||||
fl::adv::ObserveSlFeatureLoaded(static_cast<uint32_t>(feature), fl::adv::ByteIsSet(loaded), g_adv);
|
||||
}
|
||||
})
|
||||
return result;
|
||||
}
|
||||
|
||||
// The game switching a feature off or on while it runs (0.1.0-beta.45): what it asked for, noted before the call.
|
||||
// Both arguments forwarded untouched, the original called exactly once on every path.
|
||||
sl::Result STDMETHODCALLTYPE Hook_SlSetFeatureLoaded(sl::Feature feature, bool loaded) {
|
||||
FL_HOOK_GUARD({
|
||||
if (g_advancedRequested.load(std::memory_order_relaxed) != 0u && MayObserve()) {
|
||||
fl::adv::ObserveSlSetFeatureLoaded(static_cast<uint32_t>(feature), loaded, g_adv);
|
||||
}
|
||||
})
|
||||
return g_origSlSetFeatureLoaded(feature, loaded);
|
||||
}
|
||||
|
||||
// slSetTagForFrame: the FrameToken first, then the same list slSetTag takes. The
|
||||
// token is not read -- the frame count comes from slGetNewFrameToken -- and the tag
|
||||
// list is handed to the same NoteTags, because a per-frame tag and a viewport tag
|
||||
@@ -2568,6 +2616,27 @@ bool InstallByFamily(const wchar_t* moduleName, const char* symbol, uint32_t fam
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlGetFeatureRequirements),
|
||||
reinterpret_cast<void**>(&g_origSlGetFeatureRequirements), g_slFeatureRequirementsLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilySlFeatureSupported) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
}
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlIsFeatureSupported),
|
||||
reinterpret_cast<void**>(&g_origSlIsFeatureSupported), g_slFeatureSupportedLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilySlFeatureLoaded) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
}
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlIsFeatureLoaded),
|
||||
reinterpret_cast<void**>(&g_origSlIsFeatureLoaded), g_slFeatureLoadedLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilySlSetFeatureLoaded) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
}
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlSetFeatureLoaded),
|
||||
reinterpret_cast<void**>(&g_origSlSetFeatureLoaded), g_slSetFeatureLoadedLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilyFfxConfigure) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
@@ -3126,7 +3195,15 @@ DWORD WatchdogLoop() noexcept {
|
||||
// safety stop), that thread can still be in its loop when this one flushes: fl_guard's native-log case read the file
|
||||
// with the dxgi line in it and the kernelbase line -- the last patch -- missing for good, under load. So the flush
|
||||
// waits for the stop to say it is done, bounded, and writes STOP_FLUSHED (a = 1 when the stop finished) last.
|
||||
constexpr ULONGLONG kStopLogWaitMs = 2000;
|
||||
//
|
||||
// THE BOUND IS A QUARTER OF A SECOND FOR EVERY PATCH THE REGISTRY CAN HOLD (0.1.0-beta.45). It was 2000 ms. A stop
|
||||
// restores its patches one at a time -- each compared before it is restored (§H7) -- and every MH_DisableHook takes a
|
||||
// snapshot of the system's threads before it suspends this process's: about 160 ms a patch on the development PC.
|
||||
// Twelve patches (the Streamline fixture until then) took 1.9 s and fitted; with three more rows the stop took 2.4 s,
|
||||
// the flush gave up first, and the log ended "the stop was still writing" with the last three UNHOOK_RESTORED lines
|
||||
// missing -- the patches were restored, the log did not say so. The wait ends the moment the stop is logged, so the
|
||||
// longer bound costs nothing where the stop is quick.
|
||||
constexpr ULONGLONG kStopLogWaitMs = 250ull * kMaxPatches;
|
||||
|
||||
DWORD WINAPI WatchdogThread(LPVOID) noexcept {
|
||||
const DWORD r = WatchdogLoop();
|
||||
|
||||
@@ -422,6 +422,12 @@ enum FlHookFamily : uint32_t {
|
||||
// of a frame record.
|
||||
FL_HOOK_SL_FEATURE_VERSION = 1u << 15,
|
||||
FL_HOOK_SL_FEATURE_REQUIREMENTS = 1u << 16,
|
||||
// Three more of Streamline's questions and switches about a feature (0.1.0-beta.45, owner decisions D129-D131):
|
||||
// slIsFeatureSupported, slIsFeatureLoaded, slSetFeatureLoaded -- a bit each, because a patch each, published only
|
||||
// in a process that was asked for Advanced metrics at least once. None entitles a measured field of a frame record.
|
||||
FL_HOOK_SL_FEATURE_SUPPORTED = 1u << 17,
|
||||
FL_HOOK_SL_FEATURE_LOADED = 1u << 18,
|
||||
FL_HOOK_SL_SET_FEATURE_LOADED = 1u << 19,
|
||||
};
|
||||
|
||||
// FlWriterState::runtimeCensus -- which vendor RUNTIME MODULES the loader reported
|
||||
@@ -978,6 +984,10 @@ enum FlAdvancedValid : uint32_t {
|
||||
// thirteenth feature is not kept.
|
||||
// [0] sl::Feature id PLUS ONE; 0 = an empty slot
|
||||
// [1] bit 0: slGetFeatureVersion answered; bit 1: slGetFeatureRequirements answered
|
||||
// (0.1.0-beta.45) bit 2: slIsFeatureSupported answered, and bits 8..15 the sl::Result it gave (0 = eOk;
|
||||
// 0xFF = a code a byte cannot carry); bit 3: slIsFeatureLoaded answered, bit 4 what it said;
|
||||
// bit 5: the game was seen to switch the feature OFF (slSetFeatureLoaded), bit 6: ON -- these two are a
|
||||
// session's and are cleared by a new request; the rest are the process's and stay
|
||||
// [2..4] versionSL major, minor, build [5..7] versionNGX
|
||||
// [8] FeatureRequirementFlags [9] maxNumCPUThreads
|
||||
// [10] maxNumViewports [11] numRequiredTags
|
||||
|
||||
@@ -6980,6 +6980,16 @@ constexpr uint32_t kFeatureIdDlss = 0u;
|
||||
constexpr uint32_t kFeatureIdNis = 2u;
|
||||
constexpr uint32_t kFeatureIdPcl = 4u;
|
||||
constexpr uint32_t kFeatureIdDlssG = 1000u;
|
||||
constexpr uint32_t kFeatureIdReflex = 3u;
|
||||
// Word 1 of a slot as the harness and the stub leave it since 0.1.0-beta.45 (fl_shm.h lists the bits): DLSS - both
|
||||
// questions of beta.44 answered (3), supported with eOk (4), loaded and yes (8 + 16), switched on (64); DLSS frame
|
||||
// generation - the same three, never asked whether loaded, switched off and on (32 + 64); NIS - not supported, the
|
||||
// vendor's code 32 in bits 8..15; Reflex - missing, code 31; PCL - asked only whether loaded, and it is not (8).
|
||||
constexpr uint32_t kAdvFeatureWord1Dlss = 3u | 4u | 8u | 16u | 64u;
|
||||
constexpr uint32_t kAdvFeatureWord1DlssG = 3u | 4u | 32u | 64u;
|
||||
constexpr uint32_t kAdvFeatureWord1Nis = 4u | (32u << 8);
|
||||
constexpr uint32_t kAdvFeatureWord1Reflex = 4u | (31u << 8);
|
||||
constexpr uint32_t kAdvFeatureWord1Pcl = 8u;
|
||||
// ...and hands ffxConfigure a frame-generation configuration before each frame's dispatches (0.1.0-beta.43).
|
||||
constexpr uint32_t kAdvFfxFgFlags = 1u << 4; // FFX_FRAMEGENERATION_FLAG_DRAW_DEBUG_PACING_LINES
|
||||
constexpr int32_t kAdvFfxFgRectWidth = 1920;
|
||||
@@ -7063,9 +7073,15 @@ const uint32_t* FeatureSlotOf(const fl::FlAdvancedState& a, uint32_t feature) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// A slot's words 1..23 against "both questions answered" and the stub's numbers.
|
||||
// Word 1 of the slot region 5 holds for `feature`; 0 where it holds none.
|
||||
uint32_t FeatureWord1(const fl::FlAdvancedState& a, uint32_t feature) {
|
||||
const uint32_t* slot = FeatureSlotOf(a, feature);
|
||||
return slot == nullptr ? 0u : slot[1];
|
||||
}
|
||||
|
||||
// A slot's words 1..23 against "both questions of beta.44 answered" and the stub's numbers.
|
||||
bool FeatureSlotIs(const uint32_t* slot, const uint32_t (&expected)[22]) {
|
||||
if (slot == nullptr || slot[1] != 3u) {
|
||||
if (slot == nullptr || (slot[1] & 3u) != 3u) {
|
||||
return false;
|
||||
}
|
||||
return std::memcmp(slot + 2, expected, sizeof(expected)) == 0;
|
||||
@@ -7351,8 +7367,14 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
const auto slConstants = static_cast<uint32_t>(fl::FL_HOOK_SL_CONSTANTS);
|
||||
const auto slFeatures = static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_VERSION) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_REQUIREMENTS);
|
||||
const char* const featureExports[2] = {"slGetFeatureVersion", "slGetFeatureRequirements"};
|
||||
unsigned char featurePristine[2][16]{};
|
||||
const auto slFeatureState = static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_SUPPORTED) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_LOADED) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_SET_FEATURE_LOADED);
|
||||
constexpr int kFeatureExports = 5;
|
||||
const char* const featureExports[kFeatureExports] = {"slGetFeatureVersion", "slGetFeatureRequirements",
|
||||
"slIsFeatureSupported", "slIsFeatureLoaded",
|
||||
"slSetFeatureLoaded"};
|
||||
unsigned char featurePristine[kFeatureExports][16]{};
|
||||
unsigned char featureNow[16]{};
|
||||
|
||||
// ---- 1. NEVER ASKED (owner decision D111): the evaluation is hooked, the game calls slSetConstants every frame,
|
||||
@@ -7368,9 +7390,10 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
CHECK(RegionFiveIsZero(r));
|
||||
CHECK((r.st->hooksInstalledMask & slConstants) == 0u);
|
||||
CHECK((r.st->hooksInstalledMask & slFeatures) == 0u);
|
||||
CHECK((r.st->hooksInstalledMask & slFeatureState) == 0u);
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, "slSetConstants", now));
|
||||
CHECK(std::memcmp(pristine, now, sizeof(now)) == 0);
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
for (int i = 0; i < kFeatureExports; ++i) {
|
||||
unsigned char featureInFile[16]{};
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, featureExports[i],
|
||||
featurePristine[i], featureInFile));
|
||||
@@ -7382,9 +7405,12 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
REQUIRE(WaitForHookFamily(r.st, slConstants));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_VERSION)));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_REQUIREMENTS)));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_SUPPORTED)));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_LOADED)));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_SET_FEATURE_LOADED)));
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, "slSetConstants", now));
|
||||
CHECK(std::memcmp(pristine, now, sizeof(now)) != 0); // patched now
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
for (int i = 0; i < kFeatureExports; ++i) {
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, featureExports[i], featureNow));
|
||||
CHECK(std::memcmp(featurePristine[i], featureNow, sizeof(featureNow)) != 0);
|
||||
}
|
||||
@@ -7396,7 +7422,10 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
// a feature on one frame in sixteen: read on until the summaries hold all of them (bounded by ReadAdvanced's own
|
||||
// wait, a few publications).
|
||||
for (int i = 0; i < 8 && (a.slResets == 0u || a.slFovMinBits == a.slFovMaxBits ||
|
||||
!FeatureSlotIs(FeatureSlotOf(a, kFeatureIdDlssG), kAdvFeatureDlssG));
|
||||
!FeatureSlotIs(FeatureSlotOf(a, kFeatureIdDlssG), kAdvFeatureDlssG) ||
|
||||
FeatureWord1(a, kFeatureIdDlssG) != kAdvFeatureWord1DlssG ||
|
||||
FeatureWord1(a, kFeatureIdDlss) != kAdvFeatureWord1Dlss ||
|
||||
FeatureWord1(a, kFeatureIdPcl) != kAdvFeatureWord1Pcl);
|
||||
++i) {
|
||||
REQUIRE(ReadAdvanced(r, 1u, a, a.samples, wanted));
|
||||
}
|
||||
@@ -7410,11 +7439,28 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
// back full of 99s -- and NOT the one asked about with a struct whose GUID was broken, which it did answer.
|
||||
CHECK(FeatureSlotIs(FeatureSlotOf(a, kFeatureIdDlss), kAdvFeatureDlss));
|
||||
CHECK(FeatureSlotIs(FeatureSlotOf(a, kFeatureIdDlssG), kAdvFeatureDlssG));
|
||||
CHECK(FeatureSlotOf(a, kFeatureIdNis) == nullptr);
|
||||
CHECK(FeatureSlotOf(a, kFeatureIdPcl) == nullptr);
|
||||
CHECK(a.features[0] == kFeatureIdDlss + 1u);
|
||||
CHECK(a.features[FL_ADV_FEATURE_WORDS] == kFeatureIdDlssG + 1u);
|
||||
CHECK(a.features[size_t{2} * FL_ADV_FEATURE_WORDS] == 0u); // two features, two slots
|
||||
|
||||
// 0.1.0-beta.45: whether each is supported, whether it is loaded, and the game switching it. NIS and Reflex have
|
||||
// a slot now -- a refusal is the answer to "is it supported", kept with its code -- and still none of the version
|
||||
// and requirements the stub refused or of the answer that came with a broken struct: every other word of their
|
||||
// slots is zero. PCL was asked only whether it is loaded; NIS's refused "loaded" (the bool left true) is not kept.
|
||||
CHECK(FeatureWord1(a, kFeatureIdDlss) == kAdvFeatureWord1Dlss);
|
||||
CHECK(FeatureWord1(a, kFeatureIdDlssG) == kAdvFeatureWord1DlssG);
|
||||
CHECK(FeatureWord1(a, kFeatureIdNis) == kAdvFeatureWord1Nis);
|
||||
CHECK(FeatureWord1(a, kFeatureIdReflex) == kAdvFeatureWord1Reflex);
|
||||
CHECK(FeatureWord1(a, kFeatureIdPcl) == kAdvFeatureWord1Pcl);
|
||||
for (const uint32_t refused : {kFeatureIdNis, kFeatureIdReflex, kFeatureIdPcl}) {
|
||||
const uint32_t* slot = FeatureSlotOf(a, refused);
|
||||
REQUIRE(slot != nullptr);
|
||||
bool restIsZero = true;
|
||||
for (uint32_t i = 2; i < FL_ADV_FEATURE_WORDS; ++i) {
|
||||
restIsZero = restIsZero && slot[i] == 0u;
|
||||
}
|
||||
CHECK(restIsZero);
|
||||
}
|
||||
CHECK(a.features[size_t{5} * FL_ADV_FEATURE_WORDS] == 0u); // five features, five slots
|
||||
|
||||
// The options chained into the evaluation, as before.
|
||||
CHECK(a.dlssStructVersion == 3u); // the version these headers declare, which is what entitles the tail
|
||||
@@ -7470,6 +7516,7 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
CHECK(std::memcmp(&held, RegionFive(r), sizeof(held)) == 0);
|
||||
CHECK((r.st->hooksInstalledMask & slConstants) != 0u);
|
||||
CHECK((r.st->hooksInstalledMask & slFeatures) == slFeatures);
|
||||
CHECK((r.st->hooksInstalledMask & slFeatureState) == slFeatureState);
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, "slSetConstants", now));
|
||||
CHECK(std::memcmp(pristine, now, sizeof(now)) != 0);
|
||||
|
||||
@@ -7478,8 +7525,10 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
CHECK(r.st->status == fl::FL_STATUS_READY);
|
||||
|
||||
// ---- 4. STOPPED: the export's first bytes are the file's again, and the log says which patch was restored.
|
||||
// The status is written after the last patch is restored, and a restore is some 160 ms: fifteen patches in this
|
||||
// target since 0.1.0-beta.45, so the wait is ten seconds where three were enough for twelve.
|
||||
r.ctl->unhookRequested = 1;
|
||||
for (int i = 0; i < 60 && r.st->status != fl::FL_STATUS_UNHOOKED; ++i) {
|
||||
for (int i = 0; i < 200 && r.st->status != fl::FL_STATUS_UNHOOKED; ++i) {
|
||||
++r.ctl->guardTicks;
|
||||
Sleep(50);
|
||||
}
|
||||
@@ -7500,7 +7549,7 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
CHECK(std::memcmp(pristine, now, sizeof(now)) == 0);
|
||||
CHECK(text.find("HOOK_INSTALLED sl.interposer.dll!slSetConstants") != std::string::npos);
|
||||
CHECK(text.find("UNHOOK_RESTORED sl.interposer.dll!slSetConstants") != std::string::npos);
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
for (int i = 0; i < kFeatureExports; ++i) {
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, featureExports[i], featureNow));
|
||||
CHECK(std::memcmp(featurePristine[i], featureNow, sizeof(featureNow)) == 0);
|
||||
CHECK(text.find(std::string("HOOK_INSTALLED sl.interposer.dll!") + featureExports[i]) != std::string::npos);
|
||||
|
||||
@@ -126,7 +126,11 @@
|
||||
// slGetFeatureRequirements every sixteenth frame - a real game asks while it starts; this one asks
|
||||
// again so that a hook installed later sees an answer - about DLSS and DLSS frame generation
|
||||
// (answered), NIS (refused, with loud numbers left in the struct) and PCL with a struct whose GUID
|
||||
// is broken (answered, and not to be kept)
|
||||
// is broken (answered, and not to be kept).
|
||||
// Since 0.1.0-beta.45, on the same frames, it asks slIsFeatureSupported about DLSS, DLSS frame
|
||||
// generation, NIS (refused: not supported) and Reflex (refused: missing) with an adapter whose
|
||||
// LUID pointer is wild; asks slIsFeatureLoaded about DLSS (yes), PCL (no) and NIS (refused);
|
||||
// and switches DLSS on and DLSS frame generation on and off through slSetFeatureLoaded
|
||||
// --churn-module <dll>
|
||||
// load and free the module in a loop on a thread of its own, for the life of the process: a
|
||||
// module list that keeps changing under whoever reads it (the guard's D123, 2026-11-12)
|
||||
@@ -2553,6 +2557,50 @@ bool ProbeAdvFields() {
|
||||
Check(twelve,
|
||||
"twelve features fill the twelve slots in order; the thirteenth and feature 0xFFFFFFFF are dropped");
|
||||
|
||||
// 0.1.0-beta.45: WORD 1 OF A SLOT holds more than which question was answered.
|
||||
{
|
||||
fl::adv::Accumulators s;
|
||||
const auto word1 = [&s](uint32_t slot) {
|
||||
return s.features[static_cast<size_t>(slot) * FL_ADV_FEATURE_WORDS + 1u].load();
|
||||
};
|
||||
fl::adv::ObserveSlFeatureVersion(sl::kFeatureDLSS, v, s);
|
||||
fl::adv::ObserveSlFeatureSupported(sl::kFeatureDLSS, 0u, s);
|
||||
fl::adv::ObserveSlFeatureSupported(sl::kFeatureNIS, 32u, s);
|
||||
fl::adv::ObserveSlFeatureLoaded(sl::kFeatureDLSS, true, s);
|
||||
fl::adv::ObserveSlSetFeatureLoaded(sl::kFeatureDLSS, true, s);
|
||||
fl::adv::ObserveSlSetFeatureLoaded(sl::kFeatureDLSS_G, true, s);
|
||||
fl::adv::ObserveSlSetFeatureLoaded(sl::kFeatureDLSS_G, false, s);
|
||||
Check(word1(0) ==
|
||||
(fl::adv::kFeatureVersionAnswered | fl::adv::kFeatureSupportAnswered |
|
||||
fl::adv::kFeatureLoadedAnswered | fl::adv::kFeatureLoadedValue | fl::adv::kFeatureSwitchedOn),
|
||||
"one feature: its version, supported with eOk, loaded and yes, switched on - each its own bits");
|
||||
Check(word1(1) == (fl::adv::kFeatureSupportAnswered | (32u << fl::adv::kFeatureSupportResultShift)),
|
||||
"a refusal IS the answer to 'is it supported': the code is kept in bits 8..15");
|
||||
Check(word1(2) == (fl::adv::kFeatureSwitchedOn | fl::adv::kFeatureSwitchedOff) &&
|
||||
s.features[size_t{2} * FL_ADV_FEATURE_WORDS].load() == sl::kFeatureDLSS_G + 1u,
|
||||
"switched on and then off: both bits, in a slot the switch itself claimed");
|
||||
|
||||
// The last answer replaces the one before, and leaves the neighbouring fields of the word alone.
|
||||
fl::adv::ObserveSlFeatureSupported(sl::kFeatureNIS, 0u, s);
|
||||
fl::adv::ObserveSlFeatureLoaded(sl::kFeatureDLSS, false, s);
|
||||
fl::adv::ObserveSlFeatureSupported(sl::kFeatureDLSS, 31u, s);
|
||||
Check(word1(1) == fl::adv::kFeatureSupportAnswered, "asked again and now supported: the code is 0 again");
|
||||
Check(word1(0) == (fl::adv::kFeatureVersionAnswered | fl::adv::kFeatureSupportAnswered |
|
||||
(31u << fl::adv::kFeatureSupportResultShift) | fl::adv::kFeatureLoadedAnswered |
|
||||
fl::adv::kFeatureSwitchedOn),
|
||||
"a new answer to one question changes its own bits and no other's");
|
||||
fl::adv::ObserveSlFeatureSupported(sl::kFeatureReflex, 4000u, s);
|
||||
Check((word1(3) >> fl::adv::kFeatureSupportResultShift) == 0xFFu,
|
||||
"a code a byte cannot carry is 0xFF, never another code's number");
|
||||
|
||||
// A NEW REQUEST clears what the game DID while it was watched and keeps what Streamline SAID.
|
||||
fl::adv::Reset(s);
|
||||
Check(word1(0) == (fl::adv::kFeatureVersionAnswered | fl::adv::kFeatureSupportAnswered |
|
||||
(31u << fl::adv::kFeatureSupportResultShift) | fl::adv::kFeatureLoadedAnswered) &&
|
||||
word1(2) == 0u && s.features[size_t{2} * FL_ADV_FEATURE_WORDS].load() == sl::kFeatureDLSS_G + 1u,
|
||||
"a new request clears the switches seen and keeps the answers; the slot itself stays claimed");
|
||||
}
|
||||
|
||||
// WHERE THE MEMBERS ARE, by this build's own struct: everything read lies before the Vulkan members, and the
|
||||
// pointer to the tag list sits between two members that are read.
|
||||
const auto at = [&r](const void* member) {
|
||||
@@ -3288,6 +3336,20 @@ int HoldPresentingUpscaled(Gfx& g, int seconds, bool real, sl::Feature feature,
|
||||
Check(false, "the stub exports slGetFeatureVersion and slGetFeatureRequirements");
|
||||
return 1;
|
||||
}
|
||||
// --advanced, 0.1.0-beta.45: whether a feature is supported, whether it is loaded, and switching one.
|
||||
using StubIsFeatureSupportedFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, const sl::AdapterInfo&);
|
||||
using StubIsFeatureLoadedFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, bool&);
|
||||
using StubSetFeatureLoadedFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, bool);
|
||||
auto isFeatureSupported = reinterpret_cast<StubIsFeatureSupportedFn>(
|
||||
reinterpret_cast<void*>(GetProcAddress(stub, "slIsFeatureSupported")));
|
||||
auto isFeatureLoaded =
|
||||
reinterpret_cast<StubIsFeatureLoadedFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slIsFeatureLoaded")));
|
||||
auto setFeatureLoaded =
|
||||
reinterpret_cast<StubSetFeatureLoadedFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slSetFeatureLoaded")));
|
||||
if (advanced && (isFeatureSupported == nullptr || isFeatureLoaded == nullptr || setFeatureLoaded == nullptr)) {
|
||||
Check(false, "the stub exports slIsFeatureSupported, slIsFeatureLoaded and slSetFeatureLoaded");
|
||||
return 1;
|
||||
}
|
||||
sl::Constants constants;
|
||||
sl::Constants otherConstants;
|
||||
sl::ViewportHandle otherViewport{kAdvSlOtherViewport};
|
||||
@@ -3354,6 +3416,20 @@ int HoldPresentingUpscaled(Gfx& g, int seconds, bool real, sl::Feature feature,
|
||||
sl::FeatureVersion broken;
|
||||
broken.structType = sl::StructType{};
|
||||
getFeatureVersion(sl::kFeaturePCL, broken);
|
||||
// 0.1.0-beta.45. The adapter carries a wild pointer where its LUID would be: followed, it faults.
|
||||
sl::AdapterInfo adapter;
|
||||
adapter.deviceLUID = reinterpret_cast<uint8_t*>(static_cast<uintptr_t>(1));
|
||||
adapter.deviceLUIDSizeInBytes = 8;
|
||||
for (const sl::Feature asked :
|
||||
{sl::kFeatureDLSS, sl::kFeatureDLSS_G, sl::kFeatureNIS, sl::kFeatureReflex}) {
|
||||
isFeatureSupported(asked, adapter);
|
||||
}
|
||||
bool loaded = false;
|
||||
isFeatureLoaded(sl::kFeatureDLSS, loaded);
|
||||
isFeatureLoaded(sl::kFeaturePCL, loaded);
|
||||
isFeatureLoaded(sl::kFeatureNIS, loaded);
|
||||
setFeatureLoaded(sl::kFeatureDLSS, true);
|
||||
setFeatureLoaded(sl::kFeatureDLSS_G, (evaluated & 16) != 0);
|
||||
}
|
||||
}
|
||||
// ONE EVALUATION PER PRESENT, which is what a real upscaled title does
|
||||
|
||||
@@ -65,6 +65,10 @@ static_assert(fl::stub::InventoryHas("slGetNewFrameToken"),
|
||||
static_assert(fl::stub::InventoryHas("slGetFeatureVersion") && fl::stub::InventoryHas("slGetFeatureRequirements"),
|
||||
"fl_hook_inventory.h no longer contains \"slGetFeatureVersion\" or \"slGetFeatureRequirements\", so the "
|
||||
"feature fixture would exercise a row the Overlay does not install.");
|
||||
static_assert(fl::stub::InventoryHas("slIsFeatureSupported") && fl::stub::InventoryHas("slIsFeatureLoaded") &&
|
||||
fl::stub::InventoryHas("slSetFeatureLoaded"),
|
||||
"fl_hook_inventory.h no longer contains one of the three feature-state rows of 0.1.0-beta.45, so the "
|
||||
"fixture would exercise a row the Overlay does not install.");
|
||||
static_assert(fl::stub::InventoryHas("slSetConstants"),
|
||||
"fl_hook_inventory.h no longer contains \"slSetConstants\", so the constants fixture would exercise a "
|
||||
"row the Overlay does not install.");
|
||||
@@ -144,9 +148,32 @@ SL_API sl::Result slSetD3DDevice(void* d3dDevice) {
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
|
||||
// An ABI marker, and since 0.1.0-beta.45 a hooked row: DLSS and everything else are loaded, PCL is not, and NIS is
|
||||
// REFUSED after the bool was written true -- a refused answer the Overlay must not keep.
|
||||
SL_API sl::Result slIsFeatureLoaded(sl::Feature feature, bool& loaded) {
|
||||
loaded = feature != sl::kFeaturePCL;
|
||||
return feature == sl::kFeatureNIS ? sl::Result::eErrorFeatureMissing : sl::Result::eOk;
|
||||
}
|
||||
|
||||
// The two other rows of 0.1.0-beta.45. The numbers of the two refusals are what the injected case mirrors
|
||||
// (guard_test.cpp): a code that moved in the vendor's header would otherwise pass here and be mislabelled there.
|
||||
static_assert(static_cast<int>(sl::Result::eErrorFeatureMissing) == 31 &&
|
||||
static_cast<int>(sl::Result::eErrorFeatureNotSupported) == 32,
|
||||
"sl::Result's numbering moved; guard_test.cpp states these two as 31 and 32");
|
||||
|
||||
// DLSS and DLSS frame generation are supported, NIS is not, anything else is missing. The adapter is not looked at
|
||||
// here either; the harness hands one whose LUID pointer is wild.
|
||||
SL_API sl::Result slIsFeatureSupported(sl::Feature feature, const sl::AdapterInfo& adapterInfo) {
|
||||
(void)adapterInfo;
|
||||
if (feature == sl::kFeatureDLSS || feature == sl::kFeatureDLSS_G) {
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
return feature == sl::kFeatureNIS ? sl::Result::eErrorFeatureNotSupported : sl::Result::eErrorFeatureMissing;
|
||||
}
|
||||
|
||||
SL_API sl::Result slSetFeatureLoaded(sl::Feature feature, bool loaded) {
|
||||
(void)feature;
|
||||
loaded = true;
|
||||
(void)loaded;
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,10 @@ $script:Camera = @(
|
||||
'cameraPosition', 'cameraForward'
|
||||
)
|
||||
|
||||
# What identifies the adapter a game asks Streamline about (sl::AdapterInfo, owner decision D131): its LUID, the
|
||||
# size of it, or a Vulkan physical device. Named nowhere in the code loaded into a game.
|
||||
$script:Adapter = @('deviceLUID', 'deviceLUIDSizeInBytes', 'vkPhysicalDevice')
|
||||
|
||||
# The two structs that hold one.
|
||||
$script:CameraStruct = @('sl::Constants', 'ffxDispatchDescFrameGenerationPrepareV2')
|
||||
|
||||
@@ -157,6 +161,9 @@ function Test-Field([string]$Header, [string]$ListText, [hashtable]$Others) {
|
||||
foreach ($token in $script:Camera) {
|
||||
if ($code -cmatch "(?<!\w)$token(?!\w)") { $problems.Add("$key names $token - where a camera is or looks is read nowhere in code loaded into a game (rule 4)") }
|
||||
}
|
||||
foreach ($token in $script:Adapter) {
|
||||
if ($code -cmatch "(?<!\w)$token(?!\w)") { $problems.Add("$key names $token - which adapter a game asks Streamline about is read nowhere in code loaded into a game (D131)") }
|
||||
}
|
||||
foreach ($struct in $script:CameraStruct) {
|
||||
$bare = [regex]::Escape($struct)
|
||||
if ($code -cmatch "sizeof\s*\(\s*$bare\s*\)") { $problems.Add("$key measures ${struct}: the struct holds a camera, and is neither measured nor copied") }
|
||||
@@ -224,6 +231,9 @@ inline void Publish(Accumulators& a, FlAdvancedState* region) noexcept { region-
|
||||
@{ Name = 'the answers about a feature read through their parameters, each member on the list, pass'; Header = $goodHeader + "`ninline void ObserveV(uint32_t feature, const sl::FeatureVersion& fv, Accumulators& a) noexcept { Put(a.f, fv.versionSL); }`ninline void ObserveR(uint32_t feature, const sl::FeatureRequirements& fr, Accumulators& a) noexcept { a.n.store(fr.numRequiredTags); Put(a.f, fr.osVersionDetected); }"; List = $goodList + "sl::FeatureVersion::versionSL`nsl::FeatureRequirements::numRequiredTags`nsl::FeatureRequirements::osVersionDetected`n"; Other = $goodOther; Expect = 0 },
|
||||
@{ Name = 'the list of required tags, a pointer of the game''s, FAILS when it is not on the list'; Header = $goodHeader + "`ninline void ObserveR(uint32_t feature, const sl::FeatureRequirements& fr, Accumulators& a) noexcept { a.n.store(fr.numRequiredTags); Keep(fr.requiredTags[0]); }"; List = $goodList + "sl::FeatureRequirements::numRequiredTags`n"; Other = $goodOther; Expect = 1 },
|
||||
@{ Name = 'a member of the answer read outside the header FAILS'; Header = $goodHeader + "`ninline void ObserveR(uint32_t feature, const sl::FeatureRequirements& fr, Accumulators& a) noexcept { a.n.store(fr.numRequiredTags); }"; List = $goodList + "sl::FeatureRequirements::numRequiredTags`n"; Other = @{ 'dllmain.cpp' = 'void Hook(sl::FeatureRequirements& requirements) { Keep(requirements.numRequiredTags); }' }; Expect = 1 },
|
||||
@{ Name = 'the adapter a game asks about, forwarded by its parameter and never looked into, passes'; Header = $goodHeader; List = $goodList; Other = @{ 'dllmain.cpp' = 'sl::Result Hook(sl::Feature feature, const sl::AdapterInfo& adapterInfo) { return g_orig(feature, adapterInfo); } // never adapterInfo.deviceLUID' }; Expect = 0 },
|
||||
@{ Name = 'the adapter''s LUID read in the detour FAILS'; Header = $goodHeader; List = $goodList; Other = @{ 'dllmain.cpp' = 'sl::Result Hook(sl::Feature feature, const sl::AdapterInfo& adapterInfo) { Keep(adapterInfo.deviceLUID[0]); return g_orig(feature, adapterInfo); }' }; Expect = 1 },
|
||||
@{ Name = 'a Vulkan physical device taken from the adapter in the layer FAILS'; Header = $goodHeader; List = $goodList; Other = @{ 'layer.cpp' = 'void* device = info->vkPhysicalDevice;' }; Expect = 1 },
|
||||
@{ Name = 'a header with no read at all FAILS'; Header = '// o.outputWidth is somewhere else'; List = "# nothing`n"; Other = $goodOther; Expect = 1 }
|
||||
)
|
||||
foreach ($c in $cases) {
|
||||
|
||||
Reference in new issue
Block a user