Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c1a484afc
|
No files matched your search
@@ -71,6 +71,19 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
game belong to the session that asked for them: each session asks with a request of its own, and the agent reads
|
||||
only what answers it.
|
||||
|
||||
- **Advanced metrics: what the game tells DLSS and FSR, kept with the session.** With Advanced metrics on, a session
|
||||
of a game FrameLedger measures from inside now also keeps what the game itself handed to its upscaler: for DLSS the
|
||||
output size, the model preset for each quality mode, whether the game said its colour buffers are HDR,
|
||||
auto-exposure, alpha upscaling and the exposure values; for FSR the sharpening, the largest jitter offset, the
|
||||
exposure, the near and far planes, the **range** of the field of view, the flags, the frame time the game reported
|
||||
(as a chart) and FSR's own video memory at the moments the game asked. The Advanced page shows them under the
|
||||
session, in the vendor's own notation. **Many games will show nothing**, and the session says why — most games
|
||||
set their DLSS options through a call FrameLedger cannot see, and the FSR rows need FSR 3.1 or later through AMD's
|
||||
library; it never means the game uses no upscaler. **Never read:** where the camera is, which way it looks, its
|
||||
matrices. With the option off nothing more is read inside a game, exactly as before. Not yet read from a real game.
|
||||
- **Privacy Policy 2.16** names the above: what is stored, only with the option on and only for a game FrameLedger
|
||||
injects into, and what is never read. You are shown it once after updating.
|
||||
|
||||
### Changed
|
||||
|
||||
- **The agent's processor budget says what was measured.** The specification promised that the capture agent uses
|
||||
@@ -80,6 +93,13 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
The owner chose to keep the readings and amend the limit: **NFR-2 is now ≤ 2.5 % of one core** (D117). Nothing the
|
||||
agent does changes.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **A crash dump is tried up to three times.** When FrameLedger or its agent stops on an error it never expected, a
|
||||
small helper writes a dump of the program for a bug report - while the program's other threads are still
|
||||
running. Windows can fail that once when the program changes under it, and one failure used to mean no dump at
|
||||
all. It is now tried again, twice, a moment apart.
|
||||
|
||||
## Releases
|
||||
|
||||
Newest first. Each file holds that release's section exactly as it stood here.
|
||||
|
||||
@@ -118,6 +118,10 @@ src/
|
||||
# snapshot - each request is the page's hold on it (PR-6, D107). Recording/
|
||||
# AdvancedSessionBuilder stores what a session's samples carried (schema 0023:
|
||||
# machine_profiles + session_advanced, adv.* series with NaN for a gap, D102).
|
||||
# Train B (0.1.0-beta.40, D111): Capture/InGameAdvancedSampler turns the shared
|
||||
# memory's region 5 - what a hooked game told DLSS and FSR, read by the Overlay
|
||||
# only while the session asks (ICaptureObserver.WantsInGameAdvanced) - into session
|
||||
# facts and two adv.* series; reach `Game` in the catalog; no schema change.
|
||||
FrameLedger.Infrastructure/ # SQLite, shm reader, vendor APIs, injector interop, parsers,
|
||||
# and Capture/ (PR-C): ShmRingAttacher/ShmCaptureSink over the
|
||||
# reader, HeldProcessLivenessSource, TargetResolver (path only,
|
||||
|
||||
@@ -176,6 +176,13 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
|
||||
- **Advanced metrics** (since 0.1.0-beta.39; Settings ▸ Recording, off by default) stores more of what the graphics
|
||||
driver and the sensors report with each session. Its limits:
|
||||
- **A session recorded while it was off is not filled in later**, and switching it on applies from the next session.
|
||||
- **What a game tells DLSS and FSR** (since 0.1.0-beta.40) is kept only for a game FrameLedger measures from
|
||||
inside, and only where the game hands it over in a call FrameLedger intercepts. **Most games set their DLSS
|
||||
options through a call it cannot see and show nothing**; the FSR rows need FSR 3.1 or later through AMD's own
|
||||
library. The session says which it was — nothing seen, or not measured inside the game — and neither means the
|
||||
game uses no upscaler. They are the game's words, not a check of what the upscaler did; the field of view is a
|
||||
lowest and highest value, never a line over time; FSR's memory is a point where the game asked, so most sessions
|
||||
have none. **None of it has been read from a real game yet.**
|
||||
- **The driver's own figures** — the card's firmware and architecture, its memory in detail, what a display can do
|
||||
with HDR and variable refresh, the driver's settings for the game — exist on **NVIDIA** cards only. On other cards
|
||||
they read N/A; the card's sensors (fans, voltages, loads) are read on every brand, and none has been tested on an
|
||||
|
||||
@@ -109,6 +109,12 @@ app too (Help ▸ User guide, Help ▸ Limitations, Help ▸ Accessibility), and
|
||||
> been checked against another tool. The processor's, the memory's and the motherboard's need the Agent as
|
||||
> administrator with PawnIO and have never been read on real hardware; a drive's temperature is not read. The
|
||||
> Advanced page shows them as they were stored, and what the PC reads at the moment only while that page is open.
|
||||
> - **What a game tells its upscaler (since beta.40; only with Advanced metrics on, only for a game measured from
|
||||
> inside):** the output size, presets and exposure a game hands DLSS, and the sharpening, jitter, exposure, depth
|
||||
> range, field-of-view range, flags and frame time it hands FSR, are read from the arguments of the calls
|
||||
> FrameLedger intercepts and shown as the game stated them — not checked against what the upscaler did. Most games
|
||||
> set their DLSS options through a call that cannot be intercepted and show none; the FSR values need FSR 3.1 or
|
||||
> later through AMD's own library. None of it has been read from a real game yet.
|
||||
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-vendor
|
||||
> half of the suspicious-module rule. During every capture the Agent re-runs the checks every 30 s and
|
||||
> stops capturing on a refusal: a Direct3D or OpenGL game's hooks are removed, and the Vulkan layer
|
||||
|
||||
@@ -26,6 +26,9 @@ public interface IFrameSource : IAsyncDisposable
|
||||
> DrainResult Drain(Span<FlFrameRecord> into, IList<ulong> gapIndices);
|
||||
> void PublishGuardResult(uint completedEvaluations, bool unhookRequested);
|
||||
> void SetPaused(bool paused); void RequestLogFlush();
|
||||
> FlAdvancedState? AdvancedState { get; } void SetAdvancedRequested(bool requested); // region 5, train B (2026-11-12): the
|
||||
> // word is written either way as the ring is attached, before the first guard result; the region is read only by
|
||||
> // a session whose observer WantsInGameAdvanced, and carried on CaptureProgress.InGameAdvanced
|
||||
> }
|
||||
> public sealed class CaptureSession(...) // the loop: gate → inject → attach → drain, until something ends it
|
||||
> {
|
||||
|
||||
@@ -757,7 +757,11 @@ Sequential embedded SQL (`Migrations/0001_init.sql`, `0002_*.sql`, …), applied
|
||||
> option off has no row** — that absence is how the App says "the option was off when this was recorded" rather than
|
||||
> "nothing answered" — and is never given one. The JSON is `Application.Advanced.AdvancedJson`'s (camel case, nulls
|
||||
> left out, a status by its name); writing is strict, reading is tolerant, and **only a fact whose catalog entry is
|
||||
> read may be written** (`AdvancedJson.Storable`), so no identifier reaches either table (D104). A session deleted
|
||||
> read may be written** (`AdvancedJson.Storable`), so no identifier reaches either table (D104). **Since
|
||||
> 0.1.0-beta.40 (train B) the same row holds what the game told its upscaler** — the session facts of the entries
|
||||
> whose reach is `Game`, after the driver's, and `sources.inGame` (`Reading`, `NothingSeen`, `NotHooked`; absent in
|
||||
> a row beta.39 wrote, which reads as "not said") — and its two series are `adv.ffx.upscale.frame_time_delta` and
|
||||
> `adv.ffx.memory_usage` in `sensor_blobs`. No column and no script: schema 23 as it was. A session deleted
|
||||
> takes its row with it; a profile no session points to is left, as a hardware snapshot is; the retention sweep
|
||||
> removes a session's `adv.` series with its other raw series and keeps its row. Written by the Agent only, in the
|
||||
> session's own transaction (`SqliteSessionRepository.InsertAdvancedAsync`). `LatestVersion` is 23;
|
||||
|
||||
+6
-1
@@ -868,7 +868,12 @@ Tail view of `ui-*.log` / `agent-*.log` (toggle), level filter, search (`ui:Auto
|
||||
> (`SessionSummaryViewModel.HasAdvanced`); it asks for that session through `Services.AdvancedSelection` and
|
||||
> navigates, and a page already on screen takes the request at once.
|
||||
> - **Sources** — every entry of `AdvancedMetricCatalog`: its label, what it belongs to, its source, and *Read*, or
|
||||
> the reason it is not (`AdvReach_*`), or — live — why its source is silent (`AdvSource_*`).
|
||||
> the reason it is not (`AdvReach_*`), or — live — why its source is silent (`AdvSource_*`). An entry read inside
|
||||
> the game (reach `Game`, 0.1.0-beta.40) says *Read inside a game FrameLedger measures, when the game makes the
|
||||
> call* (`Advanced_Status_InGame`): it is not a state of the PC. What became of those entries in one session is in
|
||||
> that session's sources line on the Session tab (`Advanced_InGameLine` with `AdvInGame_*`): read, the game made none
|
||||
> of the calls, or the session was not measured inside the game; a session stored before beta.40 has no such
|
||||
> sentence.
|
||||
>
|
||||
> **Words.** Every catalog entry, group, reason, source state and driver token is a `Strings.resx` key made from its own
|
||||
> name (`Adv_<id>`, `AdvGroup_*`, `AdvReach_*`, `AdvSource_*`, `AdvToken_*`) in `en`, `vi`, `ja`; the English label of
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ The anti-cheat guard is the one component where a bug can cost someone an accoun
|
||||
- **Ring buffer:** SPSC correctness under a hammering writer thread; seqlock torn-read detection; wrap and overwrite-oldest semantics; power-of-two capacity assumptions. Include the **one-full-lap case**: a reader stalled exactly `capacity` records must not validate a different frame as unchanged (this is what the never-reset `seq` counter defends, `07_IPC` §Protocol rules).
|
||||
- **Drop accounting:** the reader-side computation (`writeIndex - readIndex > capacity`) reports the right count and resumes at the right index. The writer has no drop counter to test — by design.
|
||||
- **Torn records produce gap markers,** not silently shortened streams; a golden test asserts the gap does not appear as a stutter.
|
||||
- **Record and header layout:** `static_assert(sizeof(...) == 64)` and `offsetof` assertions for `FlFrameRecord` **and all ~~three~~ ~~four~~ five header structs** *(five since layout 5, 2026-11-11: `FlAdvancedState`, 1472 bytes)* (`FlShmHandshake`, `FlWriterState`, `FlControlBlock`, and `FlDisplayState` since layout 4, beta.10) — plus D33's `FlTolerance`, mirrored the same way *(corrected 2026-10-04)* — the Agent reads across the process boundary in every one of them. Both halves exist as of 2026-08-05: the native side is `layout_test.cpp` plus the `static_assert`s (ctest `fl_shm_layout`), and the runtime offset dump from `tools/fl-layout-dump` is consumed by `ShmLayoutMirrorTests`, which walks the field list in **both directions** and additionally asserts blittability — `Marshal.SizeOf` and every offset stay correct for a mirror that uses `[MarshalAs(ByValTStr)] string`, while `Unsafe.SizeOf` drops from 64 to 40 and the struct can no longer be read from a mapped view.
|
||||
- **Record and header layout:** `static_assert(sizeof(...) == 64)` and `offsetof` assertions for `FlFrameRecord` **and all ~~three~~ ~~four~~ five header structs** *(five since layout 5, 2026-11-11: `FlAdvancedState`, 1472 bytes; what reads and writes it is tested at four levels since 0.1.0-beta.40 — `fl_adv_fields` the Overlay's header alone, `fl_guard` `[advanced]` the injected Overlay with the word off and on, `InGameAdvancedSamplerTests` / `CaptureSessionTests` / `SessionRecorderTests` what the Agent makes of a publication, and `AgentEndToEndTests.WhatTheGameTellsFsrIsStoredOnlyByASessionThatRecordsAdvancedMetrics` the shipped Agent, the real Overlay and the harness: two sessions of one target, the first storing nothing of it)* (`FlShmHandshake`, `FlWriterState`, `FlControlBlock`, and `FlDisplayState` since layout 4, beta.10) — plus D33's `FlTolerance`, mirrored the same way *(corrected 2026-10-04)* — the Agent reads across the process boundary in every one of them. Both halves exist as of 2026-08-05: the native side is `layout_test.cpp` plus the `static_assert`s (ctest `fl_shm_layout`), and the runtime offset dump from `tools/fl-layout-dump` is consumed by `ShmLayoutMirrorTests`, which walks the field list in **both directions** and additionally asserts blittability — `Marshal.SizeOf` and every offset stay correct for a mirror that uses `[MarshalAs(ByValTStr)] string`, while `Unsafe.SizeOf` drops from 64 to 40 and the struct can no longer be read from a mapped view.
|
||||
- **Fault policy:** injected SEH faults in a fake hook body → counter increments, original still called, self-disable at 3.
|
||||
- **Hook index verification, by behaviour.** A vtable slot carries no identity, so "check that slot 8 *is* `Present`" is not a question the runtime can answer — the earlier wording here required something unimplementable. What is answerable: patch the slot, call the method, see whether the detour ran (`17_HOOK_ENGINE` §Getting vtable addresses; proved for slots 8, 13 and 22 in `spike-notes.md` §H4). Runs headless on CI via WARP and `CreateSwapChainForComposition`. A deliberate mismatch aborts installation instead of patching.
|
||||
- **Every probe must be shown to fail.** A probe that ends in an unconditional assertion is green by construction and its ctest is decorative — `fl_proxy_swapchain` shipped in exactly that state. Before a probe counts as a regression net, break the thing it watches and watch it go red.
|
||||
|
||||
+35
-17
@@ -737,6 +737,22 @@ planning, the design reviewed against the code before it was approved.
|
||||
the Agent reads only what answers its own (`07_IPC` §Region 5). The detours consult one process-local flag, the
|
||||
watchdog is the region's one writer, and `fl_guard` shows the off half on a target that sends everything: every
|
||||
byte of the region zero until asked, untouched after an "off", a count that starts again at the next request.
|
||||
**The Agent and the App, 2026-11-12 (PR-4).** A session that records Advanced metrics says so through
|
||||
`ICaptureObserver.WantsInGameAdvanced`; `CaptureSession` writes the word either way as the ring is attached, before
|
||||
its first guard result, and from then on carries each publication of region 5 on `CaptureProgress.InGameAdvanced`
|
||||
— one instance a publication, the same one on the ten ticks between two. `Application.Capture.InGameAdvancedSampler`
|
||||
turns a publication into what a session stores: the session facts of the thirteen `Game` entries below, in the
|
||||
vendor's own words (a preset is its letter, a member its name), and two series —
|
||||
`adv.ffx.upscale.frame_time_delta`, the mean of one second's dispatches, and `adv.ffx.memory_usage`, a point for
|
||||
each second the game asked. The facts are one list until a field they are made of moves, so the recorder's context
|
||||
is rewritten when a range widens and not once a second; the readings ride the newest telemetry sample of the tick.
|
||||
**No schema change**: the facts go into `session_advanced.facts_json` beside the driver's, the series into
|
||||
`sensor_blobs` under their `adv.` names, the `.partial`'s chunks 9 and 10 carry both. `AdvancedSources.InGame`
|
||||
(optional; absent in every row 0.1.0-beta.39 wrote) says what became of those entries in the session: `Reading`,
|
||||
`NothingSeen` — measured inside the game, and the game made none of the calls where they can be seen — or
|
||||
`NotHooked`. The page says it in the session's sources line and, on Sources, that such an entry is read inside a
|
||||
game FrameLedger measures when the game makes the call. The aliasable part of FSR's memory is published and not
|
||||
shown: the catalog has one memory entry.
|
||||
- **D113 — three releases, because a new patch site cannot be proven in CI.** A crash in a game under the user-mode
|
||||
anti-cheat exception's trial ends that exception for good (D38), and every release already means restarting the
|
||||
game. **beta.40**: more fields of calls *already* hooked — `sl::DLSSOptions` where the game chains it into
|
||||
@@ -776,10 +792,12 @@ info-frame controls. `NvAPI_DISP_GetTiming` calculates a timing from an input an
|
||||
|
||||
One row per entry of `AdvancedMetricCatalog`, in its order; `AdvancedMetricCatalogTests` fails when this table and
|
||||
the catalog differ in either direction. **Reach** is where a value can be read from, or why it is not read: `Agent`
|
||||
(the Agent's own process), `AgentElevated` (the same, as administrator with PawnIO), `HookedCall` (an argument of a
|
||||
call the Overlay already hooks — Train B), `NewHook` (a hook that is not built — Train B), `Spike` (Trains C and D),
|
||||
`Refused`, `Deferred`, `Identifier` (D104), `PlayerState` (rule 4), `Licence`, `NotInHeaders`. Only the first two are
|
||||
read by a build of Train A.
|
||||
(the Agent's own process), `AgentElevated` (the same, as administrator with PawnIO), `Game` (read inside a game
|
||||
FrameLedger measures, from the arguments of a call the Overlay hooks, while the session records Advanced metrics —
|
||||
since 0.1.0-beta.40), `HookedCall` (an argument of a call the Overlay already hooks, not read yet), `NewHook` (a hook
|
||||
that is not built — Train B), `Spike` (Trains C and D), `Refused`, `Deferred`, `Identifier` (D104), `PlayerState`
|
||||
(rule 4), `Licence`, `NotInHeaders`. ~~Only the first two are read by a build of Train A.~~ The first three are read
|
||||
(`AdvancedMetric.IsRead`).
|
||||
|
||||
**NVAPI, the graphics card: facts**
|
||||
|
||||
@@ -922,19 +940,19 @@ read by a build of Train A.
|
||||
|
||||
| Id | What it is | Scope | Source | Reach | Unit |
|
||||
|---|---|---|---|---|---|
|
||||
| `sl.dlss.output_size` | The output size the game gave DLSS | SessionFact | Streamline | HookedCall | Text |
|
||||
| `sl.dlss.presets` | The DLSS model preset per quality mode | SessionFact | Streamline | HookedCall | Text |
|
||||
| `sl.dlss.hdr_input` | The game told DLSS its colour buffers are HDR | SessionFact | Streamline | HookedCall | Flag |
|
||||
| `sl.dlss.auto_exposure` | DLSS auto-exposure | SessionFact | Streamline | HookedCall | Flag |
|
||||
| `sl.dlss.alpha_upscaling` | DLSS upscales the alpha channel | SessionFact | Streamline | HookedCall | Flag |
|
||||
| `sl.dlss.exposure` | Pre-exposure and exposure scale given to DLSS | SessionFact | Streamline | HookedCall | Text |
|
||||
| `ffx.upscale.sharpening` | FSR sharpening: on or off, and its strength | SessionFact | FidelityFx | HookedCall | Text |
|
||||
| `ffx.upscale.jitter` | The jitter offsets the game gave FSR | SessionFact | FidelityFx | HookedCall | Text |
|
||||
| `ffx.upscale.exposure` | Pre-exposure given to FSR | SessionFact | FidelityFx | HookedCall | Text |
|
||||
| `ffx.upscale.depth` | Near and far planes and field of view given to FSR | SessionFact | FidelityFx | HookedCall | Text |
|
||||
| `ffx.upscale.flags` | The flags of the game's FSR dispatch | SessionFact | FidelityFx | HookedCall | Text |
|
||||
| `ffx.upscale.frame_time_delta` | The frame time the game reported to FSR | Series | FidelityFx | HookedCall | Milliseconds |
|
||||
| `ffx.memory_usage` | FSR's own video memory, when the game asks it | Series | FidelityFx | HookedCall | Mebibytes |
|
||||
| `sl.dlss.output_size` | The output size the game gave DLSS | SessionFact | Streamline | Game | Text |
|
||||
| `sl.dlss.presets` | The DLSS model preset per quality mode | SessionFact | Streamline | Game | Table |
|
||||
| `sl.dlss.hdr_input` | The game told DLSS its colour buffers are HDR | SessionFact | Streamline | Game | Flag |
|
||||
| `sl.dlss.auto_exposure` | DLSS auto-exposure | SessionFact | Streamline | Game | Flag |
|
||||
| `sl.dlss.alpha_upscaling` | DLSS upscales the alpha channel | SessionFact | Streamline | Game | Flag |
|
||||
| `sl.dlss.exposure` | Pre-exposure and exposure scale given to DLSS | SessionFact | Streamline | Game | Table |
|
||||
| `ffx.upscale.sharpening` | FSR sharpening: on or off, and its strength | SessionFact | FidelityFx | Game | Table |
|
||||
| `ffx.upscale.jitter` | The largest jitter offset the game gave FSR | SessionFact | FidelityFx | Game | Table |
|
||||
| `ffx.upscale.exposure` | Pre-exposure given to FSR | SessionFact | FidelityFx | Game | Text |
|
||||
| `ffx.upscale.depth` | Near and far planes and the range of the field of view given to FSR | SessionFact | FidelityFx | Game | Table |
|
||||
| `ffx.upscale.flags` | The flags of the game's FSR dispatch | SessionFact | FidelityFx | Game | Text |
|
||||
| `ffx.upscale.frame_time_delta` | The frame time the game reported to FSR | Series | FidelityFx | Game | Milliseconds |
|
||||
| `ffx.memory_usage` | FSR's own video memory, when the game asks it | Series | FidelityFx | Game | Mebibytes |
|
||||
|
||||
**Inside the game: hooks that are not built**
|
||||
|
||||
|
||||
@@ -63,6 +63,21 @@ are kept because they record what each version changed and why (owner decision D
|
||||
>
|
||||
> Version 2.5 (2026-09-27, 0.1.0-beta.10) adds how a tracked game's window is shown — read from Windows — and the engine build name read from an Unreal Engine game's executable. It is also the first version to say two things the software already did: it reads the **content** of a library game's executable (markers in its first 8 MB and its import table, since the detection of engines and features; and, when a session starts, the graphics-library markers in the whole file), and it reads the processor load and the memory in use (since 0.1.0-beta.3). Nothing here leaves your device, as before.
|
||||
|
||||
### What version 2.16 of the Privacy Policy changed (0.1.0-beta.40)
|
||||
|
||||
**Advanced metrics inside the game** (train B, owner decisions D111–D116; the content approved with the plan, once
|
||||
for the train's three releases). §1's item on Advanced metrics gains what a session stores **for a game FrameLedger
|
||||
injects into, only while the option is on**: what the game passed to its upscaler in the calls FrameLedger
|
||||
intercepts — the output size, presets and exposure values it gave DLSS, whether it said its colour buffers are HDR,
|
||||
auto-exposure and alpha upscaling; the sharpening, the jitter's size, the exposure, the depth range, the lowest and
|
||||
highest field of view and the flags it gave FSR, the frame time it reported, FSR's own memory when the game asked —
|
||||
and what is never read: where the camera is, which way it looks, its matrices. It also says that switching the option
|
||||
off stops the reading inside a game as well. §4 had always named "the parameters your games pass to the graphics APIs
|
||||
it intercepts"; it now says that with the option on more of the upscaling calls' parameters are read **and stored**,
|
||||
which is what is new. The accuracy block gains an item: these are the game's words to the upscaler, not a check of
|
||||
what the upscaler did, and many games show none. The Disclaimer stays 2.15, as the accuracy statement's additions
|
||||
have not moved it before (beta.19, beta.20, beta.25). §2 is unchanged: nothing is sent.
|
||||
|
||||
### What version 2.15 of the Privacy Policy and of the Disclaimer changed (0.1.0-beta.39)
|
||||
|
||||
**Advanced metrics** (owner decisions D101–D108; the Privacy Policy's content approved with the plan, the Disclaimer's
|
||||
|
||||
@@ -35,6 +35,28 @@ alone — whether variable refresh was in use on the display the game ran on, th
|
||||
the driver's settings for that game — the lowest, average and highest of every reading, and a chart over the
|
||||
session's length.
|
||||
|
||||
### What the game told its upscaler
|
||||
|
||||
For a game FrameLedger measures **from inside** (hooking is on for it), a session recorded with Advanced metrics on
|
||||
also keeps what the game itself handed to DLSS and FSR:
|
||||
|
||||
- **DLSS** — the output size, the model preset for each quality mode, whether the game said its colour buffers are
|
||||
HDR, auto-exposure, alpha upscaling, and the exposure values.
|
||||
- **FSR** — sharpening (on or off, and how strong), the largest jitter offset, the exposure, the near and far planes,
|
||||
the **range** of the field of view over the session, the flags of the call, the frame time the game reported, and
|
||||
FSR's own video memory at the moments the game asked for it.
|
||||
|
||||
These are the game's own words to the upscaler, shown in the vendor's notation (`preExposure`, preset `K`).
|
||||
FrameLedger does not check what the upscaler did with them.
|
||||
|
||||
**Many games will show nothing here**, and the line under the session says why: *the game made none of the calls
|
||||
these are read from* — most games set their DLSS options through a call FrameLedger cannot see, and only games that
|
||||
use FSR 3.1 or later through AMD's own library show the FSR rows — or *the session was not measured inside the game*.
|
||||
It never means the game uses no upscaler; the session's summary still names the upscaler as before.
|
||||
|
||||
**Where the camera is, which way it looks and its matrices are never read.** The field of view is kept as a lowest
|
||||
and a highest value, never as a line over time.
|
||||
|
||||
A session's summary has an **Advanced metrics…** button that opens that session here.
|
||||
|
||||
## Sources
|
||||
@@ -46,7 +68,8 @@ comes from, and whether it is read. Where it is not, the reason is written out:
|
||||
memory's and the motherboard's sensors need both ([Every setting](08-settings.md), *Run the agent as
|
||||
administrator*);
|
||||
- **not present on this PC** — the driver's own figures exist on NVIDIA cards only;
|
||||
- **inside the game — comes with a later release**;
|
||||
- **read inside a game FrameLedger measures, when the game makes the call** — what the game tells DLSS and FSR
|
||||
(above). Some further readings inside the game **come with a later release**;
|
||||
- **never read** — a serial number, a display's identification data, which other programs are encoding, the camera's
|
||||
position in the game. FrameLedger does not read these at all.
|
||||
|
||||
|
||||
@@ -108,6 +108,12 @@
|
||||
> been checked against another tool. The processor's, the memory's and the motherboard's need the Agent as
|
||||
> administrator with PawnIO and have never been read on real hardware; a drive's temperature is not read. The
|
||||
> Advanced page shows them as they were stored, and what the PC reads at the moment only while that page is open.
|
||||
> - **What a game tells its upscaler (since beta.40; only with Advanced metrics on, only for a game measured from
|
||||
> inside):** the output size, presets and exposure a game hands DLSS, and the sharpening, jitter, exposure, depth
|
||||
> range, field-of-view range, flags and frame time it hands FSR, are read from the arguments of the calls
|
||||
> FrameLedger intercepts and shown as the game stated them — not checked against what the upscaler did. Most games
|
||||
> set their DLSS options through a call that cannot be intercepted and show none; the FSR values need FSR 3.1 or
|
||||
> later through AMD's own library. None of it has been read from a real game yet.
|
||||
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-vendor
|
||||
> half of the suspicious-module rule. During every capture the Agent re-runs the checks every 30 s and
|
||||
> stops capturing on a refusal: a Direct3D or OpenGL game's hooks are removed, and the Vulkan layer
|
||||
|
||||
@@ -217,6 +217,12 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
|
||||
> been checked against another tool. The processor's, the memory's and the motherboard's need the Agent as
|
||||
> administrator with PawnIO and have never been read on real hardware; a drive's temperature is not read. The
|
||||
> Advanced page shows them as they were stored, and what the PC reads at the moment only while that page is open.
|
||||
> - **What a game tells its upscaler (since beta.40; only with Advanced metrics on, only for a game measured from
|
||||
> inside):** the output size, presets and exposure a game hands DLSS, and the sharpening, jitter, exposure, depth
|
||||
> range, field-of-view range, flags and frame time it hands FSR, are read from the arguments of the calls
|
||||
> FrameLedger intercepts and shown as the game stated them — not checked against what the upscaler did. Most games
|
||||
> set their DLSS options through a call that cannot be intercepted and show none; the FSR values need FSR 3.1 or
|
||||
> later through AMD's own library. None of it has been read from a real game yet.
|
||||
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-vendor
|
||||
> half of the suspicious-module rule. During every capture the Agent re-runs the checks every 30 s and
|
||||
> stops capturing on a refusal: a Direct3D or OpenGL game's hooks are removed, and the Vulkan layer
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# FrameLedger — Privacy Policy
|
||||
|
||||
**Version:** 2.15 · **Effective:** {{RELEASE_DATE}}
|
||||
**Version:** 2.16 · **Effective:** {{RELEASE_DATE}}
|
||||
|
||||
**Short version: everything stays on your PC. FrameLedger has no accounts, no telemetry, no analytics, and never uploads your data anywhere.**
|
||||
|
||||
@@ -11,7 +11,7 @@ Stored in `%LOCALAPPDATA%\FrameLedger` on your device:
|
||||
- Your game library entries (names, executable paths, metadata you or the app filled in, and whether each one is recorded).
|
||||
- Images you choose for a game (Edit…), copied into the `covers` folder; choosing the store's image again, or removing the game together with its sessions, deletes the copy. Artwork a store's app keeps on your PC, or a game ships in its own folder, is shown from where it is and not copied.
|
||||
- Performance sessions: frame timing series, computed statistics, hardware sensor series (temperatures, load, power, memory usage, and the graphics card's clock speeds, fan speed, memory temperature and whether its power limit or heat held it back), the game's own memory use (its dedicated and shared video memory, private working set, working set and commit, once a second), session duration, crash flags, the graphics driver's settings the game ran under (NVIDIA only), how the game's window was shown (full-screen, borderless or windowed, for how long, its size and the monitor's), tags and notes you write.
|
||||
- **Only while Settings ▸ Advanced metrics is on** (it is off unless you switch it on), with each session: more hardware sensor series — the graphics card's memory use in detail, its load by part, its clocks, voltages, currents, power, each fan and its video encoder's use; and, when the capture agent runs as administrator with PawnIO installed, the processor's temperatures, load, clocks, power and voltages by core, the memory in use and its modules' temperatures, and the motherboard's temperatures, fans and voltages — and a description of the hardware: the graphics card's firmware version, architecture, bus and memory sizes, the graphics driver's package and the chipset it names, the motherboard's and the memory modules' model names, what each connected display can do (the HDR formats it accepts, its brightness range, variable refresh), whether variable refresh was in use on the display the game ran on and the colour space the game presented in, and the graphics driver's settings — its global ones and the ones it holds for the game (NVIDIA only). No serial number, no display identification data (EDID) and no list of other programs is read or stored. Switching the option off stops the reading; what earlier sessions stored stays with them until you delete those sessions.
|
||||
- **Only while Settings ▸ Advanced metrics is on** (it is off unless you switch it on), with each session: more hardware sensor series — the graphics card's memory use in detail, its load by part, its clocks, voltages, currents, power, each fan and its video encoder's use; and, when the capture agent runs as administrator with PawnIO installed, the processor's temperatures, load, clocks, power and voltages by core, the memory in use and its modules' temperatures, and the motherboard's temperatures, fans and voltages — and a description of the hardware: the graphics card's firmware version, architecture, bus and memory sizes, the graphics driver's package and the chipset it names, the motherboard's and the memory modules' model names, what each connected display can do (the HDR formats it accepts, its brightness range, variable refresh), whether variable refresh was in use on the display the game ran on and the colour space the game presented in, and the graphics driver's settings — its global ones and the ones it holds for the game (NVIDIA only). For a game FrameLedger injects into, a session then also stores what the game itself passed to its upscaler in the calls FrameLedger intercepts: the output size, the model presets and the exposure values it gave DLSS, whether it said its colour buffers are HDR, auto-exposure and alpha upscaling; and the sharpening, the size of the jitter, the exposure, the depth range, the lowest and highest field of view and the flags it gave FSR, the frame time it reported to FSR, and FSR's own video memory when the game asked for it — never where the game's camera is, which way it looks, or its matrices. No serial number, no display identification data (EDID) and no list of other programs is read or stored. Switching the option off stops the reading, inside a game as well; what earlier sessions stored stays with them until you delete those sessions.
|
||||
- A hardware snapshot per session (CPU/GPU model, driver version, RAM size, OS build, display mode) used for the "what changed between sessions" feature.
|
||||
- App settings, logs (rotated daily — the app keeps 7 days, the capture agent 14 — including the logs written by the component loaded into games), and, after a crash of the app itself, crash dump files.
|
||||
- Which games you enabled code injection for, and when you consented.
|
||||
@@ -43,7 +43,7 @@ An exported session (CSV or JSON) and a bug report can contain your games' names
|
||||
|
||||
## 4. What the app can technically observe
|
||||
|
||||
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; whether a game you enabled hooking for runs in an app container, and which of Windows' code-protection settings it runs under (for example, accepting only Microsoft-signed code), read from Windows before any injection; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured, the version information of its upscaling, frame-generation and neural-rendering libraries, and whether each was loaded from the game's folder or from the graphics driver's own copy (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling and neural-rendering libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) and, for a game the Xbox app or the Microsoft Store installed, the package files in its install folder that describe it (`MicrosoftGame.config` and `appxmanifest.xml`) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the lists of installed games that the Steam, GOG GALAXY, Epic Games and itch apps keep on your disk, and where GOG GALAXY is installed, the folders the Xbox app installs games into on each drive (named by the `.GamingRoot` file at the drive's root) with each game's package files, and Windows' answer to whether that game's package is installed for you — read when you import your library and when you press Play, to find the store that installed a game and hand the game to that store's app — Steam's and GOG GALAXY's also when you open a game's page, to find the artwork their apps keep for it; the cover and banner images that the Steam and GOG GALAXY apps keep on your disk for a game in your library and the logo and splash-screen images a game from the Xbox app ships in its own folder — read to show them on its page, never copied or sent anywhere; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; and — only while Advanced metrics is on — that driver's description of the graphics card and of each connected display, what it reports about the display a tracked game's window is on, its settings for a tracked game and its global ones (read only), and, when the capture agent runs as administrator with PawnIO installed, the sensors and model names of the processor, the memory and the motherboard (never a drive's), all of which are also read with no game running while the Advanced page is open, to show them there, and are not stored then; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
|
||||
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; whether a game you enabled hooking for runs in an app container, and which of Windows' code-protection settings it runs under (for example, accepting only Microsoft-signed code), read from Windows before any injection; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation) — and, only while Advanced metrics is on, more of the parameters of the upscaling calls, which are then stored with the session (sizes, presets, exposure, sharpening, the jitter's size, the depth range, the range of the field of view, flags, the reported frame time, the upscaler's own memory), never the camera's position, direction or matrices; the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured, the version information of its upscaling, frame-generation and neural-rendering libraries, and whether each was loaded from the game's folder or from the graphics driver's own copy (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling and neural-rendering libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) and, for a game the Xbox app or the Microsoft Store installed, the package files in its install folder that describe it (`MicrosoftGame.config` and `appxmanifest.xml`) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the lists of installed games that the Steam, GOG GALAXY, Epic Games and itch apps keep on your disk, and where GOG GALAXY is installed, the folders the Xbox app installs games into on each drive (named by the `.GamingRoot` file at the drive's root) with each game's package files, and Windows' answer to whether that game's package is installed for you — read when you import your library and when you press Play, to find the store that installed a game and hand the game to that store's app — Steam's and GOG GALAXY's also when you open a game's page, to find the artwork their apps keep for it; the cover and banner images that the Steam and GOG GALAXY apps keep on your disk for a game in your library and the logo and splash-screen images a game from the Xbox app ships in its own folder — read to show them on its page, never copied or sent anywhere; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; and — only while Advanced metrics is on — that driver's description of the graphics card and of each connected display, what it reports about the display a tracked game's window is on, its settings for a tracked game and its global ones (read only), and, when the capture agent runs as administrator with PawnIO installed, the sensors and model names of the processor, the memory and the motherboard (never a drive's), all of which are also read with no game running while the Advanced page is open, to show them there, and are not stored then; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
|
||||
|
||||
It does **not** read game memory outside those API parameters, and does not read game saves, chat, input content, network traffic, or anything unrelated to performance measurement. It records only for programs you added to your library and did not switch recording off for — a program whose recording is off is not watched at all — and injects only into games you individually enabled.
|
||||
|
||||
|
||||
Generated
+42
@@ -260,6 +260,7 @@ public static class Strings
|
||||
nameof(Advanced_Elevation_Hint),
|
||||
nameof(Advanced_Facts_Header),
|
||||
nameof(Advanced_Header),
|
||||
nameof(Advanced_InGameLine),
|
||||
nameof(Advanced_Machine_Intro),
|
||||
nameof(Advanced_Max),
|
||||
nameof(Advanced_Mean),
|
||||
@@ -279,6 +280,7 @@ public static class Strings
|
||||
nameof(Advanced_State_OlderAgent),
|
||||
nameof(Advanced_State_Viewer),
|
||||
nameof(Advanced_State_Waiting),
|
||||
nameof(Advanced_Status_InGame),
|
||||
nameof(Advanced_Status_Read),
|
||||
nameof(Advanced_Status_Readable),
|
||||
nameof(Advanced_Status_SourceSilent),
|
||||
@@ -296,7 +298,12 @@ public static class Strings
|
||||
nameof(AdvGroup_Memory),
|
||||
nameof(AdvGroup_Storage),
|
||||
nameof(AdvGroup_Upscaling),
|
||||
nameof(AdvInGame_NothingSeen),
|
||||
nameof(AdvInGame_NotHooked),
|
||||
nameof(AdvInGame_Reading),
|
||||
nameof(AdvInGame_Unknown),
|
||||
nameof(AdvReach_Deferred),
|
||||
nameof(AdvReach_Game),
|
||||
nameof(AdvReach_HookedCall),
|
||||
nameof(AdvReach_Identifier),
|
||||
nameof(AdvReach_Licence),
|
||||
@@ -321,6 +328,7 @@ public static class Strings
|
||||
nameof(AdvToken_desktop),
|
||||
nameof(AdvToken_discrete),
|
||||
nameof(AdvToken_dolby_vision),
|
||||
nameof(AdvToken_draw_debug_view),
|
||||
nameof(AdvToken_driver_default),
|
||||
nameof(AdvToken_edr),
|
||||
nameof(AdvToken_fpci),
|
||||
@@ -332,8 +340,14 @@ public static class Strings
|
||||
nameof(AdvToken_integrated),
|
||||
nameof(AdvToken_laptop),
|
||||
nameof(AdvToken_no_profile_for_game),
|
||||
nameof(AdvToken_non_linear_color_pq),
|
||||
nameof(AdvToken_non_linear_color_srgb),
|
||||
nameof(AdvToken_none),
|
||||
nameof(AdvToken_not_a_number),
|
||||
nameof(AdvToken_not_supported),
|
||||
nameof(AdvToken_off),
|
||||
nameof(AdvToken_on),
|
||||
nameof(AdvToken_on_and_off),
|
||||
nameof(AdvToken_pci),
|
||||
nameof(AdvToken_pci_express),
|
||||
nameof(AdvToken_rtx_new_feature),
|
||||
@@ -1974,6 +1988,8 @@ public static class Strings
|
||||
|
||||
public static string Advanced_Header => ResourceManager.GetString(nameof(Advanced_Header), Culture) ?? nameof(Advanced_Header);
|
||||
|
||||
public static string Advanced_InGameLine => ResourceManager.GetString(nameof(Advanced_InGameLine), Culture) ?? nameof(Advanced_InGameLine);
|
||||
|
||||
public static string Advanced_Machine_Intro => ResourceManager.GetString(nameof(Advanced_Machine_Intro), Culture) ?? nameof(Advanced_Machine_Intro);
|
||||
|
||||
public static string Advanced_Max => ResourceManager.GetString(nameof(Advanced_Max), Culture) ?? nameof(Advanced_Max);
|
||||
@@ -2012,6 +2028,8 @@ public static class Strings
|
||||
|
||||
public static string Advanced_State_Waiting => ResourceManager.GetString(nameof(Advanced_State_Waiting), Culture) ?? nameof(Advanced_State_Waiting);
|
||||
|
||||
public static string Advanced_Status_InGame => ResourceManager.GetString(nameof(Advanced_Status_InGame), Culture) ?? nameof(Advanced_Status_InGame);
|
||||
|
||||
public static string Advanced_Status_Read => ResourceManager.GetString(nameof(Advanced_Status_Read), Culture) ?? nameof(Advanced_Status_Read);
|
||||
|
||||
public static string Advanced_Status_Readable => ResourceManager.GetString(nameof(Advanced_Status_Readable), Culture) ?? nameof(Advanced_Status_Readable);
|
||||
@@ -2046,8 +2064,18 @@ public static class Strings
|
||||
|
||||
public static string AdvGroup_Upscaling => ResourceManager.GetString(nameof(AdvGroup_Upscaling), Culture) ?? nameof(AdvGroup_Upscaling);
|
||||
|
||||
public static string AdvInGame_NothingSeen => ResourceManager.GetString(nameof(AdvInGame_NothingSeen), Culture) ?? nameof(AdvInGame_NothingSeen);
|
||||
|
||||
public static string AdvInGame_NotHooked => ResourceManager.GetString(nameof(AdvInGame_NotHooked), Culture) ?? nameof(AdvInGame_NotHooked);
|
||||
|
||||
public static string AdvInGame_Reading => ResourceManager.GetString(nameof(AdvInGame_Reading), Culture) ?? nameof(AdvInGame_Reading);
|
||||
|
||||
public static string AdvInGame_Unknown => ResourceManager.GetString(nameof(AdvInGame_Unknown), Culture) ?? nameof(AdvInGame_Unknown);
|
||||
|
||||
public static string AdvReach_Deferred => ResourceManager.GetString(nameof(AdvReach_Deferred), Culture) ?? nameof(AdvReach_Deferred);
|
||||
|
||||
public static string AdvReach_Game => ResourceManager.GetString(nameof(AdvReach_Game), Culture) ?? nameof(AdvReach_Game);
|
||||
|
||||
public static string AdvReach_HookedCall => ResourceManager.GetString(nameof(AdvReach_HookedCall), Culture) ?? nameof(AdvReach_HookedCall);
|
||||
|
||||
public static string AdvReach_Identifier => ResourceManager.GetString(nameof(AdvReach_Identifier), Culture) ?? nameof(AdvReach_Identifier);
|
||||
@@ -2096,6 +2124,8 @@ public static class Strings
|
||||
|
||||
public static string AdvToken_dolby_vision => ResourceManager.GetString(nameof(AdvToken_dolby_vision), Culture) ?? nameof(AdvToken_dolby_vision);
|
||||
|
||||
public static string AdvToken_draw_debug_view => ResourceManager.GetString(nameof(AdvToken_draw_debug_view), Culture) ?? nameof(AdvToken_draw_debug_view);
|
||||
|
||||
public static string AdvToken_driver_default => ResourceManager.GetString(nameof(AdvToken_driver_default), Culture) ?? nameof(AdvToken_driver_default);
|
||||
|
||||
public static string AdvToken_edr => ResourceManager.GetString(nameof(AdvToken_edr), Culture) ?? nameof(AdvToken_edr);
|
||||
@@ -2118,10 +2148,22 @@ public static class Strings
|
||||
|
||||
public static string AdvToken_no_profile_for_game => ResourceManager.GetString(nameof(AdvToken_no_profile_for_game), Culture) ?? nameof(AdvToken_no_profile_for_game);
|
||||
|
||||
public static string AdvToken_non_linear_color_pq => ResourceManager.GetString(nameof(AdvToken_non_linear_color_pq), Culture) ?? nameof(AdvToken_non_linear_color_pq);
|
||||
|
||||
public static string AdvToken_non_linear_color_srgb => ResourceManager.GetString(nameof(AdvToken_non_linear_color_srgb), Culture) ?? nameof(AdvToken_non_linear_color_srgb);
|
||||
|
||||
public static string AdvToken_none => ResourceManager.GetString(nameof(AdvToken_none), Culture) ?? nameof(AdvToken_none);
|
||||
|
||||
public static string AdvToken_not_a_number => ResourceManager.GetString(nameof(AdvToken_not_a_number), Culture) ?? nameof(AdvToken_not_a_number);
|
||||
|
||||
public static string AdvToken_not_supported => ResourceManager.GetString(nameof(AdvToken_not_supported), Culture) ?? nameof(AdvToken_not_supported);
|
||||
|
||||
public static string AdvToken_off => ResourceManager.GetString(nameof(AdvToken_off), Culture) ?? nameof(AdvToken_off);
|
||||
|
||||
public static string AdvToken_on => ResourceManager.GetString(nameof(AdvToken_on), Culture) ?? nameof(AdvToken_on);
|
||||
|
||||
public static string AdvToken_on_and_off => ResourceManager.GetString(nameof(AdvToken_on_and_off), Culture) ?? nameof(AdvToken_on_and_off);
|
||||
|
||||
public static string AdvToken_pci => ResourceManager.GetString(nameof(AdvToken_pci), Culture) ?? nameof(AdvToken_pci);
|
||||
|
||||
public static string AdvToken_pci_express => ResourceManager.GetString(nameof(AdvToken_pci_express), Culture) ?? nameof(AdvToken_pci_express);
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_depth" xml:space="preserve">
|
||||
<value>FSR に渡されたニア/ファー平面と視野角</value>
|
||||
<value>FSR に渡されたニア/ファー平面と視野角の範囲</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_exposure" xml:space="preserve">
|
||||
@@ -62,7 +62,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_jitter" xml:space="preserve">
|
||||
<value>ゲームが FSR に渡したジッター オフセット</value>
|
||||
<value>ゲームが FSR に渡したジッター オフセットの最大値</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_sharpening" xml:space="preserve">
|
||||
@@ -653,6 +653,10 @@
|
||||
<value>詳細メトリクス</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Advanced_InGameLine" xml:space="preserve">
|
||||
<value>ゲーム内: {0}。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Advanced_Machine_Intro" xml:space="preserve">
|
||||
<value>グラフィックス ドライバーとハードウェア センサーが、この PC について現在示している内容です。このページを開いている間、またはゲームを記録している間だけ読み取られ、ここに表示されるものは保存されません。</value>
|
||||
<comment>review</comment>
|
||||
@@ -729,6 +733,10 @@
|
||||
<value>キャプチャ エージェントがソースを開いています…</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Advanced_Status_InGame" xml:space="preserve">
|
||||
<value>FrameLedger が計測するゲーム内で、ゲームがその呼び出しを行ったときに読み取り</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Advanced_Status_Read" xml:space="preserve">
|
||||
<value>読み取り中</value>
|
||||
<comment>review</comment>
|
||||
@@ -797,10 +805,30 @@
|
||||
<value>アップスケーリング</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvInGame_NotHooked" xml:space="preserve">
|
||||
<value>このセッションはゲーム内で計測されていません</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvInGame_NothingSeen" xml:space="preserve">
|
||||
<value>これらを読み取れる呼び出しをゲームが行いませんでした</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvInGame_Reading" xml:space="preserve">
|
||||
<value>ゲーム自身の呼び出しから読み取りました</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvInGame_Unknown" xml:space="preserve">
|
||||
<value>不明</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvReach_Deferred" xml:space="preserve">
|
||||
<value>このリリースでは読み取らない</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvReach_Game" xml:space="preserve">
|
||||
<value>FrameLedger が計測するゲーム内</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvReach_HookedCall" xml:space="preserve">
|
||||
<value>ゲーム内 - 今後のリリースで対応</value>
|
||||
<comment>review</comment>
|
||||
@@ -901,6 +929,10 @@
|
||||
<value>ドライバーの既定値</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_draw_debug_view" xml:space="preserve">
|
||||
<value>デバッグ ビュー</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_edr" xml:space="preserve">
|
||||
<value>EDR</value>
|
||||
<comment>review</comment>
|
||||
@@ -941,6 +973,18 @@
|
||||
<value>ドライバーにこのゲームのプロファイルがない</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_pq" xml:space="preserve">
|
||||
<value>非線形カラー (PQ)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_srgb" xml:space="preserve">
|
||||
<value>非線形カラー (sRGB)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_none" xml:space="preserve">
|
||||
<value>なし</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_not_a_number" xml:space="preserve">
|
||||
<value>数値ではない</value>
|
||||
<comment>review</comment>
|
||||
@@ -949,6 +993,18 @@
|
||||
<value>非対応</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_off" xml:space="preserve">
|
||||
<value>オフ</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_on" xml:space="preserve">
|
||||
<value>オン</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_on_and_off" xml:space="preserve">
|
||||
<value>オンのときとオフのときがあります</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_pci" xml:space="preserve">
|
||||
<value>PCI</value>
|
||||
<comment>review</comment>
|
||||
@@ -1382,7 +1438,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Advanced_Body" xml:space="preserve">
|
||||
<value>セッション中にグラフィックス ドライバーとハードウェア センサーからさらに多くを読み取り、セッションと一緒に保存します - グラフィックス カードのメモリと負荷の詳細、各ファンと電圧、ディスプレイの対応機能、ゲームに対するドライバーの設定など。オフ: 追加の読み取りも保存も行いません。次のセッションから適用され、オフの間に記録したセッションが後から補われることはありません。</value>
|
||||
<value>セッション中にグラフィックス ドライバーとハードウェア センサーからさらに多くを読み取り、セッションと一緒に保存します - グラフィックス カードのメモリと負荷の詳細、各ファンと電圧、ディスプレイの対応機能、ゲームに対するドライバーの設定など。FrameLedger が内部から計測するゲームでは、ゲームが DLSS と FSR に渡す内容 (サイズ、プリセット、シャープニング、露出) も読み取ります - カメラの位置は決して読み取りません。オフ: ゲーム内も含め、追加の読み取りも保存も行いません。次のセッションから適用され、オフの間に記録したセッションが後から補われることはありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Advanced_Label" xml:space="preserve">
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<value>FSR's own video memory, when the game asks it</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_depth" xml:space="preserve">
|
||||
<value>Near and far planes and field of view given to FSR</value>
|
||||
<value>Near and far planes and the range of the field of view given to FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_exposure" xml:space="preserve">
|
||||
<value>Pre-exposure given to FSR</value>
|
||||
@@ -52,7 +52,7 @@
|
||||
<value>The frame time the game reported to FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_jitter" xml:space="preserve">
|
||||
<value>The jitter offsets the game gave FSR</value>
|
||||
<value>The largest jitter offset the game gave FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_sharpening" xml:space="preserve">
|
||||
<value>FSR sharpening: on or off, and its strength</value>
|
||||
@@ -495,6 +495,9 @@
|
||||
<data name="Advanced_Header" xml:space="preserve">
|
||||
<value>Advanced metrics</value>
|
||||
</data>
|
||||
<data name="Advanced_InGameLine" xml:space="preserve">
|
||||
<value>Inside the game: {0}.</value>
|
||||
</data>
|
||||
<data name="Advanced_Machine_Intro" xml:space="preserve">
|
||||
<value>What the graphics driver and the hardware sensors say about this PC right now. It is read only while this page is open or a game is being recorded, and nothing shown here is stored.</value>
|
||||
</data>
|
||||
@@ -552,6 +555,9 @@
|
||||
<data name="Advanced_State_Waiting" xml:space="preserve">
|
||||
<value>The capture agent is opening its sources…</value>
|
||||
</data>
|
||||
<data name="Advanced_Status_InGame" xml:space="preserve">
|
||||
<value>Read inside a game FrameLedger measures, when the game makes the call</value>
|
||||
</data>
|
||||
<data name="Advanced_Status_Read" xml:space="preserve">
|
||||
<value>Read</value>
|
||||
</data>
|
||||
@@ -603,9 +609,24 @@
|
||||
<data name="AdvGroup_Upscaling" xml:space="preserve">
|
||||
<value>Upscaling</value>
|
||||
</data>
|
||||
<data name="AdvInGame_NotHooked" xml:space="preserve">
|
||||
<value>the session was not measured inside the game</value>
|
||||
</data>
|
||||
<data name="AdvInGame_NothingSeen" xml:space="preserve">
|
||||
<value>the game made none of the calls these are read from</value>
|
||||
</data>
|
||||
<data name="AdvInGame_Reading" xml:space="preserve">
|
||||
<value>read from the game's own calls</value>
|
||||
</data>
|
||||
<data name="AdvInGame_Unknown" xml:space="preserve">
|
||||
<value>not known</value>
|
||||
</data>
|
||||
<data name="AdvReach_Deferred" xml:space="preserve">
|
||||
<value>Not read in this release</value>
|
||||
</data>
|
||||
<data name="AdvReach_Game" xml:space="preserve">
|
||||
<value>Inside a game FrameLedger measures</value>
|
||||
</data>
|
||||
<data name="AdvReach_HookedCall" xml:space="preserve">
|
||||
<value>Inside the game - comes with a later release</value>
|
||||
</data>
|
||||
@@ -681,6 +702,9 @@
|
||||
<data name="AdvToken_driver_default" xml:space="preserve">
|
||||
<value>Driver default</value>
|
||||
</data>
|
||||
<data name="AdvToken_draw_debug_view" xml:space="preserve">
|
||||
<value>Debug view</value>
|
||||
</data>
|
||||
<data name="AdvToken_edr" xml:space="preserve">
|
||||
<value>EDR</value>
|
||||
</data>
|
||||
@@ -711,12 +735,30 @@
|
||||
<data name="AdvToken_no_profile_for_game" xml:space="preserve">
|
||||
<value>The driver has no profile for this game</value>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_pq" xml:space="preserve">
|
||||
<value>Non-linear colour, PQ</value>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_srgb" xml:space="preserve">
|
||||
<value>Non-linear colour, sRGB</value>
|
||||
</data>
|
||||
<data name="AdvToken_none" xml:space="preserve">
|
||||
<value>None</value>
|
||||
</data>
|
||||
<data name="AdvToken_not_a_number" xml:space="preserve">
|
||||
<value>Not a number</value>
|
||||
</data>
|
||||
<data name="AdvToken_not_supported" xml:space="preserve">
|
||||
<value>Not supported</value>
|
||||
</data>
|
||||
<data name="AdvToken_off" xml:space="preserve">
|
||||
<value>Off</value>
|
||||
</data>
|
||||
<data name="AdvToken_on" xml:space="preserve">
|
||||
<value>On</value>
|
||||
</data>
|
||||
<data name="AdvToken_on_and_off" xml:space="preserve">
|
||||
<value>On at times, off at others</value>
|
||||
</data>
|
||||
<data name="AdvToken_pci" xml:space="preserve">
|
||||
<value>PCI</value>
|
||||
</data>
|
||||
@@ -1042,7 +1084,7 @@
|
||||
<value>The agent did not answer the rules update.</value>
|
||||
</data>
|
||||
<data name="Settings_Advanced_Body" xml:space="preserve">
|
||||
<value>Read more from the graphics driver and the hardware sensors during a session - the graphics card's memory and load in detail, each fan and voltage, what your display can do, the driver's settings for the game - and store it with the session. Off: nothing more is read or stored. It applies from the next session, and a session recorded while it was off is not filled in later.</value>
|
||||
<value>Read more from the graphics driver and the hardware sensors during a session - the graphics card's memory and load in detail, each fan and voltage, what your display can do, the driver's settings for the game - and, in a game FrameLedger measures from inside, what the game tells DLSS and FSR (sizes, presets, sharpening, exposure - never where the camera is). All of it is stored with the session. Off: nothing more is read or stored, inside a game either. It applies from the next session, and a session recorded while it was off is not filled in later.</value>
|
||||
</data>
|
||||
<data name="Settings_Advanced_Label" xml:space="preserve">
|
||||
<value>Advanced metrics</value>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<value>Bộ nhớ video của riêng FSR, khi game hỏi</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_depth" xml:space="preserve">
|
||||
<value>Mặt phẳng gần, xa và góc nhìn đưa cho FSR</value>
|
||||
<value>Mặt phẳng gần, xa và khoảng góc nhìn đưa cho FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_exposure" xml:space="preserve">
|
||||
<value>Tiền phơi sáng đưa cho FSR</value>
|
||||
@@ -47,7 +47,7 @@
|
||||
<value>Thời gian khung hình game báo cho FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_jitter" xml:space="preserve">
|
||||
<value>Độ lệch jitter game đưa cho FSR</value>
|
||||
<value>Độ lệch jitter lớn nhất game đưa cho FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_sharpening" xml:space="preserve">
|
||||
<value>Làm nét của FSR: bật hay tắt, và cường độ</value>
|
||||
@@ -490,6 +490,9 @@
|
||||
<data name="Advanced_Header" xml:space="preserve">
|
||||
<value>Thông số nâng cao</value>
|
||||
</data>
|
||||
<data name="Advanced_InGameLine" xml:space="preserve">
|
||||
<value>Bên trong game: {0}.</value>
|
||||
</data>
|
||||
<data name="Advanced_Machine_Intro" xml:space="preserve">
|
||||
<value>Những gì driver đồ hoạ và các cảm biến phần cứng cho biết về máy này lúc này. Chỉ được đọc khi trang này đang mở hoặc đang ghi một game, và những gì hiện ở đây không được lưu.</value>
|
||||
</data>
|
||||
@@ -547,6 +550,9 @@
|
||||
<data name="Advanced_State_Waiting" xml:space="preserve">
|
||||
<value>Capture agent đang mở các nguồn đọc…</value>
|
||||
</data>
|
||||
<data name="Advanced_Status_InGame" xml:space="preserve">
|
||||
<value>Được đọc bên trong game mà FrameLedger đo, khi game thực hiện lời gọi đó</value>
|
||||
</data>
|
||||
<data name="Advanced_Status_Read" xml:space="preserve">
|
||||
<value>Đang đọc</value>
|
||||
</data>
|
||||
@@ -598,9 +604,24 @@
|
||||
<data name="AdvGroup_Upscaling" xml:space="preserve">
|
||||
<value>Nâng cấp hình ảnh</value>
|
||||
</data>
|
||||
<data name="AdvInGame_NotHooked" xml:space="preserve">
|
||||
<value>phiên này không được đo bên trong game</value>
|
||||
</data>
|
||||
<data name="AdvInGame_NothingSeen" xml:space="preserve">
|
||||
<value>game không thực hiện lời gọi nào để đọc các mục này</value>
|
||||
</data>
|
||||
<data name="AdvInGame_Reading" xml:space="preserve">
|
||||
<value>đã đọc từ chính các lời gọi của game</value>
|
||||
</data>
|
||||
<data name="AdvInGame_Unknown" xml:space="preserve">
|
||||
<value>không rõ</value>
|
||||
</data>
|
||||
<data name="AdvReach_Deferred" xml:space="preserve">
|
||||
<value>Không đọc trong bản phát hành này</value>
|
||||
</data>
|
||||
<data name="AdvReach_Game" xml:space="preserve">
|
||||
<value>Bên trong game mà FrameLedger đo</value>
|
||||
</data>
|
||||
<data name="AdvReach_HookedCall" xml:space="preserve">
|
||||
<value>Bên trong game - sẽ có ở bản phát hành sau</value>
|
||||
</data>
|
||||
@@ -676,6 +697,9 @@
|
||||
<data name="AdvToken_driver_default" xml:space="preserve">
|
||||
<value>Mặc định của driver</value>
|
||||
</data>
|
||||
<data name="AdvToken_draw_debug_view" xml:space="preserve">
|
||||
<value>Chế độ xem gỡ lỗi</value>
|
||||
</data>
|
||||
<data name="AdvToken_edr" xml:space="preserve">
|
||||
<value>EDR</value>
|
||||
</data>
|
||||
@@ -706,12 +730,30 @@
|
||||
<data name="AdvToken_no_profile_for_game" xml:space="preserve">
|
||||
<value>Driver không có profile cho game này</value>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_pq" xml:space="preserve">
|
||||
<value>Màu phi tuyến, PQ</value>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_srgb" xml:space="preserve">
|
||||
<value>Màu phi tuyến, sRGB</value>
|
||||
</data>
|
||||
<data name="AdvToken_none" xml:space="preserve">
|
||||
<value>Không có</value>
|
||||
</data>
|
||||
<data name="AdvToken_not_a_number" xml:space="preserve">
|
||||
<value>Không phải số</value>
|
||||
</data>
|
||||
<data name="AdvToken_not_supported" xml:space="preserve">
|
||||
<value>Không hỗ trợ</value>
|
||||
</data>
|
||||
<data name="AdvToken_off" xml:space="preserve">
|
||||
<value>Tắt</value>
|
||||
</data>
|
||||
<data name="AdvToken_on" xml:space="preserve">
|
||||
<value>Bật</value>
|
||||
</data>
|
||||
<data name="AdvToken_on_and_off" xml:space="preserve">
|
||||
<value>Lúc bật, lúc tắt</value>
|
||||
</data>
|
||||
<data name="AdvToken_pci" xml:space="preserve">
|
||||
<value>PCI</value>
|
||||
</data>
|
||||
@@ -1037,7 +1079,7 @@
|
||||
<value>Agent không phản hồi yêu cầu cập nhật quy tắc.</value>
|
||||
</data>
|
||||
<data name="Settings_Advanced_Body" xml:space="preserve">
|
||||
<value>Đọc thêm từ driver đồ hoạ và các cảm biến phần cứng trong lúc ghi phiên - bộ nhớ và tải của card đồ hoạ ở mức chi tiết, từng quạt và điện áp, khả năng của màn hình, thiết lập của driver cho game - và lưu cùng phiên. Tắt: không đọc và không lưu thêm gì. Áp dụng từ phiên kế tiếp; phiên đã ghi lúc tắt sẽ không được bổ sung về sau.</value>
|
||||
<value>Đọc thêm từ driver đồ hoạ và các cảm biến phần cứng trong lúc ghi phiên - bộ nhớ và tải của card đồ hoạ ở mức chi tiết, từng quạt và điện áp, khả năng của màn hình, thiết lập của driver cho game - và, với game mà FrameLedger đo từ bên trong, những gì game đưa cho DLSS và FSR (kích thước, preset, làm nét, phơi sáng - không bao giờ là vị trí camera). Tất cả được lưu cùng phiên. Tắt: không đọc và không lưu thêm gì, kể cả bên trong game. Áp dụng từ phiên kế tiếp; phiên đã ghi lúc tắt sẽ không được bổ sung về sau.</value>
|
||||
</data>
|
||||
<data name="Settings_Advanced_Label" xml:space="preserve">
|
||||
<value>Thông số nâng cao</value>
|
||||
|
||||
@@ -47,6 +47,9 @@ public static class AdvancedLabels
|
||||
|
||||
public static string Status(AdvancedSourceStatus status) => Lookup("AdvSource_" + status) ?? status.ToString();
|
||||
|
||||
/// <summary>What became, in one session, of the entries read inside the game (0.1.0-beta.40).</summary>
|
||||
public static string InGame(AdvancedInGameStatus status) => Lookup("AdvInGame_" + status) ?? status.ToString();
|
||||
|
||||
/// <summary>A token the driver's answer was mapped to; the token itself where this build has no word for it.</summary>
|
||||
public static string Token(string token) => Lookup("AdvToken_" + token) ?? token;
|
||||
|
||||
|
||||
@@ -179,12 +179,18 @@ public static class AdvancedPresenter
|
||||
public static string SourcesLine(AdvancedSources sources)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(sources);
|
||||
return string.Format(
|
||||
string line = string.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
Strings.Advanced_SourcesLine,
|
||||
AdvancedLabels.Status(sources.Nvapi),
|
||||
AdvancedLabels.Status(sources.Sensors),
|
||||
AdvancedLabels.Status(sources.ElevatedSensors));
|
||||
|
||||
// A session's row also says what became of the entries read inside the game; the machine's live state and a
|
||||
// row stored before 0.1.0-beta.40 do not, and then the sentence is not there.
|
||||
return sources.InGame is { } inGame
|
||||
? line + " " + string.Format(CultureInfo.CurrentCulture, Strings.Advanced_InGameLine, AdvancedLabels.InGame(inGame))
|
||||
: line;
|
||||
}
|
||||
|
||||
private static string StatusOf(AdvancedMetric metric, AdvancedSources? now)
|
||||
@@ -194,6 +200,12 @@ public static class AdvancedPresenter
|
||||
return AdvancedLabels.Reach(metric.Reach);
|
||||
}
|
||||
|
||||
if (metric.Reach == AdvancedReach.Game)
|
||||
{
|
||||
// Not a state of the PC: it is read inside a game being measured, when that game makes the call.
|
||||
return Strings.Advanced_Status_InGame;
|
||||
}
|
||||
|
||||
AdvancedSourceStatus? state = now is null ? null : (metric.Source, metric.Reach) switch
|
||||
{
|
||||
(AdvancedSource.Nvapi, _) => now.Nvapi,
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.Application.Advanced;
|
||||
|
||||
/// <summary>
|
||||
/// What became of the entries read inside the game (<see cref="AdvancedReach.Game"/>) in one session — the third
|
||||
/// answer beside a value and "not read": why there is none (Advanced metrics train B, owner decision D111).
|
||||
/// </summary>
|
||||
public enum AdvancedInGameStatus
|
||||
{
|
||||
/// <summary>Not stated: a row stored before 0.1.0-beta.40, or a state nobody set.</summary>
|
||||
Unknown = 0,
|
||||
|
||||
/// <summary>The game made at least one of the calls these entries are read from, and what it passed was read.</summary>
|
||||
Reading = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The session was measured inside the game and the game made none of those calls where they can be seen — it
|
||||
/// uses neither upscaler through the interfaces FrameLedger intercepts, or it sets its options through a call
|
||||
/// that cannot be intercepted (<c>slDLSSSetOptions</c>). Not "the game uses none of it".
|
||||
/// </summary>
|
||||
NothingSeen = 2,
|
||||
|
||||
/// <summary>The session was not measured inside the game (Tier 2): there was no call to read.</summary>
|
||||
NotHooked = 3,
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public sealed record AdvancedMetric(
|
||||
public bool IsFamily { get; init; }
|
||||
|
||||
/// <summary>True when a build with the option on reads it: every other reach is a reason it reads N/A.</summary>
|
||||
public bool IsRead => Reach is AdvancedReach.Agent or AdvancedReach.AgentElevated;
|
||||
public bool IsRead => Reach is AdvancedReach.Agent or AdvancedReach.AgentElevated or AdvancedReach.Game;
|
||||
|
||||
/// <summary>The name of its series in <c>sensor_blobs</c> — for a family, the stem of its instances' names; null when it is not a series.</summary>
|
||||
public string? SeriesName => Scope == AdvancedScope.Series ? SeriesPrefix + Id : null;
|
||||
|
||||
@@ -147,20 +147,20 @@ public static class AdvancedMetricCatalog
|
||||
Sampled("nvapi.gpu.voltage", Nvapi, NotInHeaders, Volts, Gpu, "Card voltage through NVAPI (LibreHardwareMonitor reads it)"),
|
||||
Machine("nvapi.gpu.ram_type", Nvapi, NotInHeaders, Text, GpuMemory, "The card's memory type"),
|
||||
|
||||
// ---- Inside the game: calls the Overlay already hooks ---------------------------------------------------
|
||||
Session("sl.dlss.output_size", Streamline, HookedCall, Text, Upscaling, "The output size the game gave DLSS"),
|
||||
Session("sl.dlss.presets", Streamline, HookedCall, Text, Upscaling, "The DLSS model preset per quality mode"),
|
||||
Session("sl.dlss.hdr_input", Streamline, HookedCall, Flag, Upscaling, "The game told DLSS its colour buffers are HDR"),
|
||||
Session("sl.dlss.auto_exposure", Streamline, HookedCall, Flag, Upscaling, "DLSS auto-exposure"),
|
||||
Session("sl.dlss.alpha_upscaling", Streamline, HookedCall, Flag, Upscaling, "DLSS upscales the alpha channel"),
|
||||
Session("sl.dlss.exposure", Streamline, HookedCall, Text, Upscaling, "Pre-exposure and exposure scale given to DLSS"),
|
||||
Session("ffx.upscale.sharpening", FidelityFx, HookedCall, Text, Upscaling, "FSR sharpening: on or off, and its strength"),
|
||||
Session("ffx.upscale.jitter", FidelityFx, HookedCall, Text, Upscaling, "The jitter offsets the game gave FSR"),
|
||||
Session("ffx.upscale.exposure", FidelityFx, HookedCall, Text, Upscaling, "Pre-exposure given to FSR"),
|
||||
Session("ffx.upscale.depth", FidelityFx, HookedCall, Text, Upscaling, "Near and far planes and field of view given to FSR"),
|
||||
Session("ffx.upscale.flags", FidelityFx, HookedCall, Text, Upscaling, "The flags of the game's FSR dispatch"),
|
||||
Sampled("ffx.upscale.frame_time_delta", FidelityFx, HookedCall, Milliseconds, Upscaling, "The frame time the game reported to FSR"),
|
||||
Sampled("ffx.memory_usage", FidelityFx, HookedCall, Mebibytes, Upscaling, "FSR's own video memory, when the game asks it"),
|
||||
// ---- Inside the game: calls the Overlay already hooks (read since 0.1.0-beta.40, train B) ----------------
|
||||
Session("sl.dlss.output_size", Streamline, Game, Text, Upscaling, "The output size the game gave DLSS"),
|
||||
Session("sl.dlss.presets", Streamline, Game, Table, Upscaling, "The DLSS model preset per quality mode"),
|
||||
Session("sl.dlss.hdr_input", Streamline, Game, Flag, Upscaling, "The game told DLSS its colour buffers are HDR"),
|
||||
Session("sl.dlss.auto_exposure", Streamline, Game, Flag, Upscaling, "DLSS auto-exposure"),
|
||||
Session("sl.dlss.alpha_upscaling", Streamline, Game, Flag, Upscaling, "DLSS upscales the alpha channel"),
|
||||
Session("sl.dlss.exposure", Streamline, Game, Table, Upscaling, "Pre-exposure and exposure scale given to DLSS"),
|
||||
Session("ffx.upscale.sharpening", FidelityFx, Game, Table, Upscaling, "FSR sharpening: on or off, and its strength"),
|
||||
Session("ffx.upscale.jitter", FidelityFx, Game, Table, Upscaling, "The largest jitter offset the game gave FSR"),
|
||||
Session("ffx.upscale.exposure", FidelityFx, Game, Text, Upscaling, "Pre-exposure given to FSR"),
|
||||
Session("ffx.upscale.depth", FidelityFx, Game, Table, Upscaling, "Near and far planes and the range of the field of view given to FSR"),
|
||||
Session("ffx.upscale.flags", FidelityFx, Game, Text, Upscaling, "The flags of the game's FSR dispatch"),
|
||||
Sampled("ffx.upscale.frame_time_delta", FidelityFx, Game, Milliseconds, Upscaling, "The frame time the game reported to FSR"),
|
||||
Sampled("ffx.memory_usage", FidelityFx, Game, Mebibytes, Upscaling, "FSR's own video memory, when the game asks it"),
|
||||
|
||||
// ---- Inside the game: hooks that are not built ----------------------------------------------------------
|
||||
Session("sl.constants.jitter", Streamline, NewHook, Text, Upscaling, "The jitter offsets the game gave Streamline"),
|
||||
|
||||
@@ -45,4 +45,10 @@ public enum AdvancedReach
|
||||
|
||||
/// <summary>The vendor's public headers do not declare it.</summary>
|
||||
NotInHeaders = 11,
|
||||
|
||||
/// <summary>
|
||||
/// Read inside a game FrameLedger measures, from the arguments of a call the Overlay hooks, while the session
|
||||
/// records Advanced metrics (train B, owner decision D111) — and only when the game makes that call.
|
||||
/// </summary>
|
||||
Game = 12,
|
||||
}
|
||||
@@ -16,6 +16,12 @@ public sealed record AdvancedSources(
|
||||
AdvancedSourceStatus Sensors,
|
||||
AdvancedSourceStatus ElevatedSensors)
|
||||
{
|
||||
/// <summary>
|
||||
/// What became of the entries read inside the game in the session this describes (0.1.0-beta.40); null where
|
||||
/// that is not a question — the machine's live state — and in every row stored before it existed.
|
||||
/// </summary>
|
||||
public AdvancedInGameStatus? InGame { get; init; }
|
||||
|
||||
/// <summary>Nothing asked yet.</summary>
|
||||
public static AdvancedSources Unknown { get; } = new(AdvancedSourceStatus.Unknown, NvapiCode: null, AdvancedSourceStatus.Unknown, AdvancedSourceStatus.Unknown);
|
||||
}
|
||||
@@ -37,6 +37,13 @@ public sealed record CaptureProgress
|
||||
/// </summary>
|
||||
public ulong AdapterLuid { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// What the hooked game told its upscaler, as the Overlay last published it for this session's request (region 5;
|
||||
/// train B) - the same instance until a new publication arrives. Null when the session did not ask
|
||||
/// (<see cref="ICaptureObserver.WantsInGameAdvanced"/>), before the first publication, and on every Tier-2 tick.
|
||||
/// </summary>
|
||||
public InGameAdvanced? InGameAdvanced { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// On a held session's tick (2026-09-23): the refusal it is held under — its reason, and the guard's verdict when the
|
||||
/// guard spoke — so the pipe can say, while the game runs, why nothing is measured. Null on every hooked tick.
|
||||
|
||||
@@ -436,7 +436,7 @@ public sealed class CaptureSession(
|
||||
{
|
||||
// D33: every re-scan names the family the injection named, and nothing else.
|
||||
var supervisor = new GuardSupervisor(guard, toleratedFamily);
|
||||
var state = new DrainState(new ModuleTally(modules, ngx), new DisplaySampler(display));
|
||||
var state = new DrainState(new ModuleTally(modules, ngx), new DisplaySampler(display)) { InGameAsked = AskInGameAdvanced(sink) };
|
||||
SessionEndReason end = await SuperviseAsync(pid, alive, sink, supervisor, state, ct, stop).ConfigureAwait(false);
|
||||
|
||||
// On a safety unhook the verdict that matters is the one that FIRED mid-session, not the pass that
|
||||
@@ -561,7 +561,7 @@ public sealed class CaptureSession(
|
||||
// still named; on TargetExited it reads nothing, which the tally counts rather than hides. The last
|
||||
// display sample stands until here (beta.10). The driver is not asked once the game has gone (Take, beta.27).
|
||||
state.Loaded.Take(pid, askDriver: !(alive.HasExited || end == SessionEndReason.TargetExited));
|
||||
state.Display.Finish(state.Paused);
|
||||
state.FinishSampling(sink);
|
||||
|
||||
// ONE LAST DRAIN ON EVERY PATH, including the faulted one — that is the whole point of catching
|
||||
// the mid-loop throw rather than letting it leave the method. Then let go promptly: holding the
|
||||
@@ -583,6 +583,19 @@ public sealed class CaptureSession(
|
||||
{
|
||||
state.Focus.Sample(alive.IsForeground);
|
||||
state.Display.Sample([pid], sink.DisplayState, state.Paused);
|
||||
state.SampleInGame(sink);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ADVANCED METRICS INSIDE THE GAME (train B, D111): the session's word, written EITHER WAY and before the first
|
||||
/// guard result - the control block outlives a session, and a request the session before left standing would be
|
||||
/// one nobody made. With it off the Overlay reads and hooks exactly what it did before the option existed.
|
||||
/// </summary>
|
||||
private bool AskInGameAdvanced(ICaptureSink sink)
|
||||
{
|
||||
bool asked = observer?.WantsInGameAdvanced ?? false;
|
||||
sink.SetAdvancedRequested(asked);
|
||||
return asked;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -736,6 +749,31 @@ public sealed class CaptureSession(
|
||||
|
||||
public ModuleTally Loaded { get; } = loaded;
|
||||
|
||||
/// <summary>Whether this session asked the Overlay for what the game tells its upscaler (train B, D111).</summary>
|
||||
public bool InGameAsked { get; init; }
|
||||
|
||||
/// <summary>The last publication of region 5 taken for this session; null until there is one (train B).</summary>
|
||||
public InGameAdvanced? InGame { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Region 5, when the session asked for it: a new <see cref="InGameAdvanced"/> only when the Overlay published
|
||||
/// again - once a second - so the ticks between two publications carry the same instance and copy nothing.
|
||||
/// </summary>
|
||||
public void SampleInGame(ICaptureSink sink)
|
||||
{
|
||||
if (InGameAsked && sink.AdvancedState is { } published && (InGame is null || InGame.State.Samples != published.Samples))
|
||||
{
|
||||
InGame = new InGameAdvanced(published);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The last display sample stands until here, and region 5 is read once more before the last tick.</summary>
|
||||
public void FinishSampling(ICaptureSink sink)
|
||||
{
|
||||
Display.Finish(Paused);
|
||||
SampleInGame(sink);
|
||||
}
|
||||
|
||||
public CaptureProgress Progress(ICaptureSink sink, GuardSupervisor supervisor) => new()
|
||||
{
|
||||
Records = Records,
|
||||
@@ -750,6 +788,7 @@ public sealed class CaptureSession(
|
||||
RuntimeModules = Loaded.Set,
|
||||
NgxDriver = Loaded.Ngx,
|
||||
AdapterLuid = sink.Handshake.AdapterLuid,
|
||||
InGameAdvanced = InGame,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -32,4 +32,11 @@ public interface ICaptureObserver
|
||||
void Measuring(GameProcess target)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether this session records Advanced metrics, and so asks the Overlay to read what the game tells its
|
||||
/// upscaler (train B, owner decision D111). Asked once, as the ring is attached; false for every observer that
|
||||
/// does not say otherwise - and then the Overlay reads and hooks exactly what it did before the option existed.
|
||||
/// </summary>
|
||||
bool WantsInGameAdvanced => false;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FrameLedger.Shared;
|
||||
|
||||
namespace FrameLedger.Application.Capture;
|
||||
|
||||
/// <summary>
|
||||
/// One publication of the shared memory's region 5 — what the hooked game told its upscaler, as the Overlay's watchdog
|
||||
/// last published it for this session's request (<c>07_IPC</c> §Region 5; Advanced metrics train B).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A class around the struct, made once a publication and not once a tick: the region is 1472 bytes and published once
|
||||
/// a second, the loop ticks ten times as often, and <see cref="CaptureProgress"/> is a new record every tick. The same
|
||||
/// instance on two ticks is the same publication, which is how a consumer tells "nothing new" without comparing.
|
||||
/// </remarks>
|
||||
public sealed class InGameAdvanced
|
||||
{
|
||||
private readonly FlAdvancedState _state;
|
||||
|
||||
public InGameAdvanced(FlAdvancedState state) => _state = state;
|
||||
|
||||
/// <summary>The publication, by reference: it is never copied to be read.</summary>
|
||||
public ref readonly FlAdvancedState State => ref _state;
|
||||
}
|
||||
@@ -0,0 +1,341 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
using FrameLedger.Application.Advanced;
|
||||
using FrameLedger.Shared;
|
||||
|
||||
namespace FrameLedger.Application.Capture;
|
||||
|
||||
/// <summary>
|
||||
/// Turns what the Overlay published in region 5 into what a session stores: the session facts of the entries whose
|
||||
/// reach is <see cref="AdvancedReach.Game"/>, and the readings of its two series (Advanced metrics train B, 0.1.0-beta.40).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>What is stored is what the game SAID</b> — to DLSS with an evaluation, to FSR with a dispatch, and what FSR
|
||||
/// answered when the game asked it for its memory. Nothing here checks that the upscaler used it, and nothing is
|
||||
/// derived: a size is the size, a preset the vendor's letter, a member the vendor's own name for it.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Zero is "not read", never a value</b> (<c>07_IPC</c> §Region 5). A Boolean and a preset arrive as the vendor's
|
||||
/// value plus one, a float as its bits with <see cref="FlAdvancedState.FloatNone"/> for "none seen", a size of 0 as "not
|
||||
/// given" — and each of those is a fact that is absent here, not a fact that says no.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>The facts are the same list until something in them changes.</b> The recorder writes its context when a
|
||||
/// reference changes, and a publication arrives every second: the list is rebuilt only when a field a fact is made of
|
||||
/// moved — a field of view that widened, a flag seen for the first time.
|
||||
/// </para>
|
||||
/// <para>Not for two threads: the capture loop's task is its one caller.</para>
|
||||
/// </remarks>
|
||||
public sealed class InGameAdvancedSampler
|
||||
{
|
||||
/// <summary>The frame time the game reported to FSR: the mean of the dispatches of one second, in milliseconds.</summary>
|
||||
public const string FrameTimeSeries = AdvancedMetric.SeriesPrefix + "ffx.upscale.frame_time_delta";
|
||||
|
||||
/// <summary>FSR's own video memory as it answered the game, in mebibytes — a point for each second the game asked.</summary>
|
||||
public const string MemorySeries = AdvancedMetric.SeriesPrefix + "ffx.memory_usage";
|
||||
|
||||
private const double _mebibyte = 1024.0 * 1024.0;
|
||||
|
||||
private static readonly string[] _presetModes = ["DLAA", "Quality", "Balanced", "Performance", "Ultra Performance", "Ultra Quality"];
|
||||
|
||||
// FfxApiDispatchUpscaleFlags (ffx_upscale.h), by bit.
|
||||
private static readonly string[] _flagTokens = ["draw_debug_view", "non_linear_color_srgb", "non_linear_color_pq"];
|
||||
|
||||
/// <summary>
|
||||
/// Every word a fact made here may carry for the App to translate (<c>AdvToken_*</c>): the three states of a
|
||||
/// switch seen over a session, the flags of the dispatch that have a name, and "none". A flag bit nobody named
|
||||
/// is <c>bit_N</c> and is shown as it is.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<string> Tokens { get; } = ["on", "off", "on_and_off", "none", .. _flagTokens];
|
||||
|
||||
private InGameAdvanced? _last;
|
||||
private uint _memoryQueries;
|
||||
private FactKey _key;
|
||||
|
||||
/// <summary>The session facts as of the last publication taken; empty until the game made a call they are read from.</summary>
|
||||
public IReadOnlyList<AdvancedFact> Facts { get; private set; } = [];
|
||||
|
||||
/// <summary>True once a publication carried anything the game said.</summary>
|
||||
public bool SawAnything { get; private set; }
|
||||
|
||||
/// <summary>What a session stores as its in-game state: <paramref name="hooked"/> is whether it was measured inside the game.</summary>
|
||||
public AdvancedInGameStatus Status(bool hooked) =>
|
||||
!hooked ? AdvancedInGameStatus.NotHooked : SawAnything ? AdvancedInGameStatus.Reading : AdvancedInGameStatus.NothingSeen;
|
||||
|
||||
/// <summary>
|
||||
/// Takes a publication. Returns the readings it carries when it is one not taken before and it carries any;
|
||||
/// null otherwise — nothing published, the same publication as last time, or a second in which the game neither
|
||||
/// dispatched nor asked.
|
||||
/// </summary>
|
||||
public IReadOnlyList<AdvancedReading>? Take(InGameAdvanced? published)
|
||||
{
|
||||
if (published is null || ReferenceEquals(published, _last))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
_last = published;
|
||||
ref readonly FlAdvancedState s = ref published.State;
|
||||
if (s.ValidMask == FlAdvancedValid.None)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
SawAnything = true;
|
||||
FactKey key = FactKey.Of(published);
|
||||
if (key != _key || Facts.Count == 0)
|
||||
{
|
||||
_key = key;
|
||||
Facts = Build(published);
|
||||
}
|
||||
|
||||
var readings = new List<AdvancedReading>(2);
|
||||
// The pair is drained by each publication: the dispatches of the second before it. A sum that saturated its
|
||||
// word is not a mean of anything.
|
||||
if (s.ValidMask.HasFlag(FlAdvancedValid.FfxUpscale) && s.FfxFrameTimeCount != 0 && s.FfxFrameTimeSumUs != uint.MaxValue)
|
||||
{
|
||||
readings.Add(new AdvancedReading(FrameTimeSeries, s.FfxFrameTimeSumUs / (double)s.FfxFrameTimeCount / 1000.0));
|
||||
}
|
||||
|
||||
// A point where the game asked, not a value held between two questions: the answer is of that moment.
|
||||
if (s.ValidMask.HasFlag(FlAdvancedValid.FfxMemory) && s.FfxMemoryQueries != _memoryQueries)
|
||||
{
|
||||
_memoryQueries = s.FfxMemoryQueries;
|
||||
readings.Add(new AdvancedReading(MemorySeries, s.FfxMemoryTotalBytes / _mebibyte));
|
||||
}
|
||||
|
||||
return readings.Count == 0 ? null : readings;
|
||||
}
|
||||
|
||||
private static List<AdvancedFact> Build(InGameAdvanced published)
|
||||
{
|
||||
var facts = new List<AdvancedFact>(11);
|
||||
if (published.State.ValidMask.HasFlag(FlAdvancedValid.DlssOptions))
|
||||
{
|
||||
AddDlss(published, facts);
|
||||
}
|
||||
|
||||
if (published.State.ValidMask.HasFlag(FlAdvancedValid.FfxUpscale))
|
||||
{
|
||||
AddFfx(published, facts);
|
||||
}
|
||||
|
||||
return facts;
|
||||
}
|
||||
|
||||
private static void AddDlss(InGameAdvanced published, List<AdvancedFact> facts)
|
||||
{
|
||||
ref readonly FlAdvancedState s = ref published.State;
|
||||
if (s.DlssOutputWidth != 0 && s.DlssOutputHeight != 0)
|
||||
{
|
||||
facts.Add(Fact("sl.dlss.output_size", AdvancedValue.OfText(string.Create(CultureInfo.InvariantCulture, $"{s.DlssOutputWidth} × {s.DlssOutputHeight}"))));
|
||||
}
|
||||
|
||||
var presets = new List<AdvancedRow>(_presetModes.Length);
|
||||
for (int mode = 0; mode < _presetModes.Length; mode++)
|
||||
{
|
||||
if (s.DlssPresetAt(mode) is byte plusOne and not 0)
|
||||
{
|
||||
presets.Add(new AdvancedRow(_presetModes[mode], PresetName(plusOne - 1)));
|
||||
}
|
||||
}
|
||||
|
||||
if (presets.Count > 0)
|
||||
{
|
||||
facts.Add(Fact("sl.dlss.presets", AdvancedValue.OfRows(presets)));
|
||||
}
|
||||
|
||||
AddFlag(facts, "sl.dlss.hdr_input", s.DlssColorBuffersHdr);
|
||||
AddFlag(facts, "sl.dlss.auto_exposure", s.DlssAutoExposure);
|
||||
AddFlag(facts, "sl.dlss.alpha_upscaling", s.DlssAlphaUpscaling);
|
||||
|
||||
var exposure = new List<AdvancedRow>(2);
|
||||
AddNumber(exposure, "preExposure", s.DlssPreExposureBits);
|
||||
AddNumber(exposure, "exposureScale", s.DlssExposureScaleBits);
|
||||
if (exposure.Count > 0)
|
||||
{
|
||||
facts.Add(Fact("sl.dlss.exposure", AdvancedValue.OfRows(exposure)));
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddFfx(InGameAdvanced published, List<AdvancedFact> facts)
|
||||
{
|
||||
ref readonly FlAdvancedState s = ref published.State;
|
||||
var sharpening = new List<AdvancedRow>(2);
|
||||
string? seen = (s.FfxSharpenSeen & 3u) switch { 1u => "off", 2u => "on", 3u => "on_and_off", _ => null };
|
||||
if (seen is not null)
|
||||
{
|
||||
sharpening.Add(new AdvancedRow("enableSharpening", seen, seen));
|
||||
}
|
||||
|
||||
AddRange(sharpening, "sharpness", s.FfxSharpnessMinBits, s.FfxSharpnessMaxBits);
|
||||
if (sharpening.Count > 0)
|
||||
{
|
||||
facts.Add(Fact("ffx.upscale.sharpening", AdvancedValue.OfRows(sharpening)));
|
||||
}
|
||||
|
||||
// The largest magnitude on each axis: a jitter changes every frame, and its size is what a session can say of it.
|
||||
var jitter = new List<AdvancedRow>(2);
|
||||
AddUpTo(jitter, "jitterOffset.x", s.FfxJitterMaxXBits);
|
||||
AddUpTo(jitter, "jitterOffset.y", s.FfxJitterMaxYBits);
|
||||
if (jitter.Count > 0)
|
||||
{
|
||||
facts.Add(Fact("ffx.upscale.jitter", AdvancedValue.OfRows(jitter)));
|
||||
}
|
||||
|
||||
if (Range(s.FfxPreExposureMinBits, s.FfxPreExposureMaxBits) is string preExposure)
|
||||
{
|
||||
facts.Add(Fact("ffx.upscale.exposure", AdvancedValue.OfText(preExposure)));
|
||||
}
|
||||
|
||||
var depth = new List<AdvancedRow>(3);
|
||||
AddNumber(depth, "cameraNear", s.FfxNearBits);
|
||||
AddNumber(depth, "cameraFar", s.FfxFarBits);
|
||||
// A range, lowest to highest - never a series, which would say when the player aimed (D114).
|
||||
if (Number(s.FfxFovMinBits) is double low && Number(s.FfxFovMaxBits) is double high)
|
||||
{
|
||||
depth.Add(new AdvancedRow("cameraFovAngleVertical", low == high
|
||||
? string.Create(CultureInfo.InvariantCulture, $"{low:0.####} rad ({Degrees(low):0.#}°)")
|
||||
: string.Create(CultureInfo.InvariantCulture, $"{low:0.####} – {high:0.####} rad ({Degrees(low):0.#}° – {Degrees(high):0.#}°)")));
|
||||
}
|
||||
|
||||
if (depth.Count > 0)
|
||||
{
|
||||
facts.Add(Fact("ffx.upscale.depth", AdvancedValue.OfRows(depth)));
|
||||
}
|
||||
|
||||
var flags = new List<string>(4);
|
||||
for (int bit = 0; bit < 32; bit++)
|
||||
{
|
||||
if ((s.FfxFlagsSeen & (1u << bit)) != 0)
|
||||
{
|
||||
flags.Add(bit < _flagTokens.Length ? _flagTokens[bit] : string.Create(CultureInfo.InvariantCulture, $"bit_{bit}"));
|
||||
}
|
||||
}
|
||||
|
||||
facts.Add(Fact("ffx.upscale.flags", AdvancedValue.OfTokens(flags.Count == 0 ? ["none"] : flags)));
|
||||
}
|
||||
|
||||
private static AdvancedFact Fact(string id, AdvancedValue value) => new(id, Instance: null, value);
|
||||
|
||||
private static void AddFlag(List<AdvancedFact> facts, string id, byte plusOne)
|
||||
{
|
||||
// The vendor's Boolean plus one: 1 is its false, 2 its true; anything else was not read.
|
||||
if (plusOne is 1 or 2)
|
||||
{
|
||||
facts.Add(Fact(id, AdvancedValue.Of(plusOne == 2)));
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddNumber(List<AdvancedRow> rows, string member, uint bits)
|
||||
{
|
||||
if (Number(bits) is double value)
|
||||
{
|
||||
rows.Add(new AdvancedRow(member, Text(value)));
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddUpTo(List<AdvancedRow> rows, string member, uint bits)
|
||||
{
|
||||
if (Number(bits) is double value)
|
||||
{
|
||||
rows.Add(new AdvancedRow(member, "≤ " + Text(value)));
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddRange(List<AdvancedRow> rows, string member, uint minBits, uint maxBits)
|
||||
{
|
||||
if (Range(minBits, maxBits) is string range)
|
||||
{
|
||||
rows.Add(new AdvancedRow(member, range));
|
||||
}
|
||||
}
|
||||
|
||||
private static string? Range(uint minBits, uint maxBits) =>
|
||||
Number(minBits) is double low && Number(maxBits) is double high
|
||||
? low == high ? Text(low) : Text(low) + " – " + Text(high)
|
||||
: null;
|
||||
|
||||
private static double? Number(uint bits)
|
||||
{
|
||||
if (bits == FlAdvancedState.FloatNone)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
float value = BitConverter.UInt32BitsToSingle(bits);
|
||||
return float.IsFinite(value) ? value : null;
|
||||
}
|
||||
|
||||
// As short as tells the value: a float's 0.35 is 0.3499999940395355 as a double.
|
||||
private static string Text(double value) => ((float)value).ToString("0.####", CultureInfo.InvariantCulture);
|
||||
|
||||
private static double Degrees(double radians) => radians * 180.0 / Math.PI;
|
||||
|
||||
// sl::DLSSPreset: 0 is the vendor's "default"; the letters start at 1.
|
||||
private static string PresetName(int preset) => preset switch
|
||||
{
|
||||
0 => "Default",
|
||||
>= 1 and <= 26 => ((char)('A' + preset - 1)).ToString(),
|
||||
_ => preset.ToString(CultureInfo.InvariantCulture),
|
||||
};
|
||||
|
||||
/// <summary>The fields the facts are made of, and nothing that moves every second: no count, no frame time, no clock.</summary>
|
||||
[StructLayout(LayoutKind.Auto)]
|
||||
private readonly record struct FactKey(
|
||||
FlAdvancedValid Valid,
|
||||
uint OutputWidth,
|
||||
uint OutputHeight,
|
||||
uint DlssPreExposure,
|
||||
uint DlssExposureScale,
|
||||
ulong Presets,
|
||||
uint Booleans,
|
||||
uint SharpenSeen,
|
||||
uint SharpnessMin,
|
||||
uint SharpnessMax,
|
||||
uint JitterX,
|
||||
uint JitterY,
|
||||
uint PreExposureMin,
|
||||
uint PreExposureMax,
|
||||
uint Near,
|
||||
uint Far,
|
||||
uint FovMin,
|
||||
uint FovMax,
|
||||
uint Flags)
|
||||
{
|
||||
public static FactKey Of(InGameAdvanced published)
|
||||
{
|
||||
ref readonly FlAdvancedState s = ref published.State;
|
||||
ulong presets = 0;
|
||||
for (int mode = 0; mode < 6; mode++)
|
||||
{
|
||||
presets |= (ulong)s.DlssPresetAt(mode) << (8 * mode);
|
||||
}
|
||||
|
||||
return new FactKey(
|
||||
s.ValidMask & (FlAdvancedValid.DlssOptions | FlAdvancedValid.FfxUpscale),
|
||||
s.DlssOutputWidth,
|
||||
s.DlssOutputHeight,
|
||||
s.DlssPreExposureBits,
|
||||
s.DlssExposureScaleBits,
|
||||
presets,
|
||||
s.DlssColorBuffersHdr | ((uint)s.DlssAutoExposure << 8) | ((uint)s.DlssAlphaUpscaling << 16),
|
||||
s.FfxSharpenSeen,
|
||||
s.FfxSharpnessMinBits,
|
||||
s.FfxSharpnessMaxBits,
|
||||
s.FfxJitterMaxXBits,
|
||||
s.FfxJitterMaxYBits,
|
||||
s.FfxPreExposureMinBits,
|
||||
s.FfxPreExposureMaxBits,
|
||||
s.FfxNearBits,
|
||||
s.FfxFarBits,
|
||||
s.FfxFovMinBits,
|
||||
s.FfxFovMaxBits,
|
||||
s.FfxFlagsSeen);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -370,6 +370,16 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
private volatile IReadOnlyList<AdvancedFact>? _sessionFacts;
|
||||
private (IReadOnlyList<AdvancedFact>? Machine, IReadOnlyList<AdvancedSeriesInfo>? Series, AdvancedSources? Sources, IReadOnlyList<AdvancedFact>? Session) _context;
|
||||
|
||||
// What the game told its upscaler (train B): read inside the game by the Overlay, only for a session that
|
||||
// records Advanced metrics - the same condition the shared reader is held under.
|
||||
private readonly InGameAdvancedSampler? _inGame = advanced is null ? null : new InGameAdvancedSampler();
|
||||
private IReadOnlyList<AdvancedReading>? _inGamePending;
|
||||
private (IReadOnlyList<AdvancedFact> Facts, AdvancedInGameStatus Status) _inGameContext = ([], AdvancedInGameStatus.Unknown);
|
||||
private IReadOnlyList<AdvancedFact> _sessionWithGame = [];
|
||||
|
||||
/// <summary>A session that records Advanced metrics asks the Overlay for what the game tells its upscaler (D111).</summary>
|
||||
public bool WantsInGameAdvanced => advanced is not null;
|
||||
|
||||
public DateTimeOffset? AttachedAt { get; private set; }
|
||||
|
||||
public void Attached(int pid, FlShmHandshake handshake)
|
||||
@@ -403,6 +413,12 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
{
|
||||
_last = progress;
|
||||
FollowAdapter(progress.AdapterLuid);
|
||||
if (_inGame?.Take(progress.InGameAdvanced) is { } fresh)
|
||||
{
|
||||
// The newest stands until a telemetry sample carries it: both arrive once a second, out of step.
|
||||
_inGamePending = fresh;
|
||||
}
|
||||
|
||||
DrainTelemetry();
|
||||
UpdateAdvancedContext(atEnd: false);
|
||||
writer.OnTick(progress);
|
||||
@@ -437,7 +453,7 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
UpdateAdvancedContext(atEnd: true);
|
||||
if (writer.Advanced is null)
|
||||
{
|
||||
writer.SetAdvancedContext(new AdvancedSessionData([], [], [], AdvancedSources.Unknown));
|
||||
writer.SetAdvancedContext(new AdvancedSessionData([], [], [], AdvancedSources.Unknown with { InGame = InGameStatus() }));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,17 +477,37 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
|
||||
AdvancedSnapshot? snapshot = advanced.Latest;
|
||||
IReadOnlyList<AdvancedFact>? session = _sessionFacts;
|
||||
IReadOnlyList<AdvancedFact> game = _inGame?.Facts ?? [];
|
||||
AdvancedInGameStatus status = InGameStatus();
|
||||
(IReadOnlyList<AdvancedFact>?, IReadOnlyList<AdvancedSeriesInfo>?, AdvancedSources?, IReadOnlyList<AdvancedFact>?) now = (snapshot?.MachineFacts, snapshot?.Series, snapshot?.Sources, session);
|
||||
if ((snapshot is null && session is null)
|
||||
|| (ReferenceEquals(now.Item1, _context.Machine) && ReferenceEquals(now.Item2, _context.Series) && Equals(now.Item3, _context.Sources) && ReferenceEquals(now.Item4, _context.Session)))
|
||||
bool sameGame = ReferenceEquals(game, _inGameContext.Facts) && status == _inGameContext.Status;
|
||||
if ((snapshot is null && session is null && game.Count == 0)
|
||||
|| (sameGame && ReferenceEquals(now.Item1, _context.Machine) && ReferenceEquals(now.Item2, _context.Series) && Equals(now.Item3, _context.Sources) && ReferenceEquals(now.Item4, _context.Session)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ReferenceEquals(now.Item4, _context.Session) || !ReferenceEquals(game, _inGameContext.Facts))
|
||||
{
|
||||
// The driver's facts of the session, then what the game said: one list, rebuilt when either moved.
|
||||
_sessionWithGame = game.Count == 0 ? session ?? [] : [.. session ?? [], .. game];
|
||||
}
|
||||
|
||||
_context = now;
|
||||
writer.SetAdvancedContext(new AdvancedSessionData(snapshot?.MachineFacts ?? [], session ?? [], snapshot?.Series ?? [], snapshot?.Sources ?? AdvancedSources.Unknown));
|
||||
_inGameContext = (game, status);
|
||||
writer.SetAdvancedContext(new AdvancedSessionData(
|
||||
snapshot?.MachineFacts ?? [],
|
||||
_sessionWithGame,
|
||||
snapshot?.Series ?? [],
|
||||
(snapshot?.Sources ?? AdvancedSources.Unknown) with { InGame = status }));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// What the row says of the entries read inside the game: read, measured inside the game with none of their
|
||||
/// calls seen, or not measured inside the game at all.
|
||||
/// </summary>
|
||||
private AdvancedInGameStatus InGameStatus() => _inGame?.Status(hooked: AttachedAt is not null) ?? AdvancedInGameStatus.Unknown;
|
||||
|
||||
private static IReadOnlyList<AdvancedFact> ReadSessionFacts(IAdvancedHardware advanced, AdvancedSessionTarget target)
|
||||
{
|
||||
try
|
||||
@@ -526,6 +562,15 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
|
||||
_drained.Clear();
|
||||
poller.Drain(_drained);
|
||||
if (_inGamePending is { } pending && _drained.Count > 0)
|
||||
{
|
||||
// What the game said rides the newest sample of this drain, beside whatever the Agent's own reader
|
||||
// gave it: one tick, one set of readings.
|
||||
TelemetrySample newest = _drained[^1];
|
||||
_drained[^1] = newest with { Advanced = newest.Advanced is { Count: > 0 } own ? [.. own, .. pending] : pending };
|
||||
_inGamePending = null;
|
||||
}
|
||||
|
||||
writer.AddSensors(_drained);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,30 +92,53 @@ public static class ParentDump
|
||||
return parentStarted <= helperStarted && string.Equals(imageDirectory, ours, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// How many times a dump is tried. The process being dumped is alive and is not suspended: a thread that ends or a
|
||||
/// module that unloads while dbghelp walks it fails that walk, and the next one finds the process as it then is.
|
||||
/// </summary>
|
||||
public const int Attempts = 3;
|
||||
|
||||
/// <summary>Writes a minidump of <paramref name="target"/> — another process — into <paramref name="file"/>.</summary>
|
||||
/// <remarks>
|
||||
/// <b>Tried again, a bounded number of times</b> (2026-11-12). The dump is of a RUNNING process - the Agent or the
|
||||
/// App on its way down, its other threads still at work - and <c>MiniDumpWriteDump</c> fails when the process
|
||||
/// changes under it. One failure used to cost the only dump a crash would ever have; the test that dumps a busy test
|
||||
/// host failed that way three times in two days (the helper exited 9), always under the full gate's load and never
|
||||
/// alone. Each attempt starts from an empty file; only the last failure is reported, with how often it was tried.
|
||||
/// </remarks>
|
||||
public static bool WriteDump(Process target, string file, Action<string> problem)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(target);
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(file);
|
||||
ArgumentNullException.ThrowIfNull(problem);
|
||||
|
||||
bool written;
|
||||
int error;
|
||||
using (var stream = new FileStream(file, FileMode.Create, FileAccess.ReadWrite, FileShare.None))
|
||||
int error = 0;
|
||||
for (int attempt = 1; attempt <= Attempts; attempt++)
|
||||
{
|
||||
written = PInvoke.MiniDumpWriteDump(new HANDLE(target.Handle), (uint)target.Id, new HANDLE(stream.SafeFileHandle.DangerousGetHandle()), _kind, null, null, null);
|
||||
// At once, and the SYSTEM error: CsWin32 0.3.298 declares MiniDumpWriteDump without SetLastError, so
|
||||
// GetLastPInvokeError() is whatever an earlier call left (0 when measured on CreateNamedPipeW, 2026-09-17). The
|
||||
// value is an HRESULT, which is how dbghelp reports this function's failures.
|
||||
error = Marshal.GetLastSystemError();
|
||||
if (attempt > 1)
|
||||
{
|
||||
Thread.Sleep(150 * (attempt - 1));
|
||||
}
|
||||
|
||||
if (TryWriteOnce(target, file, out error))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!written)
|
||||
{
|
||||
problem($"crash dump: MiniDumpWriteDump failed (0x{error:X8})");
|
||||
File.Delete(file);
|
||||
}
|
||||
problem($"crash dump: MiniDumpWriteDump failed (0x{error:X8}) on each of {Attempts} attempts");
|
||||
File.Delete(file);
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool TryWriteOnce(Process target, string file, out int error)
|
||||
{
|
||||
using var stream = new FileStream(file, FileMode.Create, FileAccess.ReadWrite, FileShare.None);
|
||||
bool written = PInvoke.MiniDumpWriteDump(new HANDLE(target.Handle), (uint)target.Id, new HANDLE(stream.SafeFileHandle.DangerousGetHandle()), _kind, null, null, null);
|
||||
// At once, and the SYSTEM error: CsWin32 0.3.298 declares MiniDumpWriteDump without SetLastError, so
|
||||
// GetLastPInvokeError() is whatever an earlier call left (0 when measured on CreateNamedPipeW, 2026-09-17). The
|
||||
// value is an HRESULT, which is how dbghelp reports this function's failures.
|
||||
error = Marshal.GetLastSystemError();
|
||||
return written;
|
||||
}
|
||||
}
|
||||
@@ -833,6 +833,12 @@ public unsafe struct FlAdvancedState
|
||||
/// <summary><c>sl::DLSSPreset</c> PLUS ONE: DLAA, quality, balanced, performance, ultra performance, ultra quality.</summary>
|
||||
public fixed byte DlssPresets[6];
|
||||
|
||||
/// <summary>
|
||||
/// The preset of one quality mode — 0 DLAA, 1 Quality, 2 Balanced, 3 Performance, 4 Ultra Performance, 5 Ultra
|
||||
/// Quality — as the vendor's <c>sl::DLSSPreset</c> plus one; 0 for a mode that was not read, or out of range.
|
||||
/// </summary>
|
||||
public readonly byte DlssPresetAt(int mode) => (uint)mode < 6u ? DlssPresets[mode] : (byte)0;
|
||||
|
||||
/// <summary><c>sl::Boolean</c> PLUS ONE; 0 = not read.</summary>
|
||||
public byte DlssColorBuffersHdr;
|
||||
|
||||
|
||||
@@ -2690,7 +2690,8 @@ DWORD WatchdogLoop() noexcept {
|
||||
}
|
||||
g_advancedRequested.store(advancedNow != 0u ? 1u : 0u, std::memory_order_relaxed);
|
||||
if (advancedNow != 0u) {
|
||||
LARGE_INTEGER advancedQpc{};
|
||||
// Initialised through QuadPart, the member read below, so that it is the active one (cpp:S6232).
|
||||
LARGE_INTEGER advancedQpc{.QuadPart = 0};
|
||||
QueryPerformanceCounter(&advancedQpc);
|
||||
fl::adv::Publish(g_adv, g_advanced, advancedNow, static_cast<uint64_t>(advancedQpc.QuadPart));
|
||||
}
|
||||
|
||||
@@ -6751,6 +6751,9 @@ TEST_CASE("region 5 stays empty until the Agent asks, then carries what an FSR t
|
||||
|
||||
MappedRing r;
|
||||
REQUIRE(OpenRingFor(child.pi.dwProcessId, r));
|
||||
if (r.st == nullptr || r.ctl == nullptr) {
|
||||
return; // not reached after the REQUIRE; said in the form a static analyser follows (cpp:S2259)
|
||||
}
|
||||
REQUIRE(WaitForIdentityHook(r.st));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY))); // ffxQuery is hooked
|
||||
|
||||
@@ -6840,6 +6843,9 @@ TEST_CASE("region 5 carries the DLSS options a title chains into its evaluation,
|
||||
|
||||
MappedRing r;
|
||||
REQUIRE(OpenRingFor(child.pi.dwProcessId, r));
|
||||
if (r.st == nullptr || r.ctl == nullptr) {
|
||||
return; // not reached after the REQUIRE; said in the form a static analyser follows (cpp:S2259)
|
||||
}
|
||||
REQUIRE(WaitForIdentityHook(r.st));
|
||||
|
||||
// Not asked: the evaluation is hooked, the options are chained into every one, and none of it is kept.
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO.MemoryMappedFiles;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Application.Advanced;
|
||||
using FrameLedger.Application.Capture;
|
||||
using FrameLedger.Application.Consent;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Application.Settings;
|
||||
using FrameLedger.Domain.Consent;
|
||||
using FrameLedger.Domain.Sessions;
|
||||
using FrameLedger.Infrastructure.Persistence;
|
||||
@@ -117,6 +119,16 @@ public sealed class AgentEndToEndTests : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SetAdvancedMetricsAsync(bool on)
|
||||
{
|
||||
Directory.CreateDirectory(_dataDir);
|
||||
LedgerDatabase db = await LedgerDatabase.OpenAsync(Ledger, ct: TestContext.Current.CancellationToken).ConfigureAwait(false);
|
||||
await using (db.ConfigureAwait(false))
|
||||
{
|
||||
await new RegisteredSettings(new SqliteSettingsStore(db)).SetAsync(SettingsRegistry.TelemetryAdvanced, on, TestContext.Current.CancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SetKillSwitchAsync(bool engaged)
|
||||
{
|
||||
Directory.CreateDirectory(_dataDir);
|
||||
@@ -223,6 +235,80 @@ public sealed class AgentEndToEndTests : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WhatTheGameTellsFsrIsStoredOnlyByASessionThatRecordsAdvancedMetrics()
|
||||
{
|
||||
// ADVANCED METRICS INSIDE THE GAME, end to end (train B, 0.1.0-beta.40): the shipped Agent, the real Overlay,
|
||||
// and a target that hands FSR everything on every frame and asks it for its memory. ONE target, TWO sessions,
|
||||
// which is the order that matters: the first does not record Advanced metrics and must store nothing of it
|
||||
// though the game says it all; the second asks - in a game that kept running - and stores what the game said.
|
||||
(await GrantConsentAsync()).Should().Be(ConsentWriteOutcome.Written);
|
||||
|
||||
Process harness = await StartHarnessAsync("--real --ffx-topology 2x --advanced --ffx-memory-query v2 --hold-presenting-ffx 90");
|
||||
try
|
||||
{
|
||||
using (Process off = StartAgent("capture", "--exe", ConsentedExecutable, "--seconds", "6"))
|
||||
{
|
||||
(string output, int exit) = await FinishAsync(off);
|
||||
exit.Should().Be(0, output);
|
||||
}
|
||||
|
||||
await SetAdvancedMetricsAsync(on: true);
|
||||
using (Process on = StartAgent("capture", "--exe", ConsentedExecutable, "--seconds", "10"))
|
||||
{
|
||||
(string output, int exit) = await FinishAsync(on);
|
||||
exit.Should().Be(0, output);
|
||||
}
|
||||
|
||||
LedgerDatabase db = await LedgerDatabase.OpenAsync(Ledger, ct: TestContext.Current.CancellationToken).ConfigureAwait(true);
|
||||
await using (db.ConfigureAwait(true))
|
||||
{
|
||||
var sessions = new SqliteSessionRepository(db);
|
||||
IReadOnlyList<SessionRow> rows = await sessions.ListRecentAsync(2, TestContext.Current.CancellationToken).ConfigureAwait(true);
|
||||
rows.Should().HaveCount(2);
|
||||
SessionRow second = rows[0];
|
||||
SessionRow first = rows[1];
|
||||
first.Tier.Should().Be(CaptureTier.Hooked);
|
||||
second.Tier.Should().Be(CaptureTier.Hooked);
|
||||
|
||||
// OFF: no row, and no series under the advanced prefix - the game said it all, and none of it was kept.
|
||||
(await sessions.FindAdvancedAsync(first.Id, TestContext.Current.CancellationToken).ConfigureAwait(true)).Should().BeNull();
|
||||
(await sessions.FindAdvancedSensorsAsync(first.Id, TestContext.Current.CancellationToken).ConfigureAwait(true))
|
||||
.Should().NotContain(static b => b.Series.StartsWith(AdvancedMetric.SeriesPrefix, StringComparison.Ordinal));
|
||||
|
||||
// ON: the values hook-harness --advanced sends (main.cpp, kAdv*), as fl_guard asserts them natively.
|
||||
AdvancedSessionRow row = (await sessions.FindAdvancedAsync(second.Id, TestContext.Current.CancellationToken).ConfigureAwait(true)).Should().BeOfType<AdvancedSessionRow>().Subject;
|
||||
AssertWhatTheHarnessToldFsr(row);
|
||||
(await sessions.FindAdvancedSensorsAsync(second.Id, TestContext.Current.CancellationToken).ConfigureAwait(true))
|
||||
.Select(static b => b.Series).Should().Contain([InGameAdvancedSampler.FrameTimeSeries, InGameAdvancedSampler.MemorySeries]);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Kill(harness);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The stored row of a session that asked, against what <c>hook-harness --advanced --ffx-memory-query</c> sends and the FSR stub answers.</summary>
|
||||
private static void AssertWhatTheHarnessToldFsr(AdvancedSessionRow row)
|
||||
{
|
||||
(IReadOnlyList<AdvancedFact> facts, AdvancedSources sources) = AdvancedJson.ParseSession(row.FactsJson);
|
||||
sources.InGame.Should().Be(AdvancedInGameStatus.Reading, row.FactsJson);
|
||||
string[] Rows(string id) => [.. facts.Single(f => string.Equals(f.Id, id, StringComparison.Ordinal)).Value.Rows!.Select(static r => r.Name + "=" + r.Value)];
|
||||
Rows("ffx.upscale.sharpening").Should().Equal("enableSharpening=on", "sharpness=0.35");
|
||||
Rows("ffx.upscale.jitter").Should().Equal("jitterOffset.x=≤ 0.3", "jitterOffset.y=≤ 0.4");
|
||||
Rows("ffx.upscale.depth").Should().Equal("cameraNear=0.1", "cameraFar=1000", "cameraFovAngleVertical=0.9 – 1.1 rad (51.6° – 63°)");
|
||||
facts.Single(static f => string.Equals(f.Id, "ffx.upscale.exposure", StringComparison.Ordinal)).Value.Text.Should().Be("1.25");
|
||||
facts.Single(static f => string.Equals(f.Id, "ffx.upscale.flags", StringComparison.Ordinal)).Value.Tokens.Should().Equal("non_linear_color_pq");
|
||||
facts.Should().NotContain(static f => f.Id.StartsWith("sl.", StringComparison.Ordinal), "this target chains no DLSS options");
|
||||
|
||||
IReadOnlyDictionary<string, Application.Recording.SensorSeriesStats> stats = AdvancedJson.ParseStats(row.StatsJson);
|
||||
stats.Should().ContainKey(InGameAdvancedSampler.FrameTimeSeries, row.StatsJson);
|
||||
stats[InGameAdvancedSampler.FrameTimeSeries].Mean.Should().BeApproximately(16.0, 0.01, "every dispatch states 16 ms");
|
||||
stats.Should().ContainKey(InGameAdvancedSampler.MemorySeries, row.StatsJson);
|
||||
stats[InGameAdvancedSampler.MemorySeries].Max.Should().BeApproximately(123456789 / (1024.0 * 1024.0), 0.01, "what the FSR stub answers the memory query with");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WithTheKillSwitchOnAConsentedGameIsRefusedAndNothingIsEverInjected()
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using FluentAssertions;
|
||||
using FrameLedger.App.Charts;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using FrameLedger.Application.Advanced;
|
||||
using FrameLedger.Application.Capture;
|
||||
using FrameLedger.Application.Recording;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
@@ -54,6 +55,20 @@ public sealed class AdvancedPresenterTests
|
||||
Need("AdvToken_" + token);
|
||||
}
|
||||
|
||||
// Train B: what a session says of the entries read inside the game, and the words its facts carry.
|
||||
Need("AdvReach_" + AdvancedReach.Game);
|
||||
Need(nameof(Strings.Advanced_Status_InGame));
|
||||
Need(nameof(Strings.Advanced_InGameLine));
|
||||
foreach (AdvancedInGameStatus status in Enum.GetValues<AdvancedInGameStatus>())
|
||||
{
|
||||
Need("AdvInGame_" + status);
|
||||
}
|
||||
|
||||
foreach (string token in InGameAdvancedSampler.Tokens)
|
||||
{
|
||||
Need("AdvToken_" + token);
|
||||
}
|
||||
|
||||
missing.Should().BeEmpty("the page shows a label, never a key - and a token the driver's answer maps to has a word in " + culture);
|
||||
}
|
||||
|
||||
@@ -216,9 +231,56 @@ public sealed class AdvancedPresenterTests
|
||||
At(live, "nvapi.gpu.board_serial").Should().Be(new AdvancedSourceRow(
|
||||
Label("nvapi.gpu.board_serial"), AdvancedLabels.Scope(AdvancedScope.MachineFact), "NVAPI", AdvancedLabels.Reach(AdvancedReach.Identifier), IsRead: false));
|
||||
At(live, "sl.constants.camera").Status.Should().Be(AdvancedLabels.Reach(AdvancedReach.PlayerState));
|
||||
|
||||
// Train B: read inside a game being measured, when the game makes the call - which is not a state of this PC,
|
||||
// so the row says the same with the page live and with nobody asking.
|
||||
foreach (string id in new[] { "sl.dlss.presets", "ffx.upscale.depth", "ffx.memory_usage" })
|
||||
{
|
||||
At(unknown, id).Should().Be(new AdvancedSourceRow(
|
||||
Label(id), AdvancedLabels.Scope(AdvancedMetricCatalog.Find(id)!.Scope), AdvancedLabels.Source(AdvancedMetricCatalog.Find(id)!.Source), Strings.Advanced_Status_InGame, IsRead: true));
|
||||
At(live, id).Status.Should().Be(Strings.Advanced_Status_InGame);
|
||||
}
|
||||
|
||||
At(live, "ffx.framegen.config").Status.Should().Be(AdvancedLabels.Reach(AdvancedReach.NewHook), "a hook that is not built is still a later release");
|
||||
live.Where(static r => r.IsRead).Should().HaveCount(AdvancedMetricCatalog.All.Count(static m => m.IsRead));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhatTheGameToldItsUpscalerIsShownInTheVendorsWordsWithTheSwitchTranslated()
|
||||
{
|
||||
AdvancedFact[] said =
|
||||
[
|
||||
new("sl.dlss.presets", Instance: null, AdvancedValue.OfRows([new AdvancedRow("DLAA", "K"), new AdvancedRow("Quality", "Default")])),
|
||||
new("sl.dlss.hdr_input", Instance: null, AdvancedValue.Of(false)),
|
||||
new("ffx.upscale.sharpening", Instance: null, AdvancedValue.OfRows([new AdvancedRow("enableSharpening", "on", "on"), new AdvancedRow("sharpness", "0.35")])),
|
||||
new("ffx.upscale.flags", Instance: null, AdvancedValue.OfTokens("non_linear_color_pq", "bit_5")),
|
||||
];
|
||||
|
||||
AdvancedFactGroup group = AdvancedPresenter.Groups(said).Should().ContainSingle("all four stand under Upscaling").Subject;
|
||||
|
||||
group.Title.Should().Be(AdvancedLabels.Group(AdvancedGroup.Upscaling));
|
||||
group.Rows.Select(static r => r.Label).Should().Equal(Label("sl.dlss.presets"), Label("sl.dlss.hdr_input"), Label("ffx.upscale.sharpening"), Label("ffx.upscale.flags"));
|
||||
group.Rows[0].Details.Should().Equal(new AdvancedDetailRow("DLAA", "K"), new AdvancedDetailRow("Quality", "Default"));
|
||||
group.Rows[1].Value.Should().Be(Strings.Common_No);
|
||||
group.Rows[2].Details.Should().Equal(new AdvancedDetailRow("enableSharpening", Strings.AdvToken_on), new AdvancedDetailRow("sharpness", "0.35"));
|
||||
group.Rows[3].Value.Should().Be(Strings.AdvToken_non_linear_color_pq + ", bit_5", "a flag nobody named is shown as it is");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ASessionsSourcesLineSaysWhatBecameOfTheInGameEntriesAndAnOlderRowsDoesNot()
|
||||
{
|
||||
string before = AdvancedPresenter.SourcesLine(AdvancedFixtures.Sources);
|
||||
before.Should().NotContain(AdvancedLabels.InGame(AdvancedInGameStatus.NothingSeen)).And.NotContain(AdvancedLabels.InGame(AdvancedInGameStatus.Reading));
|
||||
|
||||
foreach (AdvancedInGameStatus status in new[] { AdvancedInGameStatus.Reading, AdvancedInGameStatus.NothingSeen, AdvancedInGameStatus.NotHooked })
|
||||
{
|
||||
string line = AdvancedPresenter.SourcesLine(AdvancedFixtures.Sources with { InGame = status });
|
||||
|
||||
line.Should().StartWith(before, "the three sources are said as before");
|
||||
line.Should().EndWith(string.Format(CultureInfo.CurrentCulture, Strings.Advanced_InGameLine, AdvancedLabels.InGame(status)));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AValueIsShownInItsUnitAndAFlagAsYesOrNo()
|
||||
{
|
||||
|
||||
@@ -145,15 +145,48 @@ public sealed class AdvancedJsonTests
|
||||
new("nvapi.gpu.board_serial", Instance: null, AdvancedValue.OfText("0123456789")),
|
||||
new("nvapi.display.edid", "1", AdvancedValue.OfText("00ffffffffffff00")),
|
||||
new("sl.constants.camera", Instance: null, AdvancedValue.OfText("1.0 2.0 3.0")),
|
||||
new("sl.dlss.presets", Instance: null, AdvancedValue.OfText("K")),
|
||||
new("sl.constants.jitter", Instance: null, AdvancedValue.OfText("0.25 0.25")),
|
||||
new("sl.dlss.presets", Instance: null, AdvancedValue.OfRows([new AdvancedRow("DLAA", "K")])),
|
||||
new("no.such.metric", Instance: null, AdvancedValue.Of(1)),
|
||||
new("lhm.board.model", Instance: null, AdvancedValue.OfText("ASUS ROG STRIX Z790-E")),
|
||||
];
|
||||
|
||||
AdvancedJson.Storable(mixed).Select(static f => f.Id).Should().Equal("nvapi.gpu.rt_cores", "lhm.board.model");
|
||||
// The camera's position is the player's state and is never stored, whatever produced it; a hook that is not
|
||||
// built stores nothing; what the Overlay reads inside a game since 0.1.0-beta.40 may be stored.
|
||||
AdvancedJson.Storable(mixed).Select(static f => f.Id).Should().Equal("nvapi.gpu.rt_cores", "sl.dlss.presets", "lhm.board.model");
|
||||
FluentActions.Invoking(static () => AdvancedJson.Storable(null!)).Should().Throw<ArgumentNullException>();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ARowStoredBeforeTheInGameStateExistedStillParsesAndSaysNothingOfIt()
|
||||
{
|
||||
// 0.1.0-beta.39 wrote exactly this. The in-game state is a member that may be absent, never a required one.
|
||||
const string beta39 = """{"facts":[{"id":"nvapi.session.vrr_enabled","number":1}],"sources":{"nvapi":"Reading","sensors":"Reading","elevatedSensors":"NotElevated"}}""";
|
||||
|
||||
(IReadOnlyList<AdvancedFact> facts, AdvancedSources sources) = AdvancedJson.ParseSession(beta39);
|
||||
|
||||
facts.Should().ContainSingle().Which.Id.Should().Be("nvapi.session.vrr_enabled");
|
||||
sources.Nvapi.Should().Be(AdvancedSourceStatus.Reading);
|
||||
sources.ElevatedSensors.Should().Be(AdvancedSourceStatus.NotElevated);
|
||||
sources.InGame.Should().BeNull("a row that never said is not a row that said no");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(AdvancedInGameStatus.Reading)]
|
||||
[InlineData(AdvancedInGameStatus.NothingSeen)]
|
||||
[InlineData(AdvancedInGameStatus.NotHooked)]
|
||||
public void TheInGameStateOfASessionSurvivesTheLedger(AdvancedInGameStatus status)
|
||||
{
|
||||
AdvancedSources written = AdvancedSources.Unknown with { InGame = status };
|
||||
|
||||
string json = AdvancedJson.OfSession([], written);
|
||||
(_, AdvancedSources read) = AdvancedJson.ParseSession(json);
|
||||
|
||||
json.Should().Contain("\"inGame\":\"" + status + "\"", "a status is its name, as the sources' are");
|
||||
read.Should().Be(written);
|
||||
AdvancedJson.OfSession([], AdvancedSources.Unknown).Should().NotContain("inGame", "the machine's state has no such member, and null is left out");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheWritersRefuseNull()
|
||||
{
|
||||
|
||||
@@ -84,10 +84,10 @@ public sealed partial class AdvancedMetricCatalogTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OnlyWhatTheAgentReadsCountsAsRead()
|
||||
public void OnlyWhatTheAgentOrTheOverlayReadsCountsAsRead()
|
||||
{
|
||||
_all.Where(static m => m.IsRead).Should().OnlyContain(static m => m.Reach == AdvancedReach.Agent || m.Reach == AdvancedReach.AgentElevated);
|
||||
_all.Where(static m => !m.IsRead).Should().NotContain(static m => m.Reach == AdvancedReach.Agent || m.Reach == AdvancedReach.AgentElevated);
|
||||
_all.Where(static m => m.IsRead).Should().OnlyContain(static m => m.Reach == AdvancedReach.Agent || m.Reach == AdvancedReach.AgentElevated || m.Reach == AdvancedReach.Game);
|
||||
_all.Where(static m => !m.IsRead).Should().NotContain(static m => m.Reach == AdvancedReach.Agent || m.Reach == AdvancedReach.AgentElevated || m.Reach == AdvancedReach.Game);
|
||||
_all.Should().Contain(static m => m.IsRead);
|
||||
_all.Should().Contain(static m => !m.IsRead);
|
||||
}
|
||||
@@ -102,11 +102,23 @@ public sealed partial class AdvancedMetricCatalogTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhatIsReadInsideAGameIsNeverReadByThisBuild()
|
||||
public void WhatIsReadInsideAGameIsWhatTheOverlayOfThisBuildReadsAndNothingMore()
|
||||
{
|
||||
// Train A changes nothing in code loaded into a game: Streamline and FidelityFX entries are named, not read.
|
||||
// Train B, 0.1.0-beta.40: thirteen entries, each a member of a call the Overlay already hooked - and each
|
||||
// matched by a name on tools/overlay-allowed-fields.txt, which a build gate holds to the Overlay's own code.
|
||||
// Everything else of Streamline and FidelityFX is still named, not read; NGX and XeSS are never read.
|
||||
string[] inGame = [.. _all.Where(static m => m.Reach == AdvancedReach.Game).Select(static m => m.Id)];
|
||||
inGame.Should().Equal(
|
||||
"sl.dlss.output_size", "sl.dlss.presets", "sl.dlss.hdr_input", "sl.dlss.auto_exposure", "sl.dlss.alpha_upscaling", "sl.dlss.exposure",
|
||||
"ffx.upscale.sharpening", "ffx.upscale.jitter", "ffx.upscale.exposure", "ffx.upscale.depth", "ffx.upscale.flags",
|
||||
"ffx.upscale.frame_time_delta", "ffx.memory_usage");
|
||||
|
||||
_all.Where(static m => m.Reach == AdvancedReach.Game).Should().OnlyContain(static m => m.Source == AdvancedSource.Streamline || m.Source == AdvancedSource.FidelityFx);
|
||||
_all.Where(static m => m.Reach == AdvancedReach.Game).Should().OnlyContain(static m => m.Scope != AdvancedScope.MachineFact, "what a game says is of a session, never of the PC");
|
||||
_all.Where(static m => m.Source is AdvancedSource.Streamline or AdvancedSource.FidelityFx or AdvancedSource.Ngx or AdvancedSource.Xess)
|
||||
.Where(static m => m.Reach != AdvancedReach.Game)
|
||||
.Should().OnlyContain(static m => !m.IsRead);
|
||||
_all.Where(static m => m.Source is AdvancedSource.Ngx or AdvancedSource.Xess).Should().OnlyContain(static m => !m.IsRead);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -188,6 +188,20 @@ public sealed class CaptureSessionTests : IAsyncDisposable
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Region 5 as the Overlay would publish it for this session's request (train B); null until it did.</summary>
|
||||
public FlAdvancedState? Advanced { get; set; }
|
||||
|
||||
public FlAdvancedState? AdvancedState => Advanced;
|
||||
|
||||
/// <summary>Every word the loop wrote for <c>advancedRequested</c>, in order.</summary>
|
||||
public List<bool> AdvancedRequests { get; } = [];
|
||||
|
||||
public void SetAdvancedRequested(bool requested)
|
||||
{
|
||||
AdvancedRequests.Add(requested);
|
||||
Events.Add(requested ? "advanced:on" : "advanced:off");
|
||||
}
|
||||
|
||||
public int LogFlushRequests { get; private set; }
|
||||
|
||||
public void RequestLogFlush() => LogFlushRequests++;
|
||||
@@ -330,7 +344,8 @@ public sealed class CaptureSessionTests : IAsyncDisposable
|
||||
private static CaptureSession Loop(IGameConsentStore store, CountingGuard guard, FakeSink? sink,
|
||||
FakeLiveness? alive = null, int? pid = _pid, SessionEndReason resolveReason = SessionEndReason.Running,
|
||||
CaptureOptions? options = null, IKillSwitch? killSwitch = null, ICapturePauseSource? pause = null,
|
||||
IUserModeExceptionSwitch? exceptions = null, IOverlayToleranceChannel? tolerance = null, IDisplayProbe? display = null) =>
|
||||
IUserModeExceptionSwitch? exceptions = null, IOverlayToleranceChannel? tolerance = null, IDisplayProbe? display = null,
|
||||
ICaptureObserver? observer = null) =>
|
||||
new(store,
|
||||
new HookedCaptureGate(guard),
|
||||
guard,
|
||||
@@ -350,7 +365,8 @@ public sealed class CaptureSessionTests : IAsyncDisposable
|
||||
pause: pause,
|
||||
exceptions: exceptions,
|
||||
tolerance: tolerance,
|
||||
display: display);
|
||||
display: display,
|
||||
observer: observer);
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="Loop"/>'s options with a 30 s ceiling instead of 120 ms, for a test whose session must end on something
|
||||
@@ -787,14 +803,65 @@ public sealed class CaptureSessionTests : IAsyncDisposable
|
||||
// THE ORDERING, OBSERVED. Asserting `Published[0].Ticks == 1` alone was decoration: it holds
|
||||
// whether the first scan runs before the drain loop or is deferred to the first 30 s boundary,
|
||||
// because either way the first tick published is the first tick counted.
|
||||
sink.Events.Should().NotBeEmpty();
|
||||
sink.Events[0].Should().Be("publish",
|
||||
// The word for Advanced metrics is written first (train B) - one store, no scan - and the guard result next.
|
||||
sink.Events.Should().HaveCountGreaterThan(1);
|
||||
sink.Events[0].Should().Be("advanced:off");
|
||||
sink.Events[1].Should().Be("publish",
|
||||
"the Overlay's 65 s supervision clock starts when the mapping is published, not when we "
|
||||
+ "adopt it, so a first scan deferred by 30 s is already half way to a supervision stop");
|
||||
sink.Published[0].Ticks.Should().Be(1u);
|
||||
r.GuardTicksPublished.Should().BeGreaterThanOrEqualTo(1u);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ASessionThatDoesNotRecordAdvancedMetricsWritesTheWordOffBeforeItsFirstGuardResultAndReadsNothing()
|
||||
{
|
||||
// D111. The control block outlives a session: "off" is a word that is WRITTEN - and written first, so the
|
||||
// Overlay never acts on the request the session before left standing.
|
||||
using var sink = new FakeSink(recordsToServe: 3) { Advanced = InGameStates.Ffx() };
|
||||
var ticks = new InGameObserver(wants: false);
|
||||
CaptureSession loop = Loop(await StoreWithAsync(), new CountingGuard(), sink, observer: ticks);
|
||||
|
||||
await loop.RunAsync(_exe, Fingerprint, "payload.dll", TestContext.Current.CancellationToken);
|
||||
|
||||
sink.AdvancedRequests.Should().Equal(false);
|
||||
sink.Events[0].Should().Be("advanced:off", "before the first guard result, which is the first thing the Overlay acts on");
|
||||
ticks.Seen.Should().NotBeEmpty().And.OnlyContain(static p => p == null, "a region that happens to hold something is not read by a session that did not ask");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ASessionThatRecordsAdvancedMetricsAsksOnceAndHandsEachPublicationOverAsOneInstance()
|
||||
{
|
||||
using var sink = new FakeSink(recordsToServe: 3) { Advanced = InGameStates.Ffx(samples: 4) };
|
||||
var ticks = new InGameObserver(wants: true);
|
||||
CaptureSession loop = Loop(await StoreWithAsync(), new CountingGuard(), sink, observer: ticks);
|
||||
|
||||
await loop.RunAsync(_exe, Fingerprint, "payload.dll", TestContext.Current.CancellationToken);
|
||||
|
||||
sink.AdvancedRequests.Should().Equal(true);
|
||||
sink.Events[0].Should().Be("advanced:on");
|
||||
ticks.Seen.Should().HaveCountGreaterThan(1);
|
||||
ticks.Seen.Should().OnlyContain(static p => p != null);
|
||||
ticks.Seen.Should().OnlyContain(p => ReferenceEquals(p, ticks.Seen[0]), "one publication is one instance on every tick, so nobody copies or compares it");
|
||||
ticks.Seen[0]!.State.Samples.Should().Be(4u);
|
||||
ticks.Seen[0]!.State.FfxFovMaxBits.Should().Be(InGameStates.Bits(1.1f));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ANewPublicationIsANewInstanceAndAnAskedSessionWithNothingPublishedSeesNone()
|
||||
{
|
||||
using var sink = new FakeSink(recordsToServe: 3);
|
||||
var ticks = new InGameObserver(wants: true) { OnTick = n => sink.Advanced = n < 3 ? null : InGameStates.Ffx(samples: (uint)(n / 3)) };
|
||||
CaptureSession loop = Loop(await StoreWithAsync(), new CountingGuard(), sink, observer: ticks);
|
||||
|
||||
await loop.RunAsync(_exe, Fingerprint, "payload.dll", TestContext.Current.CancellationToken);
|
||||
|
||||
ticks.Seen[0].Should().BeNull("the watchdog publishes within a second of the request, not before it");
|
||||
InGameAdvanced[] published = [.. ticks.Seen.OfType<InGameAdvanced>().Distinct()];
|
||||
published.Should().HaveCountGreaterThan(1, "the fake publishes again every third tick");
|
||||
published.Select(static p => p.State.Samples).Should().BeInAscendingOrder().And.OnlyHaveUniqueItems();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ThePublishedTickIsTheSupervisorsCompletedEvaluations()
|
||||
{
|
||||
@@ -1287,6 +1354,27 @@ public sealed class CaptureSessionTests : IAsyncDisposable
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>An observer that says whether its session records Advanced metrics, and keeps what each tick carried of region 5.</summary>
|
||||
private sealed class InGameObserver(bool wants) : ICaptureObserver
|
||||
{
|
||||
public List<InGameAdvanced?> Seen { get; } = [];
|
||||
|
||||
/// <summary>Called with the tick's number after it was kept, so a test can change what the sink publishes next.</summary>
|
||||
public Action<int>? OnTick { get; init; }
|
||||
|
||||
public bool WantsInGameAdvanced => wants;
|
||||
|
||||
public void Attached(int pid, FlShmHandshake handshake)
|
||||
{
|
||||
}
|
||||
|
||||
public void Tick(CaptureProgress progress)
|
||||
{
|
||||
Seen.Add(progress.InGameAdvanced);
|
||||
OnTick?.Invoke(Seen.Count);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>What the loop told the observer to read the game's memory of (beta.12, D43), in order.</summary>
|
||||
private sealed class MeasuringRecorder : ICaptureObserver
|
||||
{
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Application.Advanced;
|
||||
using FrameLedger.Application.Capture;
|
||||
using FrameLedger.Shared;
|
||||
|
||||
namespace FrameLedger.Application.Tests.Capture;
|
||||
|
||||
/// <summary>
|
||||
/// What a session makes of region 5 (Advanced metrics train B): the facts of what the game told its upscaler, the two
|
||||
/// series, and - the half that matters - that a zero, a "none" and an unread byte are never turned into a value.
|
||||
/// </summary>
|
||||
public sealed class InGameAdvancedSamplerTests
|
||||
{
|
||||
private static AdvancedFact Fact(InGameAdvancedSampler sampler, string id) =>
|
||||
sampler.Facts.Should().ContainSingle(f => f.Id == id, id).Subject;
|
||||
|
||||
private static string[] Rows(AdvancedFact fact) => [.. fact.Value.Rows!.Select(static r => r.Name + "=" + r.Value)];
|
||||
|
||||
[Fact]
|
||||
public void NothingPublishedIsNothingRead()
|
||||
{
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
|
||||
sampler.Take(published: null).Should().BeNull();
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Empty())).Should().BeNull("a publication with no group seen carries no reading");
|
||||
|
||||
sampler.Facts.Should().BeEmpty();
|
||||
sampler.SawAnything.Should().BeFalse();
|
||||
sampler.Status(hooked: true).Should().Be(AdvancedInGameStatus.NothingSeen, "measured inside the game, and the game made none of the calls");
|
||||
sampler.Status(hooked: false).Should().Be(AdvancedInGameStatus.NotHooked);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheDlssOptionsBecomeTheSessionsFactsInTheVendorsOwnWords()
|
||||
{
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Dlss())).Should().BeNull("the DLSS options are facts, not a series");
|
||||
|
||||
Fact(sampler, "sl.dlss.output_size").Value.Text.Should().Be("2560 × 1440");
|
||||
Rows(Fact(sampler, "sl.dlss.presets")).Should().Equal(
|
||||
"DLAA=K", "Quality=J", "Balanced=Default", "Performance=M", "Ultra Performance=L", "Ultra Quality=Default");
|
||||
Fact(sampler, "sl.dlss.hdr_input").Value.Number.Should().Be(0, "the game said its colour buffers are not HDR");
|
||||
Fact(sampler, "sl.dlss.auto_exposure").Value.Number.Should().Be(1);
|
||||
Fact(sampler, "sl.dlss.alpha_upscaling").Value.Number.Should().Be(1);
|
||||
Rows(Fact(sampler, "sl.dlss.exposure")).Should().Equal("preExposure=1.5", "exposureScale=0.75");
|
||||
sampler.Facts.Should().OnlyContain(static f => f.Id.StartsWith("sl.dlss.", StringComparison.Ordinal), "no FSR call was seen");
|
||||
sampler.Status(hooked: true).Should().Be(AdvancedInGameStatus.Reading);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AZeroANoneAndAnUnreadByteAreNeverAValue()
|
||||
{
|
||||
// 07_IPC §Region 5: zero is "not read". A version-1 DLSSOptions has no auto-exposure member; a game that left
|
||||
// its output size unset sent the vendor's sentinel, which the Overlay turns into 0; a Boolean has a third state.
|
||||
FlAdvancedState s = InGameStates.WithPresets(
|
||||
InGameStates.Empty() with
|
||||
{
|
||||
ValidMask = FlAdvancedValid.DlssOptions,
|
||||
DlssStructVersion = 1,
|
||||
DlssOutputWidth = 0,
|
||||
DlssOutputHeight = 1440,
|
||||
DlssColorBuffersHdr = 2,
|
||||
DlssAutoExposure = 0, // the struct ended before it
|
||||
DlssAlphaUpscaling = 3, // not a value the Overlay ever writes
|
||||
},
|
||||
12, 0, 0, 0, 0, 0);
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
|
||||
sampler.Take(new InGameAdvanced(s));
|
||||
|
||||
sampler.Facts.Select(static f => f.Id).Should().Equal("sl.dlss.presets", "sl.dlss.hdr_input");
|
||||
Rows(Fact(sampler, "sl.dlss.presets")).Should().Equal("DLAA=K");
|
||||
Fact(sampler, "sl.dlss.hdr_input").Value.Number.Should().Be(1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheFsrDispatchBecomesRangesAndLargestMagnitudesNeverASeriesOfWhereThePlayerLooked()
|
||||
{
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Ffx()));
|
||||
|
||||
AdvancedFact sharpening = Fact(sampler, "ffx.upscale.sharpening");
|
||||
Rows(sharpening).Should().Equal("enableSharpening=on", "sharpness=0.35");
|
||||
sharpening.Value.Rows![0].Token.Should().Be("on", "the App translates the word");
|
||||
Rows(Fact(sampler, "ffx.upscale.jitter")).Should().Equal("jitterOffset.x=≤ 0.3", "jitterOffset.y=≤ 0.4");
|
||||
Fact(sampler, "ffx.upscale.exposure").Value.Text.Should().Be("1.25");
|
||||
// D114: the field of view is the session's range, lowest to highest.
|
||||
Rows(Fact(sampler, "ffx.upscale.depth")).Should().Equal(
|
||||
"cameraNear=0.1", "cameraFar=1000", "cameraFovAngleVertical=0.9 – 1.1 rad (51.6° – 63°)");
|
||||
Fact(sampler, "ffx.upscale.flags").Value.Tokens.Should().Equal("non_linear_color_pq");
|
||||
sampler.Facts.Should().NotContain(static f => f.Id.StartsWith("sl.", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SharpeningSeenBothWaysARangeAndAFlagNobodyNamedAreSaidAsTheyAre()
|
||||
{
|
||||
FlAdvancedState s = InGameStates.Ffx() with
|
||||
{
|
||||
FfxSharpenSeen = 3,
|
||||
FfxSharpnessMinBits = InGameStates.Bits(0.2f),
|
||||
FfxPreExposureMaxBits = InGameStates.Bits(2f),
|
||||
FfxFovMaxBits = InGameStates.Bits(0.9f),
|
||||
FfxFlagsSeen = (1u << 0) | (1u << 5),
|
||||
};
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
|
||||
sampler.Take(new InGameAdvanced(s));
|
||||
|
||||
Rows(Fact(sampler, "ffx.upscale.sharpening")).Should().Equal("enableSharpening=on_and_off", "sharpness=0.2 – 0.35");
|
||||
InGameAdvancedSampler.Tokens.Should().Contain(["on", "off", "on_and_off", "none", "draw_debug_view", "non_linear_color_srgb", "non_linear_color_pq"],
|
||||
"each is a word the App has in three languages; a test there holds it to this list");
|
||||
Fact(sampler, "ffx.upscale.exposure").Value.Text.Should().Be("1.25 – 2");
|
||||
Rows(Fact(sampler, "ffx.upscale.depth")).Should().Contain("cameraFovAngleVertical=0.9 rad (51.6°)", "one value is said once");
|
||||
Fact(sampler, "ffx.upscale.flags").Value.Tokens.Should().Equal("draw_debug_view", "bit_5");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AnFsrDispatchThatSaidNothingMoreStillSaysItSetNoFlag()
|
||||
{
|
||||
FlAdvancedState s = InGameStates.Empty() with { ValidMask = FlAdvancedValid.FfxUpscale, FfxDispatches = 10 };
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
|
||||
sampler.Take(new InGameAdvanced(s)).Should().BeNull("no frame time was reported and nobody asked for the memory");
|
||||
|
||||
sampler.Facts.Should().ContainSingle().Which.Value.Tokens.Should().Equal("none");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheFrameTimeIsTheMeanOfOneSecondAndTheMemoryAPointWhereTheGameAsked()
|
||||
{
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
|
||||
IReadOnlyList<AdvancedReading> first = sampler.Take(new InGameAdvanced(InGameStates.Ffx(samples: 1)))!;
|
||||
first.Should().Equal(
|
||||
new AdvancedReading(InGameAdvancedSampler.FrameTimeSeries, 16.0),
|
||||
new AdvancedReading(InGameAdvancedSampler.MemorySeries, 256.0));
|
||||
|
||||
// The next second: dispatches went on, the game did not ask again - the memory is not repeated.
|
||||
FlAdvancedState second = InGameStates.Ffx(samples: 2) with { FfxMemoryQueries = 60, FfxFrameTimeCount = 30, FfxFrameTimeSumUs = 30 * 33_000 };
|
||||
sampler.Take(new InGameAdvanced(second)).Should().Equal(new AdvancedReading(InGameAdvancedSampler.FrameTimeSeries, 33.0));
|
||||
|
||||
// A second with no dispatch, and one whose sum saturated its word: neither is a mean of anything.
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Ffx(samples: 3) with { FfxMemoryQueries = 60, FfxFrameTimeCount = 0, FfxFrameTimeSumUs = 0 })).Should().BeNull();
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Ffx(samples: 4) with { FfxMemoryQueries = 60, FfxFrameTimeSumUs = uint.MaxValue })).Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheSamePublicationIsTakenOnce()
|
||||
{
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
var published = new InGameAdvanced(InGameStates.Ffx());
|
||||
|
||||
sampler.Take(published).Should().NotBeNull();
|
||||
sampler.Take(published).Should().BeNull("the loop hands the same instance over ten times a second");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheFactsAreTheSameListUntilSomethingInThemMoves()
|
||||
{
|
||||
// The recorder writes its context when a reference changes; a publication arrives every second.
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Ffx(samples: 1)));
|
||||
IReadOnlyList<AdvancedFact> first = sampler.Facts;
|
||||
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Ffx(samples: 2)));
|
||||
sampler.Facts.Should().BeSameAs(first, "only counts, the frame time and the clock moved");
|
||||
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Ffx(samples: 3) with { FfxFovMaxBits = InGameStates.Bits(1.3f) }));
|
||||
sampler.Facts.Should().NotBeSameAs(first, "the player zoomed out: the range widened");
|
||||
Rows(Fact(sampler, "ffx.upscale.depth")).Should().Contain("cameraFovAngleVertical=0.9 – 1.3 rad (51.6° – 74.5°)");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EveryFactItMakesIsAnEntryTheCatalogSaysIsReadInsideAGame()
|
||||
{
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
FlAdvancedState both = InGameStates.Ffx() with
|
||||
{
|
||||
ValidMask = FlAdvancedValid.DlssOptions | FlAdvancedValid.FfxUpscale | FlAdvancedValid.FfxMemory,
|
||||
DlssOutputWidth = 3840,
|
||||
DlssOutputHeight = 2160,
|
||||
DlssColorBuffersHdr = 2,
|
||||
};
|
||||
|
||||
IReadOnlyList<AdvancedReading> readings = sampler.Take(new InGameAdvanced(both))!;
|
||||
|
||||
sampler.Facts.Should().OnlyContain(static f => AdvancedMetricCatalog.Find(f.Id)!.Reach == AdvancedReach.Game);
|
||||
AdvancedJson.Storable(sampler.Facts).Should().HaveCount(sampler.Facts.Count, "what the game said may be stored");
|
||||
readings.Select(static r => AdvancedMetricCatalog.Find(r.Series[AdvancedMetric.SeriesPrefix.Length..])!.Reach).Should().OnlyContain(static reach => reach == AdvancedReach.Game);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using FrameLedger.Shared;
|
||||
|
||||
namespace FrameLedger.Application.Tests.Capture;
|
||||
|
||||
/// <summary>
|
||||
/// Region 5 as the Overlay's watchdog would publish it, for the tests of what the Agent makes of it (train B). The
|
||||
/// values are the ones <c>hook-harness --advanced</c> sends and <c>fl_guard</c> asserts on the native side.
|
||||
/// </summary>
|
||||
internal static class InGameStates
|
||||
{
|
||||
public static uint Bits(float value) => BitConverter.SingleToUInt32Bits(value);
|
||||
|
||||
/// <summary>A publication that carries nothing: every float "none seen", as the Overlay's accumulators start.</summary>
|
||||
public static FlAdvancedState Empty(uint samples = 1) => new()
|
||||
{
|
||||
Seq = samples * 2,
|
||||
Samples = samples,
|
||||
Request = 1,
|
||||
SampleQpc = samples,
|
||||
DlssPreExposureBits = FlAdvancedState.FloatNone,
|
||||
DlssExposureScaleBits = FlAdvancedState.FloatNone,
|
||||
FfxSharpnessMinBits = FlAdvancedState.FloatNone,
|
||||
FfxSharpnessMaxBits = FlAdvancedState.FloatNone,
|
||||
FfxJitterMaxXBits = FlAdvancedState.FloatNone,
|
||||
FfxJitterMaxYBits = FlAdvancedState.FloatNone,
|
||||
FfxPreExposureMinBits = FlAdvancedState.FloatNone,
|
||||
FfxPreExposureMaxBits = FlAdvancedState.FloatNone,
|
||||
FfxNearBits = FlAdvancedState.FloatNone,
|
||||
FfxFarBits = FlAdvancedState.FloatNone,
|
||||
FfxFovMinBits = FlAdvancedState.FloatNone,
|
||||
FfxFovMaxBits = FlAdvancedState.FloatNone,
|
||||
};
|
||||
|
||||
/// <summary>The DLSS options <c>hook-harness --advanced</c> chains into its evaluation, as the vendor's values plus one.</summary>
|
||||
public static FlAdvancedState Dlss(uint samples = 1)
|
||||
{
|
||||
FlAdvancedState s = Empty(samples) with
|
||||
{
|
||||
ValidMask = FlAdvancedValid.DlssOptions,
|
||||
DlssStructVersion = 3,
|
||||
DlssOptionsSeen = 60 * samples,
|
||||
DlssOutputWidth = 2560,
|
||||
DlssOutputHeight = 1440,
|
||||
DlssPreExposureBits = Bits(1.5f),
|
||||
DlssExposureScaleBits = Bits(0.75f),
|
||||
DlssColorBuffersHdr = 1, // eFalse
|
||||
DlssAutoExposure = 2, // eTrue
|
||||
DlssAlphaUpscaling = 2,
|
||||
};
|
||||
return WithPresets(s, 12, 11, 1, 14, 13, 1); // DLAA K, Quality J, Balanced default, Performance M, Ultra Performance L, Ultra Quality default
|
||||
}
|
||||
|
||||
/// <summary>What <c>hook-harness --advanced --ffx-memory-query</c> sends FSR, one second of it.</summary>
|
||||
public static FlAdvancedState Ffx(uint samples = 1) => Empty(samples) with
|
||||
{
|
||||
ValidMask = FlAdvancedValid.FfxUpscale | FlAdvancedValid.FfxMemory,
|
||||
FfxDispatches = 60 * samples,
|
||||
FfxSharpenSeen = 2,
|
||||
FfxSharpnessMinBits = Bits(0.35f),
|
||||
FfxSharpnessMaxBits = Bits(0.35f),
|
||||
FfxJitterMaxXBits = Bits(0.3f),
|
||||
FfxJitterMaxYBits = Bits(0.4f),
|
||||
FfxPreExposureMinBits = Bits(1.25f),
|
||||
FfxPreExposureMaxBits = Bits(1.25f),
|
||||
FfxNearBits = Bits(0.1f),
|
||||
FfxFarBits = Bits(1000f),
|
||||
FfxFovMinBits = Bits(0.9f),
|
||||
FfxFovMaxBits = Bits(1.1f),
|
||||
FfxFlagsSeen = 1u << 2,
|
||||
FfxFrameTimeCount = 60,
|
||||
FfxFrameTimeSumUs = 60 * 16_000,
|
||||
FfxMemoryTotalBytes = 256UL * 1024 * 1024,
|
||||
FfxMemoryAliasableBytes = 32UL * 1024 * 1024,
|
||||
FfxMemoryQueries = 60 * samples,
|
||||
};
|
||||
|
||||
/// <summary>The six preset bytes, DLAA first: a fixed buffer, set through the struct's bytes so no test needs unsafe code.</summary>
|
||||
public static FlAdvancedState WithPresets(FlAdvancedState state, params ReadOnlySpan<byte> plusOne)
|
||||
{
|
||||
int at = (int)Marshal.OffsetOf<FlAdvancedState>(nameof(FlAdvancedState.DlssPresets));
|
||||
Span<byte> bytes = MemoryMarshal.AsBytes(new Span<FlAdvancedState>(ref state));
|
||||
plusOne.CopyTo(bytes.Slice(at, 6));
|
||||
return state;
|
||||
}
|
||||
}
|
||||
@@ -97,10 +97,28 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
ValueTask.FromResult(AntiCheatVerdict.Allowed());
|
||||
}
|
||||
|
||||
private sealed class FakeSink(SteppingClock clock, int recordsToServe, ulong adapterLuid = 0) : ICaptureSink
|
||||
/// <summary>Region 5 for a recorder test (train B): what the fake Overlay publishes, and what the loop asked of it.</summary>
|
||||
private sealed class InGameScript
|
||||
{
|
||||
private uint _published;
|
||||
|
||||
/// <summary>What each publication carries; null publishes nothing. The count of publications goes in.</summary>
|
||||
public Func<uint, FlAdvancedState>? Publish { get; init; }
|
||||
|
||||
public List<bool> Asked { get; } = [];
|
||||
|
||||
/// <summary>A new publication on every read, as if the watchdog ticked as often as the test's loop.</summary>
|
||||
public FlAdvancedState? Next() => Publish?.Invoke(++_published);
|
||||
}
|
||||
|
||||
private sealed class FakeSink(SteppingClock clock, int recordsToServe, ulong adapterLuid = 0, InGameScript? inGame = null) : ICaptureSink
|
||||
{
|
||||
private int _served;
|
||||
|
||||
public FlAdvancedState? AdvancedState => inGame?.Asked is [.., true] ? inGame.Next() : null;
|
||||
|
||||
public void SetAdvancedRequested(bool requested) => inGame?.Asked.Add(requested);
|
||||
|
||||
public FlWriterState WriterState => new() { Status = (uint)FlStatus.Ready, HooksInstalledMask = 1, RuntimeCensus = 0x8000_0000 };
|
||||
|
||||
public FlShmHandshake Handshake => new() { AdapterLuid = adapterLuid };
|
||||
@@ -224,12 +242,12 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
}
|
||||
|
||||
private sealed class Factory(IGameConsentStore store, FakeGuard guard, SteppingClock clock, int records, FakeLiveness liveness,
|
||||
IUserModeExceptionSwitch? exceptions = null, IDisplayProbe? display = null, ulong adapterLuid = 0) : ICaptureSessionFactory
|
||||
IUserModeExceptionSwitch? exceptions = null, IDisplayProbe? display = null, ulong adapterLuid = 0, InGameScript? inGame = null) : ICaptureSessionFactory
|
||||
{
|
||||
public CaptureSession Create(ICaptureObserver observer) => new(
|
||||
store, new HookedCaptureGate(guard), guard, new FixedResolver(),
|
||||
new DelegateLivenessSource(_ => liveness),
|
||||
new DelegateRingAttacher(_ => (new FakeSink(clock, records, adapterLuid), ShmAttachRefusal.Ok)),
|
||||
new DelegateRingAttacher(_ => (new FakeSink(clock, records, adapterLuid, inGame), ShmAttachRefusal.Ok)),
|
||||
new CaptureOptions
|
||||
{
|
||||
DrainInterval = TimeSpan.FromMilliseconds(1),
|
||||
@@ -304,7 +322,8 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
|
||||
private async Task<Harness> MakeAsync(bool consented = true, AntiCheatVerdict? verdict = null, int records = 3_000, FakeLiveness? liveness = null, bool poller = true,
|
||||
bool clockStepsOnDrain = false, IDriverProfileSource? profiles = null, bool excepted = false, IDisplayProbe? display = null, ulong adapterLuid = 0,
|
||||
AntiCheatVerdict? rescan = null, ICrashReporterSightings? reporters = null, IAdvancedHardware? advanced = null, bool advancedOn = false)
|
||||
AntiCheatVerdict? rescan = null, ICrashReporterSightings? reporters = null, IAdvancedHardware? advanced = null, bool advancedOn = false,
|
||||
InGameScript? inGame = null)
|
||||
{
|
||||
_db ??= await LedgerDatabase.OpenAsync(Path.Combine(_dir, LedgerPaths.DatabaseFileName), ct: TestContext.Current.CancellationToken).ConfigureAwait(false);
|
||||
var store = new SqliteGameConsentStore(_db);
|
||||
@@ -330,7 +349,7 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
var partials = new FakePartialSessionStore();
|
||||
FakePoller? fakePoller = poller ? new FakePoller(clockStepsOnDrain ? clock : null) : null;
|
||||
var recorder = new SessionRecorder(
|
||||
new Factory(store, guard, clock, records, liveness ?? _alive, excepted ? new FakeExceptionSwitch(on: true) : null, display, adapterLuid),
|
||||
new Factory(store, guard, clock, records, liveness ?? _alive, excepted ? new FakeExceptionSwitch(on: true) : null, display, adapterLuid, inGame),
|
||||
games, new FakeSnapshots(), new FixedHardware(), partials,
|
||||
new SessionFinalizer(sessions, new RawSeriesCodec()), new NoCrashEvents(),
|
||||
_ => fakePoller, clock,
|
||||
@@ -823,6 +842,86 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
r.Row.Tier.Should().Be(CaptureTier.Hooked, "and the session itself is what it always was");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WithAdvancedMetricsOffTheOverlayIsToldSoAndNothingTheGameSaidIsStored()
|
||||
{
|
||||
// D111, the Agent's half: off is a word that is written, and a region that holds something is not read.
|
||||
var script = new InGameScript { Publish = static n => InGameStates.Ffx(n) };
|
||||
Harness h = await MakeAsync(advanced: new FakeAdvanced { Latest = FakeAdvanced.Snapshot() }, advancedOn: false, inGame: script);
|
||||
|
||||
await h.Recorder.RecordAsync(Request(), TestContext.Current.CancellationToken);
|
||||
|
||||
script.Asked.Should().Equal(false);
|
||||
FinalizedSession stored = h.Sessions.Stored.Single();
|
||||
stored.Advanced.Should().BeNull();
|
||||
stored.Sensors.Should().NotContain(static b => b.Series.StartsWith(AdvancedMetric.SeriesPrefix, StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WithAdvancedMetricsOnWhatTheGameToldItsUpscalerIsStoredWithTheSession()
|
||||
{
|
||||
var hub = new FakeAdvanced { Latest = FakeAdvanced.Snapshot() };
|
||||
var script = new InGameScript { Publish = static n => InGameStates.Ffx(n) };
|
||||
Harness h = await MakeAsync(advanced: hub, advancedOn: true, inGame: script);
|
||||
|
||||
RecordedSession r = await h.Recorder.RecordAsync(Request(), TestContext.Current.CancellationToken);
|
||||
|
||||
script.Asked.Should().Equal(true);
|
||||
FinalizedSession stored = h.Sessions.Stored.Single();
|
||||
AdvancedSessionRow row = stored.Advanced.Should().BeOfType<AdvancedSessionRow>().Subject;
|
||||
(IReadOnlyList<AdvancedFact> facts, AdvancedSources sources) = AdvancedJson.ParseSession(row.FactsJson);
|
||||
facts.Select(static f => f.Id).Should().Equal(
|
||||
["nvapi.session.vrr_enabled", "ffx.upscale.sharpening", "ffx.upscale.jitter", "ffx.upscale.exposure", "ffx.upscale.depth", "ffx.upscale.flags"],
|
||||
"the driver's facts of the session, then what the game said");
|
||||
facts.Single(static f => string.Equals(f.Id, "ffx.upscale.depth", StringComparison.Ordinal)).Value.Rows!.Select(static x => x.Value).Should().Contain("0.9 – 1.1 rad (51.6° – 63°)");
|
||||
sources.InGame.Should().Be(AdvancedInGameStatus.Reading);
|
||||
sources.Nvapi.Should().Be(AdvancedSourceStatus.Reading, "the Agent's own sources are said as before");
|
||||
|
||||
// The two series, beside whatever the Agent's own reader gave the same tick.
|
||||
stored.Sensors.Select(static b => b.Series).Should().Contain([InGameAdvancedSampler.FrameTimeSeries, InGameAdvancedSampler.MemorySeries]);
|
||||
row.StatsJson.Should().Contain(InGameAdvancedSampler.FrameTimeSeries).And.Contain(InGameAdvancedSampler.MemorySeries);
|
||||
IReadOnlyDictionary<string, SensorSeriesStats> stats = AdvancedJson.ParseStats(row.StatsJson);
|
||||
stats[InGameAdvancedSampler.FrameTimeSeries].Mean.Should().BeApproximately(16.0, 1e-3, "sixty dispatches of 16 ms a publication");
|
||||
stats[InGameAdvancedSampler.MemorySeries].Max.Should().BeApproximately(256.0, 1e-3);
|
||||
h.Partials.Created[r.Row.SessionGuid].AdvancedContexts.Should().NotBeEmpty("a recovered session keeps what the game said too");
|
||||
r.Row.Tier.Should().Be(CaptureTier.Hooked);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AHookedSessionWhoseGameMadeNoneOfTheCallsSaysSoRatherThanNothing()
|
||||
{
|
||||
// Most titles: no FSR through ffx-api, and DLSS options set through a call that has no export. The row must
|
||||
// not read as "the game uses no upscaler".
|
||||
var script = new InGameScript();
|
||||
Harness h = await MakeAsync(advanced: new FakeAdvanced { Latest = FakeAdvanced.Snapshot() }, advancedOn: true, inGame: script);
|
||||
|
||||
await h.Recorder.RecordAsync(Request(), TestContext.Current.CancellationToken);
|
||||
|
||||
script.Asked.Should().Equal(true);
|
||||
AdvancedSessionRow row = h.Sessions.Stored.Single().Advanced.Should().BeOfType<AdvancedSessionRow>().Subject;
|
||||
(IReadOnlyList<AdvancedFact> facts, AdvancedSources sources) = AdvancedJson.ParseSession(row.FactsJson);
|
||||
facts.Select(static f => f.Id).Should().Equal("nvapi.session.vrr_enabled");
|
||||
sources.InGame.Should().Be(AdvancedInGameStatus.NothingSeen);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ASessionThatWasNotMeasuredInsideTheGameSaysThatOfItsInGameEntries()
|
||||
{
|
||||
var script = new InGameScript { Publish = static n => InGameStates.Ffx(n) };
|
||||
Harness h = await MakeAsync(
|
||||
verdict: AntiCheatVerdict.Refused(AntiCheatRefusalReason.BlockedModule, "BattlEye", "BEClient_x64.dll"),
|
||||
advanced: new FakeAdvanced { Latest = FakeAdvanced.Snapshot() }, advancedOn: true, inGame: script, clockStepsOnDrain: true);
|
||||
|
||||
RecordedSession r = await h.Recorder.RecordAsync(Request(), TestContext.Current.CancellationToken);
|
||||
|
||||
r.Row.Tier.Should().Be(CaptureTier.NotHooked);
|
||||
script.Asked.Should().BeEmpty("there was no ring to write the word to");
|
||||
AdvancedSessionRow row = h.Sessions.Stored.Single().Advanced.Should().BeOfType<AdvancedSessionRow>().Subject;
|
||||
(IReadOnlyList<AdvancedFact> facts, AdvancedSources sources) = AdvancedJson.ParseSession(row.FactsJson);
|
||||
facts.Should().NotContain(static f => f.Id.StartsWith("ffx.", StringComparison.Ordinal) || f.Id.StartsWith("sl.", StringComparison.Ordinal));
|
||||
sources.InGame.Should().Be(AdvancedInGameStatus.NotHooked);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ASessionWithTheOptionOnWhoseReaderNeverAnsweredStillStoresARowThatSaysSo()
|
||||
{
|
||||
@@ -837,7 +936,7 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
row.MachineFactsJson.Should().BeNull();
|
||||
(IReadOnlyList<AdvancedFact> facts, AdvancedSources sources) = AdvancedJson.ParseSession(row.FactsJson);
|
||||
facts.Should().BeEmpty("a read that threw costs the session its facts, not itself");
|
||||
sources.Should().Be(AdvancedSources.Unknown);
|
||||
sources.Should().Be(AdvancedSources.Unknown with { InGame = AdvancedInGameStatus.NothingSeen }, "the Agent's sources never answered; the game was measured from inside and made none of the calls");
|
||||
hub.Released.Should().Be(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user