Compare commits
1
Commits
alpha
...
beta8/trend-fps
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3fa56f58b |
No files matched your search
@@ -49,6 +49,8 @@ under a `## [x.y.z] - date` heading in the same commit that bumps `VERSION`, the
|
||||
- **A session's summary lists the libraries the game had loaded** — recorded since the first beta and shown nowhere
|
||||
until now — and says when one differs from the copy the game ships ("nvngx_dlss.dll 310.2.1.0 (the game ships
|
||||
3.7.10.0: another copy was loaded, for example by the driver or the NVIDIA App)").
|
||||
- **FPS with two decimals** (Settings ▸ Window ▸ *Show FPS with two decimals*, off by default): every FPS figure reads
|
||||
"62.40" instead of "62". Whole numbers now round half up (62.5 is 63); they rounded half to even.
|
||||
- **FrameLedger says when the NVIDIA App overrides a game's DLSS.** Each session now records the NVIDIA driver profile
|
||||
the game ran under — read from the driver's own settings, never from the game — and its summary says what that
|
||||
profile overrides: "NVIDIA profile “…”: DLSS override (preset K, Quality) · Frame Generation override (×4)", Ray
|
||||
@@ -100,6 +102,17 @@ under a `## [x.y.z] - date` heading in the same commit that bumps `VERSION`, the
|
||||
|
||||
### Fixed
|
||||
|
||||
- **The Trend tab was blank the first time a game's page opened.** It is drawn at once, on a date axis that keeps its
|
||||
label and the theme's colours. "Average" is two metrics now — Native FPS and Presented FPS — so a line never mixes
|
||||
the two, and never shows a presented rate that includes generated frames. Temperatures, loads, power and memory
|
||||
include sessions recorded without hooking; points that describe only part of their session are drawn hollow; several
|
||||
hardware changes on one day are one marker.
|
||||
- **A steady-state frame-generation factor always shows the share of the session it covers** — the average card,
|
||||
Compare and the Sessions grid's FG× column dropped it. The game header's "Lifetime average" was the last measured
|
||||
session and is labelled so.
|
||||
- **Compare**: the best value is highlighted in the accent colour (it was only bold), two values that read the same are
|
||||
both best, CPU and GPU load are not ranked, the percentile chart spans 0–100 again, and exported PNGs have a solid
|
||||
background.
|
||||
- **Ending a game with End task is no longer a "crash".** Every non-zero exit code was one, and Task Manager leaves 1.
|
||||
A crash is now an exception's exit code or Windows' own crash record, and the session summary says how each session
|
||||
ended: "crashed (0xC0000005 access violation)", "ended with exit code 1 — what End task and taskkill leave". The
|
||||
|
||||
@@ -350,6 +350,7 @@ switch's rule); integers are invariant-culture within an inclusive range; choice
|
||||
| `ui.start_with_windows` | bool | `0` | | UI (P4) |
|
||||
| `ui.minimize_to_tray` | bool | `0` | | UI (PR-8) |
|
||||
| `ui.hide_anticheat_hooking` | bool | `1` | | UI (beta.8, 2026-09-25): the game page of an entry the guard found anti-cheat in shows the finding in place of its Hooking card (`08_UI` §Game detail) |
|
||||
| `ui.fps_decimals` | bool | `0` | | UI (beta.8, 2026-09-25): every FPS figure with two decimals ("62.40") instead of a whole number |
|
||||
| `capture.background` | bool | `1` | | Agent |
|
||||
| `hooking.kill_switch` | bool | `0` | | Agent (FR-2.4, since P2 PR-F) |
|
||||
| `capture.min_session_s` | int | `30` | 5–600 | Agent, per session (FR-3.6) |
|
||||
|
||||
@@ -257,6 +257,33 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
> per-present `vram_proc` (a held 1 Hz sample) and the adapter-wide `vram_adapter` sensor as two
|
||||
> differently-labelled series. **Latency**: the `latency_us` blob with the stored avg / p95 lines, shown only
|
||||
> when Reflex reported (`reflex_active`); otherwise the tab says so.
|
||||
>
|
||||
> **Trend, corrected 2026-09-25 (beta.8, owner item 6: "does Trend really work?").** It did not, on first open: the
|
||||
> view model started loading before the page existed, and a load that finished first raised `TrendPresented` to nobody
|
||||
> — the tab was blank until something reloaded it. The page now draws what the view model holds when it is made
|
||||
> (`PagesLoadTests.TheTrendIsDrawnWhenThePageIsMadeOnADateAxisThatKeepsItsLabel`). Also: the date axis is created
|
||||
> BEFORE the theme and the label (`DateTimeTicksBottom` replaces the bottom axis, and made afterwards it dropped both);
|
||||
> **Average is two metrics** — *Presented FPS* on sessions that counted no generated frame (never on one that did: its
|
||||
> presented rate includes them, the single inflated number rule 6 forbids) and *Native FPS* where frame generation was
|
||||
> measured — and the trend opens on Native when the newest measured session counted generated frames; the machine
|
||||
> metrics count **Tier-2 sessions too** (a game never hooked had no trend); a point that describes part of its session —
|
||||
> settings changed, or a steady state, for Native and Displayed as well as the factor — is drawn **hollow** and the
|
||||
> note says so; hardware changes on one day are **one** marker; the metric list is built in the language the page opens
|
||||
> in; the empty text names the metric.
|
||||
>
|
||||
> **FPS with two decimals (same day, owner item 7).** Settings ▸ Window: *Show FPS with two decimals*
|
||||
> (`ui.fps_decimals`, off by default) — every FPS figure through `Formats.FpsNumber`: "62.40" when on, "62" when off,
|
||||
> rounded half away from zero both ways (it rounded half to even). `Services.FpsDecimals` holds it for the process
|
||||
> like `LoggingLevel`: read at start, moved at once by the toggle, shown by a page the next time it formats.
|
||||
>
|
||||
> **Rule 6, the places that dropped the share (same day).** A steady-state factor is never shown without its share:
|
||||
> the readout line ("58 → 116 FPS (×2.0 FG · 75%)"), which the Average card and Compare use, and the Sessions grid's
|
||||
> FG× column ("×2.0 · 75%"). The header's "Lifetime average" was the last measured session's readout and says so now.
|
||||
>
|
||||
> **Compare (same day).** The best cell is in the accent colour — a local `Foreground` on the cell outranked the
|
||||
> trigger, so it was only ever bold — and "best" is the best as shown (62.4 and 62.3 both read 62, both best); the load
|
||||
> rows rank nothing; the percentile axis is 0–100 again (`AutoScale` ran after `SetLimitsX` and undid it); exported
|
||||
> PNGs have an opaque background (`ChartTheme.SavePng`: the window's colour under the transparent figure).
|
||||
|
||||
### Session summary (secondary `FluentWindow`, also the post-session toast target)
|
||||
Stat cards (Avg uses `FpsReadout`, Median, 1% Low, 0.1% Low, Min/Max, σ, stutter %, duration), TriState chips, API/PresentMode/upscaler line, crash `InfoBar` (Severity=Error) when `crashed`, frametime chart, sensor strip, tags/notes editor, Export buttons.
|
||||
|
||||
@@ -1613,6 +1613,13 @@ only be refused, never the finding (FR-2.2).
|
||||
struct): C puts typedefs and functions in one namespace, and MSVC's error names neither clearly.
|
||||
- **The driver profile is a configuration.** `sessions.driver_profile` says what the NVIDIA App set; it never feeds
|
||||
the upscaler ladder or the factor. The bridge has no DRS writer, and a PR that adds one is a different product.
|
||||
- **A view model that loads in its constructor raises its events to nobody** until the page subscribes; a page must
|
||||
draw what the view model already holds when it is made (the Trend tab was blank on every first open).
|
||||
- **`Axes.DateTimeTicksBottom()` replaces the bottom axis**: call it before the theme and the label, or both are lost.
|
||||
- **A local property value outranks a style trigger** (Compare's best cell was never accent-coloured): defaults a
|
||||
trigger may change go in the Style as Setters.
|
||||
- **`ui.fps_decimals` is process-wide state** (`FpsDecimals`): a test that moves it belongs to `StringsCultureCollection`
|
||||
with every test that reads FPS text, and restores it.
|
||||
- **A status is not a policy input.** Splitting End task (exit 1) out of `crashed` would have loosened the crash
|
||||
auto-disable had the policy kept reading the status alone; it takes the exit code too. Check every reader of a value
|
||||
whose meaning you narrow.
|
||||
|
||||
@@ -98,6 +98,7 @@ public partial class App : System.Windows.Application
|
||||
ApplyCulture(appearance.Language);
|
||||
var registered = new RegisteredSettings(store);
|
||||
LoggingLevel.SetDebug(await registered.GetBooleanAsync(SettingsRegistry.LogDebug).ConfigureAwait(true));
|
||||
FpsDecimals.Two = await registered.GetBooleanAsync(SettingsRegistry.UiFpsDecimals).ConfigureAwait(true);
|
||||
var closePolicy = new WindowClosePolicy { MinimizeToTray = await registered.GetBooleanAsync(SettingsRegistry.UiMinimizeToTray).ConfigureAwait(true) };
|
||||
|
||||
_host = BuildHost(_db, appearance, registered, closePolicy);
|
||||
|
||||
@@ -32,6 +32,41 @@ public static class ChartTheme
|
||||
plot.Legend.FontColor = p.Axis;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save the plot as a PNG with an OPAQUE background (beta.8): on screen the figure is transparent over its card, but an
|
||||
/// exported image has no card behind it, and a viewer painted its own colour under the theme's text — white axis labels
|
||||
/// on a white page. The window's colour is painted for the file and the plot restored.
|
||||
/// </summary>
|
||||
public static void SavePng(Plot plot, string path, int width, int height)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(plot);
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(path);
|
||||
Color figure = plot.FigureBackground.Color;
|
||||
Color data = plot.DataBackground.Color;
|
||||
Color window = ApplicationThemeManager.GetAppTheme() == ApplicationTheme.Light ? Color.FromHex("#F3F3F3") : Color.FromHex("#202020");
|
||||
try
|
||||
{
|
||||
plot.FigureBackground.Color = Over(figure, window);
|
||||
plot.DataBackground.Color = Over(data, Over(figure, window));
|
||||
plot.SavePng(path, width, height);
|
||||
}
|
||||
finally
|
||||
{
|
||||
plot.FigureBackground.Color = figure;
|
||||
plot.DataBackground.Color = data;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Source-over: <paramref name="top"/> composited on an opaque <paramref name="under"/>.</summary>
|
||||
internal static Color Over(Color top, Color under)
|
||||
{
|
||||
double a = top.A / 255.0;
|
||||
return new Color(
|
||||
(byte)Math.Round((top.R * a) + (under.R * (1 - a))),
|
||||
(byte)Math.Round((top.G * a) + (under.G * (1 - a))),
|
||||
(byte)Math.Round((top.B * a) + (under.B * (1 - a))));
|
||||
}
|
||||
|
||||
/// <summary>Registers a control so a theme change re-applies and refreshes it (weakly held; a closed window is forgotten).</summary>
|
||||
public static void Attach(WpfPlot control)
|
||||
{
|
||||
|
||||
@@ -44,8 +44,10 @@ public partial class CompareChart : UserControl
|
||||
|
||||
if (DrawnCurves > 0)
|
||||
{
|
||||
plot.Axes.SetLimitsX(0, 100);
|
||||
// The percentile axis is 0–100 whatever the data: AutoScale first, then the X limits (beta.8 — the other way
|
||||
// round, AutoScale undid them).
|
||||
plot.Axes.AutoScale();
|
||||
plot.Axes.SetLimitsX(0, 100);
|
||||
plot.ShowLegend(Alignment.UpperRight);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,17 +17,23 @@ public partial class TrendChart : UserControl
|
||||
|
||||
public int DrawnPoints { get; private set; }
|
||||
|
||||
/// <summary>How many of <see cref="DrawnPoints"/> were drawn hollow (a part of their session).</summary>
|
||||
public int HollowPoints { get; private set; }
|
||||
|
||||
public void Show(IReadOnlyList<TrendPoint> points, IReadOnlyList<HardwareChange> changes, string metricLabel)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(points);
|
||||
ArgumentNullException.ThrowIfNull(changes);
|
||||
ScottPlot.Plot plot = Plot.Plot;
|
||||
plot.Clear();
|
||||
// The date axis REPLACES the bottom axis, so it goes first (beta.8): made after the theme and the label, it dropped
|
||||
// both — an unlabelled axis in the default colours, unreadable in the dark theme.
|
||||
plot.Axes.DateTimeTicksBottom();
|
||||
ChartTheme.Apply(plot);
|
||||
plot.XLabel(Strings.Trend_Axis_Date);
|
||||
plot.YLabel(metricLabel);
|
||||
plot.Axes.DateTimeTicksBottom();
|
||||
DrawnPoints = points.Count;
|
||||
HollowPoints = points.Count(static t => t.SettingsChangedMidSession);
|
||||
if (points.Count > 0)
|
||||
{
|
||||
ChartPalette p = ChartTheme.Current;
|
||||
@@ -37,7 +43,20 @@ public partial class TrendChart : UserControl
|
||||
line.LineWidth = 2;
|
||||
line.MarkerSize = 7;
|
||||
line.LegendText = metricLabel;
|
||||
foreach (HardwareChange change in changes)
|
||||
|
||||
// A point that describes part of its session (settings changed, or a steady state) is drawn hollow over its
|
||||
// filled one: the line still passes through it, and it cannot be read as the session's own number.
|
||||
TrendPoint[] partial = [.. points.Where(static t => t.SettingsChangedMidSession)];
|
||||
if (partial.Length > 0)
|
||||
{
|
||||
double[] hx = [.. partial.Select(static t => t.At.LocalDateTime.ToOADate())];
|
||||
double[] hy = [.. partial.Select(static t => t.Value)];
|
||||
Scatter hollow = plot.Add.ScatterPoints(hx, hy, p.Data);
|
||||
hollow.MarkerSize = 6;
|
||||
hollow.MarkerShape = MarkerShape.FilledCircle;
|
||||
}
|
||||
|
||||
foreach (HardwareChange change in TrendSeriesBuilder.MergedByDay(changes))
|
||||
{
|
||||
VerticalLine marker = plot.Add.VerticalLine(change.At.LocalDateTime.ToOADate(), 1, p.StutterPso, LinePattern.Dashed);
|
||||
marker.LabelText = change.Text;
|
||||
|
||||
@@ -3,8 +3,15 @@ namespace FrameLedger.App.Charts;
|
||||
/// <summary>The Trend tab's selector (<c>08_UI</c> §Games › Trend).</summary>
|
||||
public enum TrendMetric
|
||||
{
|
||||
/// <summary>Native FPS where frame generation was measured; Presented FPS where it was not (the row's headline, per <c>03_METRICS</c> Avg FPS).</summary>
|
||||
Average,
|
||||
/// <summary>
|
||||
/// Presented FPS — every frame presented — on the sessions where no generated frame was counted (beta.8: "Average" mixed
|
||||
/// it with Native in one line). A session that counted generated frames has none here: its presented rate includes them,
|
||||
/// the single inflated number CLAUDE.md rule 6 forbids; it is on <see cref="NativeFps"/> and <see cref="Displayed"/>.
|
||||
/// </summary>
|
||||
PresentedFps,
|
||||
|
||||
/// <summary>Native FPS — the game's own frames — only where frame generation was measured (counted, or measured none).</summary>
|
||||
NativeFps,
|
||||
|
||||
/// <summary>Displayed FPS — only sessions that measured frame generation have one.</summary>
|
||||
Displayed,
|
||||
|
||||
@@ -7,10 +7,15 @@ using FrameLedger.Domain.Sessions;
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>
|
||||
/// The Trend tab's data (FR-6.3, FR-6.4): one point per hooked session that has the metric, oldest first, with
|
||||
/// the sessions that changed settings mid-session excluded unless asked for; and a marker wherever two
|
||||
/// consecutive sessions' hardware snapshots differ in what a reader would want to know about.
|
||||
/// The Trend tab's data (FR-6.3, FR-6.4): one point per session that has the metric, oldest first, with the points that
|
||||
/// describe only part of their session excluded unless asked for; and a marker wherever two consecutive sessions'
|
||||
/// hardware snapshots differ in what a reader would want to know about.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <b>Which sessions (beta.8).</b> A frame-rate metric is the hooks' and comes from hooked sessions only; a machine metric
|
||||
/// — temperatures, loads, power, memory — is the telemetry every session records, Tier 2 included, which the trend left
|
||||
/// out until 2026-09-25 (a game never hooked had no trend at all).
|
||||
/// </remarks>
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format string is a resource that follows the UI culture, which changes at runtime")]
|
||||
public static class TrendSeriesBuilder
|
||||
{
|
||||
@@ -18,7 +23,7 @@ public static class TrendSeriesBuilder
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(rows);
|
||||
var points = new List<TrendPoint>();
|
||||
foreach (SessionRow row in rows.Where(static r => r.Tier == CaptureTier.Hooked).OrderBy(static r => r.StartedAt))
|
||||
foreach (SessionRow row in rows.Where(r => Counts(r, metric)).OrderBy(static r => r.StartedAt))
|
||||
{
|
||||
bool partial = IsPartial(row, metric);
|
||||
if (partial && !includeMidSessionChanges)
|
||||
@@ -37,12 +42,23 @@ public static class TrendSeriesBuilder
|
||||
}
|
||||
|
||||
/// <summary>How many sessions FR-6.4 leaves out at the default setting.</summary>
|
||||
public static int ExcludedCount(IReadOnlyList<SessionRow> rows) => ExcludedCount(rows, TrendMetric.Average);
|
||||
public static int ExcludedCount(IReadOnlyList<SessionRow> rows) => ExcludedCount(rows, TrendMetric.PresentedFps);
|
||||
|
||||
/// <summary>Whether a session can have a point for <paramref name="metric"/>: a frame rate needs the hooks; the machine is every session's.</summary>
|
||||
public static bool Counts(SessionRow row, TrendMetric metric)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
return row.Tier == CaptureTier.Hooked || IsMachineMetric(metric);
|
||||
}
|
||||
|
||||
/// <summary>The metrics that are telemetry, recorded by every session whatever its tier.</summary>
|
||||
public static bool IsMachineMetric(TrendMetric metric) => metric is TrendMetric.MaxGpuTemp or TrendMetric.AvgGpuLoad or TrendMetric.AvgGpuPower
|
||||
or TrendMetric.AvgCpuLoad or TrendMetric.MaxCpuTemp or TrendMetric.AvgRam;
|
||||
|
||||
public static int ExcludedCount(IReadOnlyList<SessionRow> rows, TrendMetric metric)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(rows);
|
||||
return rows.Count(r => r.Tier == CaptureTier.Hooked && IsPartial(r, metric));
|
||||
return rows.Count(r => Counts(r, metric) && IsPartial(r, metric) && ValueOf(r, metric) is not null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -52,8 +68,11 @@ public static class TrendSeriesBuilder
|
||||
public static bool IsPartial(SessionRow row, TrendMetric metric)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
// A steady state (CLAUDE.md rule 6, 2026-09-17) is the factor's AND the Native / Displayed rates beside it: all three
|
||||
// describe the state the session spent most of its generating time in, never the whole session (beta.8).
|
||||
return row.SettingsChangedMidSession
|
||||
|| (metric == TrendMetric.FgFactor && string.Equals(row.FgFactorScope, "steady", StringComparison.Ordinal));
|
||||
|| (metric is TrendMetric.FgFactor or TrendMetric.NativeFps or TrendMetric.Displayed
|
||||
&& string.Equals(row.FgFactorScope, "steady", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
/// <summary>The metric's value on a row, or null when that row cannot have it (FR-4.9: never an estimate).</summary>
|
||||
@@ -63,9 +82,11 @@ public static class TrendSeriesBuilder
|
||||
FpsReadoutModel readout = FpsPresentation.FromRow(row);
|
||||
return metric switch
|
||||
{
|
||||
TrendMetric.Average => readout.Kind switch
|
||||
TrendMetric.NativeFps => readout.Kind is FpsReadoutKind.Generated or FpsReadoutKind.None ? readout.Native : null,
|
||||
TrendMetric.PresentedFps => readout.Kind switch
|
||||
{
|
||||
FpsReadoutKind.Generated or FpsReadoutKind.None => readout.Native,
|
||||
// A measured none: the presents are the application's frames, so the rate is both.
|
||||
FpsReadoutKind.None => readout.Native,
|
||||
FpsReadoutKind.Presented or FpsReadoutKind.IdentifiedUncounted => readout.Presented,
|
||||
_ => null,
|
||||
},
|
||||
@@ -84,6 +105,17 @@ public static class TrendSeriesBuilder
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// One marker per day that changed (beta.8): every difference found on that day in one label, line after line — two
|
||||
/// labels at one position were drawn over each other.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<HardwareChange> MergedByDay(IReadOnlyList<HardwareChange> changes)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(changes);
|
||||
return [.. changes.GroupBy(static c => c.At.LocalDateTime.Date)
|
||||
.Select(static g => new HardwareChange(g.First().At, string.Join(Environment.NewLine, g.Select(static c => c.Text).Distinct(StringComparer.Ordinal))))];
|
||||
}
|
||||
|
||||
/// <summary>Markers between consecutive sessions (oldest first) whose snapshots differ; <paramref name="snapshotOf"/> resolves a row's snapshot id.</summary>
|
||||
public static IReadOnlyList<HardwareChange> Changes(IReadOnlyList<SessionRow> rows, Func<long, HardwareSnapshot?> snapshotOf)
|
||||
{
|
||||
|
||||
@@ -88,9 +88,12 @@
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:CompareCell}">
|
||||
<TextBlock Margin="4,0" Text="{Binding Text}" Foreground="{DynamicResource TextFillColorPrimaryBrush}">
|
||||
<!-- The default foreground is the Style's, not a local value (beta.8): a local value outranks every
|
||||
trigger, and the best cell was bold but never in the accent colour. -->
|
||||
<TextBlock Margin="4,0" Text="{Binding Text}">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsBest}" Value="True">
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
|
||||
@@ -283,7 +283,7 @@
|
||||
<StackPanel Margin="0,12,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:TextBlock Appearance="Secondary" VerticalAlignment="Center" Margin="0,0,8,0" Text="{x:Static vm:GameDetailViewModel.TrendMetricLabel}" />
|
||||
<ComboBox MinWidth="180" AutomationProperties.Name="{x:Static vm:GameDetailViewModel.TrendMetricLabel}" DisplayMemberPath="Label" ItemsSource="{x:Static vm:GameDetailViewModel.TrendMetrics}"
|
||||
<ComboBox MinWidth="180" AutomationProperties.Name="{x:Static vm:GameDetailViewModel.TrendMetricLabel}" DisplayMemberPath="Label" ItemsSource="{Binding ViewModel.TrendMetrics}"
|
||||
SelectedValue="{Binding ViewModel.TrendMetric, Mode=TwoWay}" SelectedValuePath="Value" />
|
||||
<CheckBox Margin="16,0,0,0" VerticalAlignment="Center" Content="{x:Static vm:GameDetailViewModel.IncludeMidSessionText}"
|
||||
IsChecked="{Binding ViewModel.IncludeMidSession}" />
|
||||
@@ -291,7 +291,8 @@
|
||||
<ui:TextBlock Margin="0,6,0,0" Appearance="Tertiary" Text="{Binding ViewModel.TrendExcludedText}"
|
||||
Visibility="{Binding ViewModel.TrendExcludedText, Converter={StaticResource NullToCollapsed}}" />
|
||||
<ui:TextBlock Margin="0,6,0,0" Appearance="Tertiary" TextWrapping="Wrap" Text="{x:Static vm:GameDetailViewModel.TrendAverageNote}" />
|
||||
<ui:TextBlock Margin="0,12,0,0" Appearance="Secondary" TextWrapping="Wrap" Text="{x:Static vm:GameDetailViewModel.TrendEmptyText}"
|
||||
<ui:TextBlock Margin="0,6,0,0" Appearance="Tertiary" TextWrapping="Wrap" Text="{x:Static vm:GameDetailViewModel.TrendPartialNote}" />
|
||||
<ui:TextBlock Margin="0,12,0,0" Appearance="Secondary" TextWrapping="Wrap" Text="{Binding ViewModel.TrendEmptyMessage}"
|
||||
Visibility="{Binding ViewModel.TrendEmpty, Converter={StaticResource BoolToVis}}" />
|
||||
<charts:TrendChart x:Name="Trend" Height="320" Visibility="{Binding ViewModel.TrendEmpty, Converter={StaticResource InverseBoolToVis}}" />
|
||||
</StackPanel>
|
||||
|
||||
@@ -14,6 +14,10 @@ public partial class GameDetailPage : INavigableView<GameDetailViewModel>
|
||||
InitializeComponent();
|
||||
ViewModel.SelectionPresented += OnSelectionPresented;
|
||||
ViewModel.TrendPresented += OnTrendPresented;
|
||||
// The view model starts loading before this page exists, and a load that finished first raised its events to
|
||||
// nobody: the Trend tab was blank on every first open (beta.8). Draw what it holds now; a later load redraws.
|
||||
OnTrendPresented(this, EventArgs.Empty);
|
||||
OnSelectionPresented(this, EventArgs.Empty);
|
||||
Unloaded += (_, _) =>
|
||||
{
|
||||
ViewModel.SelectionPresented -= OnSelectionPresented;
|
||||
|
||||
@@ -226,6 +226,17 @@
|
||||
</ui:CardControl.Header>
|
||||
<ui:ToggleSwitch AutomationProperties.Name="{x:Static res:Strings.Settings_MinimizeToTray_Label}" IsChecked="{Binding ViewModel.MinimizeToTray, Mode=TwoWay}" />
|
||||
</ui:CardControl>
|
||||
<!-- beta.8 (owner request 2026-09-25): two decimals on every FPS figure. -->
|
||||
<ui:CardControl Margin="0,8,0,0" Icon="{ui:SymbolIcon NumberSymbol24}">
|
||||
<ui:CardControl.Header>
|
||||
<StackPanel>
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static res:Strings.Settings_FpsDecimals_Label}" />
|
||||
<ui:TextBlock MaxWidth="520" HorizontalAlignment="Left" Appearance="Secondary" TextWrapping="Wrap"
|
||||
Text="{x:Static res:Strings.Settings_FpsDecimals_Body}" />
|
||||
</StackPanel>
|
||||
</ui:CardControl.Header>
|
||||
<ui:ToggleSwitch AutomationProperties.Name="{x:Static res:Strings.Settings_FpsDecimals_Label}" IsChecked="{Binding ViewModel.FpsTwoDecimals, Mode=TwoWay}" />
|
||||
</ui:CardControl>
|
||||
|
||||
<!--
|
||||
Updates, logging, legal. The Privacy card — the `privacy.online_metadata` toggle — is not shown
|
||||
|
||||
@@ -17,9 +17,20 @@ namespace FrameLedger.App.Services;
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime; a cached CompositeFormat would pin the first culture")]
|
||||
public static class Formats
|
||||
{
|
||||
public static string Fps(double? value) => value is double v ? Math.Round(v).ToString("0", CultureInfo.CurrentCulture) : Strings.Common_NotAvailable;
|
||||
public static string Fps(double? value) => value is double v ? FpsNumber(v) : Strings.Common_NotAvailable;
|
||||
|
||||
public static string FpsOrDash(double? value) => value is double v ? Math.Round(v).ToString("0", CultureInfo.CurrentCulture) : Strings.Common_Dash;
|
||||
public static string FpsOrDash(double? value) => value is double v ? FpsNumber(v) : Strings.Common_Dash;
|
||||
|
||||
/// <summary>
|
||||
/// An FPS figure as <c>ui.fps_decimals</c> asks (beta.8): two decimals always ("62.40"), or a whole number. Rounded half
|
||||
/// away from zero — 62.5 is 63, as a reader expects; <see cref="Math.Round(double)"/> alone rounds half to even (62).
|
||||
/// </summary>
|
||||
public static string FpsNumber(double value) => FpsNumber(value, FpsDecimals.Two);
|
||||
|
||||
/// <summary>The same with the choice given (tests, and anything that must not read the process-wide setting).</summary>
|
||||
public static string FpsNumber(double value, bool twoDecimals) => twoDecimals
|
||||
? Math.Round(value, 2, MidpointRounding.AwayFromZero).ToString("0.00", CultureInfo.CurrentCulture)
|
||||
: Math.Round(value, MidpointRounding.AwayFromZero).ToString("0", CultureInfo.CurrentCulture);
|
||||
|
||||
/// <summary><c>1h 23m</c> above an hour, <c>4m 05s</c> below.</summary>
|
||||
public static string Duration(double seconds)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// <c>ui.fps_decimals</c> as the formatters read it (beta.8, owner request 2026-09-25): whether every FPS figure shows two
|
||||
/// decimals ("62.40") or a whole number ("62"). One process-wide value like <see cref="LoggingLevel"/>: set from the settings
|
||||
/// row at start and by the Settings page when it changes; a page shows it the next time it formats a number.
|
||||
/// </summary>
|
||||
public static class FpsDecimals
|
||||
{
|
||||
private static volatile bool _two;
|
||||
|
||||
/// <summary>True: two decimals, always ("62.40"); false: a whole number.</summary>
|
||||
public static bool Two
|
||||
{
|
||||
get => _two;
|
||||
set => _two = value;
|
||||
}
|
||||
}
|
||||
@@ -70,6 +70,8 @@ public static class FpsPresentation
|
||||
FpsReadoutModel m = FromRow(row);
|
||||
return m.Kind switch
|
||||
{
|
||||
// A steady-state factor carries its share in the grid too (rule 6; beta.8 — the column was the one place it did not).
|
||||
FpsReadoutKind.Generated when m.Factor is double f && m.SteadyShare is double share => string.Format(CultureInfo.CurrentCulture, "×{0:0.0} · {1:0}%", f, share * 100),
|
||||
FpsReadoutKind.Generated when m.Factor is double f => string.Format(CultureInfo.CurrentCulture, "×{0:0.0}", f),
|
||||
FpsReadoutKind.None => Strings.Common_Dash,
|
||||
_ => Strings.Common_NotAvailable,
|
||||
@@ -104,8 +106,15 @@ public static class FpsPresentation
|
||||
};
|
||||
}
|
||||
|
||||
public static string GeneratedLine(double? native, double? displayed, double factor) =>
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Fps_Fg_Format, Formats.Fps(native), Formats.Fps(displayed), factor);
|
||||
public static string GeneratedLine(double? native, double? displayed, double factor) => GeneratedLine(native, displayed, factor, steadyShare: null);
|
||||
|
||||
/// <summary>
|
||||
/// <c>62 → 118 FPS (×1.9 FG)</c> — and a steady-state factor (CLAUDE.md rule 6, 2026-09-17) always with the share of the
|
||||
/// session it covers, <c>(×1.9 FG · 75%)</c>, wherever the line appears (beta.8: the Average card and Compare dropped it).
|
||||
/// </summary>
|
||||
public static string GeneratedLine(double? native, double? displayed, double factor, double? steadyShare) => steadyShare is double share
|
||||
? string.Format(CultureInfo.CurrentCulture, Strings.Fps_Fg_Steady_Format, Formats.Fps(native), Formats.Fps(displayed), factor, share * 100)
|
||||
: string.Format(CultureInfo.CurrentCulture, Strings.Fps_Fg_Format, Formats.Fps(native), Formats.Fps(displayed), factor);
|
||||
|
||||
public static string PresentedLine(double? presented) => string.Format(CultureInfo.CurrentCulture, Strings.Fps_Presented_Format, Formats.Fps(presented));
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public sealed record FpsReadoutModel
|
||||
/// <summary>The one line, per the rule: <c>62 → 118 FPS (×1.9 FG)</c>, or <c>144 FPS</c>. Never a factor that was not counted.</summary>
|
||||
public string Line => Kind switch
|
||||
{
|
||||
FpsReadoutKind.Generated when Factor is double f => FpsPresentation.GeneratedLine(Native, Displayed, f),
|
||||
FpsReadoutKind.Generated when Factor is double f => FpsPresentation.GeneratedLine(Native, Displayed, f, SteadyShare),
|
||||
FpsReadoutKind.None => FpsPresentation.PresentedLine(Native),
|
||||
FpsReadoutKind.Presented or FpsReadoutKind.IdentifiedUncounted => FpsPresentation.PresentedLine(Presented),
|
||||
_ => Strings.Common_NotAvailable,
|
||||
|
||||
Generated
+21
@@ -300,6 +300,7 @@ public static class Strings
|
||||
nameof(Fps_Fg_Format),
|
||||
nameof(Fps_Fg_Identified_Format),
|
||||
nameof(Fps_Fg_Identified_Tooltip_Format),
|
||||
nameof(Fps_Fg_Steady_Format),
|
||||
nameof(Fps_Fg_Steady_Tooltip_Format),
|
||||
nameof(Fps_Native_Tooltip),
|
||||
nameof(Fps_None_Tooltip),
|
||||
@@ -590,6 +591,8 @@ public static class Strings
|
||||
nameof(Settings_Capture_Header),
|
||||
nameof(Settings_Channel_Beta),
|
||||
nameof(Settings_Channel_Stable),
|
||||
nameof(Settings_FpsDecimals_Body),
|
||||
nameof(Settings_FpsDecimals_Label),
|
||||
nameof(Settings_Header),
|
||||
nameof(Settings_HideAntiCheatHooking_Body),
|
||||
nameof(Settings_HideAntiCheatHooking_Label),
|
||||
@@ -734,6 +737,7 @@ public static class Strings
|
||||
nameof(Trend_Change_GpuDriver),
|
||||
nameof(Trend_Change_Os),
|
||||
nameof(Trend_Empty),
|
||||
nameof(Trend_Empty_Format),
|
||||
nameof(Trend_Excluded_Format),
|
||||
nameof(Trend_IncludeMidSession),
|
||||
nameof(Trend_Metric_Average),
|
||||
@@ -747,8 +751,11 @@ public static class Strings
|
||||
nameof(Trend_Metric_MaxCpuTemp),
|
||||
nameof(Trend_Metric_MaxGpuTemp),
|
||||
nameof(Trend_Metric_MaxVramProcess),
|
||||
nameof(Trend_Metric_NativeFps),
|
||||
nameof(Trend_Metric_P01Low),
|
||||
nameof(Trend_Metric_P1Low),
|
||||
nameof(Trend_Metric_PresentedFps),
|
||||
nameof(Trend_Partial_Note),
|
||||
nameof(Uninstall_DataFolder_Body),
|
||||
nameof(Uninstall_DataFolder_Title),
|
||||
nameof(Update_AgentStillRunning),
|
||||
@@ -1330,6 +1337,8 @@ public static class Strings
|
||||
|
||||
public static string Fps_Fg_Identified_Tooltip_Format => ResourceManager.GetString(nameof(Fps_Fg_Identified_Tooltip_Format), Culture) ?? nameof(Fps_Fg_Identified_Tooltip_Format);
|
||||
|
||||
public static string Fps_Fg_Steady_Format => ResourceManager.GetString(nameof(Fps_Fg_Steady_Format), Culture) ?? nameof(Fps_Fg_Steady_Format);
|
||||
|
||||
public static string Fps_Fg_Steady_Tooltip_Format => ResourceManager.GetString(nameof(Fps_Fg_Steady_Tooltip_Format), Culture) ?? nameof(Fps_Fg_Steady_Tooltip_Format);
|
||||
|
||||
public static string Fps_Native_Tooltip => ResourceManager.GetString(nameof(Fps_Native_Tooltip), Culture) ?? nameof(Fps_Native_Tooltip);
|
||||
@@ -1910,6 +1919,10 @@ public static class Strings
|
||||
|
||||
public static string Settings_Channel_Stable => ResourceManager.GetString(nameof(Settings_Channel_Stable), Culture) ?? nameof(Settings_Channel_Stable);
|
||||
|
||||
public static string Settings_FpsDecimals_Body => ResourceManager.GetString(nameof(Settings_FpsDecimals_Body), Culture) ?? nameof(Settings_FpsDecimals_Body);
|
||||
|
||||
public static string Settings_FpsDecimals_Label => ResourceManager.GetString(nameof(Settings_FpsDecimals_Label), Culture) ?? nameof(Settings_FpsDecimals_Label);
|
||||
|
||||
public static string Settings_Header => ResourceManager.GetString(nameof(Settings_Header), Culture) ?? nameof(Settings_Header);
|
||||
|
||||
public static string Settings_HideAntiCheatHooking_Body => ResourceManager.GetString(nameof(Settings_HideAntiCheatHooking_Body), Culture) ?? nameof(Settings_HideAntiCheatHooking_Body);
|
||||
@@ -2198,6 +2211,8 @@ public static class Strings
|
||||
|
||||
public static string Trend_Empty => ResourceManager.GetString(nameof(Trend_Empty), Culture) ?? nameof(Trend_Empty);
|
||||
|
||||
public static string Trend_Empty_Format => ResourceManager.GetString(nameof(Trend_Empty_Format), Culture) ?? nameof(Trend_Empty_Format);
|
||||
|
||||
public static string Trend_Excluded_Format => ResourceManager.GetString(nameof(Trend_Excluded_Format), Culture) ?? nameof(Trend_Excluded_Format);
|
||||
|
||||
public static string Trend_IncludeMidSession => ResourceManager.GetString(nameof(Trend_IncludeMidSession), Culture) ?? nameof(Trend_IncludeMidSession);
|
||||
@@ -2224,10 +2239,16 @@ public static class Strings
|
||||
|
||||
public static string Trend_Metric_MaxVramProcess => ResourceManager.GetString(nameof(Trend_Metric_MaxVramProcess), Culture) ?? nameof(Trend_Metric_MaxVramProcess);
|
||||
|
||||
public static string Trend_Metric_NativeFps => ResourceManager.GetString(nameof(Trend_Metric_NativeFps), Culture) ?? nameof(Trend_Metric_NativeFps);
|
||||
|
||||
public static string Trend_Metric_P01Low => ResourceManager.GetString(nameof(Trend_Metric_P01Low), Culture) ?? nameof(Trend_Metric_P01Low);
|
||||
|
||||
public static string Trend_Metric_P1Low => ResourceManager.GetString(nameof(Trend_Metric_P1Low), Culture) ?? nameof(Trend_Metric_P1Low);
|
||||
|
||||
public static string Trend_Metric_PresentedFps => ResourceManager.GetString(nameof(Trend_Metric_PresentedFps), Culture) ?? nameof(Trend_Metric_PresentedFps);
|
||||
|
||||
public static string Trend_Partial_Note => ResourceManager.GetString(nameof(Trend_Partial_Note), Culture) ?? nameof(Trend_Partial_Note);
|
||||
|
||||
public static string Uninstall_DataFolder_Body => ResourceManager.GetString(nameof(Uninstall_DataFolder_Body), Culture) ?? nameof(Uninstall_DataFolder_Body);
|
||||
|
||||
public static string Uninstall_DataFolder_Title => ResourceManager.GetString(nameof(Uninstall_DataFolder_Title), Culture) ?? nameof(Uninstall_DataFolder_Title);
|
||||
|
||||
@@ -810,7 +810,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_LifetimeAvg" xml:space="preserve">
|
||||
<value>全期間平均</value>
|
||||
<value>最後に計測したセッション</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Measured_Empty" xml:space="preserve">
|
||||
@@ -1482,7 +1482,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Average_Note" xml:space="preserve">
|
||||
<value>平均は、フレーム生成が実測された場合はネイティブ FPS、未実測の場合は提示 FPS です。</value>
|
||||
<value>ネイティブ FPS はゲーム自身のフレームだけを数え、フレーム生成を計測できたセッションにだけあります。表示された FPS は、生成フレームを数えなかったセッションで表示されたすべてのフレームを数えます。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Axis_Date" xml:space="preserve">
|
||||
@@ -3049,4 +3049,32 @@
|
||||
<value>正常に終了</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_FpsDecimals_Label" xml:space="preserve">
|
||||
<value>FPS を小数点以下 2 桁で表示</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_FpsDecimals_Body" xml:space="preserve">
|
||||
<value>平均、ロー、トレンドなどすべての FPS の値を、整数(62)ではなく小数点以下 2 桁(62.40)で表示します。各ページには次に読み込んだときに反映されます。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Fps_Fg_Steady_Format" xml:space="preserve">
|
||||
<value>{0} → {1} FPS (×{2:0.0} FG · {3:0}%)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Metric_NativeFps" xml:space="preserve">
|
||||
<value>ネイティブ FPS</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Metric_PresentedFps" xml:space="preserve">
|
||||
<value>表示された FPS(Presented)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Partial_Note" xml:space="preserve">
|
||||
<value>白抜きの点はセッションの一部だけを表します。途中で設定が変わったか、値が定常状態のものです。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Empty_Format" xml:space="preserve">
|
||||
<value>このゲームのセッションには、まだ {0} の値がありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -613,7 +613,7 @@
|
||||
<value>Last session: {0} · {1}</value>
|
||||
</data>
|
||||
<data name="GameDetail_LifetimeAvg" xml:space="preserve">
|
||||
<value>Lifetime average</value>
|
||||
<value>Last measured session</value>
|
||||
</data>
|
||||
<data name="GameDetail_Measured_Empty" xml:space="preserve">
|
||||
<value>No measured session yet.</value>
|
||||
@@ -1117,7 +1117,7 @@
|
||||
<value>The selected session was not hooked; there are no frames to chart.</value>
|
||||
</data>
|
||||
<data name="Trend_Average_Note" xml:space="preserve">
|
||||
<value>Average is Native FPS where frame generation was measured and Presented FPS where it was not.</value>
|
||||
<value>Native FPS counts the game's own frames and exists where frame generation was measured. Presented FPS counts every frame presented, on sessions where no generated frames were counted.</value>
|
||||
</data>
|
||||
<data name="Trend_Axis_Date" xml:space="preserve">
|
||||
<value>Date</value>
|
||||
@@ -2297,4 +2297,25 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="Exit_EndedNormally" xml:space="preserve">
|
||||
<value>ended normally</value>
|
||||
</data>
|
||||
<data name="Settings_FpsDecimals_Label" xml:space="preserve">
|
||||
<value>Show FPS with two decimals</value>
|
||||
</data>
|
||||
<data name="Settings_FpsDecimals_Body" xml:space="preserve">
|
||||
<value>Every FPS figure — averages, lows, the trend — shows two decimals (62.40) instead of a whole number (62). Pages show it the next time they load.</value>
|
||||
</data>
|
||||
<data name="Fps_Fg_Steady_Format" xml:space="preserve">
|
||||
<value>{0} → {1} FPS (×{2:0.0} FG · {3:0}%)</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_NativeFps" xml:space="preserve">
|
||||
<value>Native FPS</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_PresentedFps" xml:space="preserve">
|
||||
<value>Presented FPS</value>
|
||||
</data>
|
||||
<data name="Trend_Partial_Note" xml:space="preserve">
|
||||
<value>Hollow points describe part of their session: its settings changed, or the value is its steady state's.</value>
|
||||
</data>
|
||||
<data name="Trend_Empty_Format" xml:space="preserve">
|
||||
<value>No session of this game has a value for {0} yet.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -608,7 +608,7 @@
|
||||
<value>Phiên gần nhất: {0} · {1}</value>
|
||||
</data>
|
||||
<data name="GameDetail_LifetimeAvg" xml:space="preserve">
|
||||
<value>Trung bình toàn bộ</value>
|
||||
<value>Phiên đo gần nhất</value>
|
||||
</data>
|
||||
<data name="GameDetail_Measured_Empty" xml:space="preserve">
|
||||
<value>Chưa có phiên nào được đo.</value>
|
||||
@@ -1112,7 +1112,7 @@
|
||||
<value>Phiên đã chọn không hook; không có khung hình để vẽ.</value>
|
||||
</data>
|
||||
<data name="Trend_Average_Note" xml:space="preserve">
|
||||
<value>Trung bình là FPS gốc khi đã đo frame generation và FPS xuất khung khi chưa đo.</value>
|
||||
<value>FPS gốc chỉ đếm khung hình của chính game và chỉ có ở các phiên đã đo được tạo khung hình. FPS được trình chiếu đếm mọi khung hình được trình chiếu, ở các phiên không đếm được khung hình tạo thêm.</value>
|
||||
</data>
|
||||
<data name="Trend_Axis_Date" xml:space="preserve">
|
||||
<value>Ngày</value>
|
||||
@@ -2292,4 +2292,25 @@ Các tài liệu bên dưới là điều khoản đầy đủ; phần tóm tắ
|
||||
<data name="Exit_EndedNormally" xml:space="preserve">
|
||||
<value>kết thúc bình thường</value>
|
||||
</data>
|
||||
<data name="Settings_FpsDecimals_Label" xml:space="preserve">
|
||||
<value>Hiển thị FPS với hai chữ số thập phân</value>
|
||||
</data>
|
||||
<data name="Settings_FpsDecimals_Body" xml:space="preserve">
|
||||
<value>Mọi con số FPS — trung bình, low, xu hướng — hiển thị hai chữ số thập phân (62,40) thay vì số nguyên (62). Các trang áp dụng ở lần tải tiếp theo.</value>
|
||||
</data>
|
||||
<data name="Fps_Fg_Steady_Format" xml:space="preserve">
|
||||
<value>{0} → {1} FPS (×{2:0.0} FG · {3:0}%)</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_NativeFps" xml:space="preserve">
|
||||
<value>FPS gốc (Native)</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_PresentedFps" xml:space="preserve">
|
||||
<value>FPS được trình chiếu (Presented)</value>
|
||||
</data>
|
||||
<data name="Trend_Partial_Note" xml:space="preserve">
|
||||
<value>Điểm rỗng chỉ mô tả một phần phiên của nó: cài đặt đã đổi giữa phiên, hoặc giá trị là của trạng thái ổn định.</value>
|
||||
</data>
|
||||
<data name="Trend_Empty_Format" xml:space="preserve">
|
||||
<value>Chưa có phiên nào của game này có giá trị cho {0}.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -124,7 +124,7 @@ public sealed partial class CompareViewModel : ObservableObject
|
||||
return;
|
||||
}
|
||||
|
||||
await Task.Run(() => plot.SavePng(path, 1600, 800)).ConfigureAwait(true);
|
||||
await Task.Run(() => Charts.ChartTheme.SavePng(plot, path, 1600, 800)).ConfigureAwait(true);
|
||||
_strip.Success(Strings.Compare_Header, string.Format(CultureInfo.CurrentCulture, Strings.Summary_Exported_Format, path));
|
||||
});
|
||||
}
|
||||
@@ -187,18 +187,30 @@ public sealed partial class CompareViewModel : ObservableObject
|
||||
Rows.Add(Row(Strings.Compare_Metric_P01Low, rows, static r => r.Tier == Domain.Sessions.CaptureTier.Hooked ? r.P01LowFps : null, Formats.Fps, higherIsBetter: true));
|
||||
Rows.Add(Row(Strings.Compare_Metric_StutterPct, rows, static r => r.Tier == Domain.Sessions.CaptureTier.Hooked ? r.StutterTimePct : null, static v => v is double d ? d.ToString("0.0", CultureInfo.CurrentCulture) + "%" : Strings.Common_NotAvailable, higherIsBetter: false));
|
||||
Rows.Add(Row(Strings.Compare_Metric_MaxGpuTemp, rows, static r => r.MaxGpuTemp, Formats.Temperature, higherIsBetter: false));
|
||||
Rows.Add(Row(Strings.Compare_Metric_AvgGpuLoad, rows, static r => r.AvgGpuLoad, Formats.Percent, higherIsBetter: true));
|
||||
Rows.Add(Row(Strings.Compare_Metric_AvgCpuLoad, rows, static r => r.AvgCpuLoad, Formats.Percent, higherIsBetter: false));
|
||||
// A load is neither better high nor low (beta.8): a GPU at 99 % may be the bottleneck or simply busy, so neither row
|
||||
// names a best.
|
||||
Rows.Add(Row(Strings.Compare_Metric_AvgGpuLoad, rows, static r => r.AvgGpuLoad, Formats.Percent, higherIsBetter: null));
|
||||
Rows.Add(Row(Strings.Compare_Metric_AvgCpuLoad, rows, static r => r.AvgCpuLoad, Formats.Percent, higherIsBetter: null));
|
||||
Rows.Add(Row(Strings.Compare_Metric_MaxCpuTemp, rows, static r => r.MaxCpuTemp, Formats.Temperature, higherIsBetter: false));
|
||||
Rows.Add(new CompareRowViewModel(Strings.Compare_Metric_Duration, [.. rows.Select(static r => new CompareCell(Formats.Duration(r.DurationSeconds), false))]));
|
||||
}
|
||||
|
||||
/// <summary>One row: the value per session, the best (never an N/A) flagged; a row where nothing has a value is all N/A and nothing is best.</summary>
|
||||
internal static CompareRowViewModel Row(string metric, IReadOnlyList<SessionRow> rows, Func<SessionRow, double?> value, Func<double?, string> text, bool higherIsBetter)
|
||||
/// <summary>
|
||||
/// One row: the value per session, the best (never an N/A) flagged; a row where nothing has a value is all N/A and nothing
|
||||
/// is best, and a row that ranks nothing (<paramref name="higherIsBetter"/> null) flags none. Since beta.8 the best is the
|
||||
/// best as SHOWN: two sessions that both read "62" are both best — 62.4 against 62.3 is not a difference the reader sees.
|
||||
/// </summary>
|
||||
internal static CompareRowViewModel Row(string metric, IReadOnlyList<SessionRow> rows, Func<SessionRow, double?> value, Func<double?, string> text, bool? higherIsBetter)
|
||||
{
|
||||
double?[] values = [.. rows.Select(value)];
|
||||
double? best = higherIsBetter ? values.Where(static v => v.HasValue).Max() : values.Where(static v => v.HasValue).Min();
|
||||
return new CompareRowViewModel(metric, [.. values.Select(v => new CompareCell(text(v), best.HasValue && v.HasValue && v.Value == best.Value))]);
|
||||
double? best = higherIsBetter switch
|
||||
{
|
||||
true => values.Where(static v => v.HasValue).Max(),
|
||||
false => values.Where(static v => v.HasValue).Min(),
|
||||
null => null,
|
||||
};
|
||||
string? bestText = best.HasValue ? text(best) : null;
|
||||
return new CompareRowViewModel(metric, [.. values.Select(v => new CompareCell(text(v), bestText is not null && v.HasValue && string.Equals(text(v), bestText, StringComparison.Ordinal)))]);
|
||||
}
|
||||
|
||||
private void OnCandidateChanged(object? sender, PropertyChangedEventArgs e)
|
||||
|
||||
@@ -147,7 +147,7 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
private bool _hasLatency;
|
||||
|
||||
[ObservableProperty]
|
||||
private TrendMetric _trendMetric = TrendMetric.Average;
|
||||
private TrendMetric _trendMetric = TrendMetric.PresentedFps;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _includeMidSession;
|
||||
@@ -249,15 +249,26 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
|
||||
public static string TrendAverageNote => Strings.Trend_Average_Note;
|
||||
|
||||
public static string TrendPartialNote => Strings.Trend_Partial_Note;
|
||||
|
||||
/// <summary>Why the trend is empty FOR THIS METRIC (beta.8): "no hooked session yet" was wrong for a game whose sessions simply lack it.</summary>
|
||||
[ObservableProperty]
|
||||
private string _trendEmptyMessage = Strings.Trend_Empty;
|
||||
|
||||
public static string LatencyHeader => Strings.Latency_Header;
|
||||
|
||||
public static string LatencyEmptyText => Strings.Latency_Empty;
|
||||
|
||||
public static string SensorsEmptyText => Strings.Sensors_Empty;
|
||||
|
||||
public static IReadOnlyList<Choice<TrendMetric>> TrendMetrics { get; } =
|
||||
/// <summary>
|
||||
/// The selector's entries, built for each page in the language it opens in (beta.8: a static list kept the language the
|
||||
/// App started in).
|
||||
/// </summary>
|
||||
public IReadOnlyList<Choice<TrendMetric>> TrendMetrics { get; } =
|
||||
[
|
||||
new(TrendMetric.Average, Strings.Trend_Metric_Average),
|
||||
new(TrendMetric.PresentedFps, Strings.Trend_Metric_PresentedFps),
|
||||
new(TrendMetric.NativeFps, Strings.Trend_Metric_NativeFps),
|
||||
new(TrendMetric.Displayed, Strings.Trend_Metric_Displayed),
|
||||
new(TrendMetric.P1Low, Strings.Trend_Metric_P1Low),
|
||||
new(TrendMetric.P01Low, Strings.Trend_Metric_P01Low),
|
||||
@@ -320,6 +331,7 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
}
|
||||
|
||||
Present(detail);
|
||||
ChooseDefaultMetric(detail);
|
||||
await RebuildTrendAsync(ct).ConfigureAwait(true);
|
||||
}
|
||||
|
||||
@@ -329,7 +341,32 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
Pending = LoadSelectedAsync(value);
|
||||
}
|
||||
|
||||
partial void OnTrendMetricChanged(TrendMetric value) => RebuildTrendPoints();
|
||||
partial void OnTrendMetricChanged(TrendMetric value)
|
||||
{
|
||||
_trendMetricChosen |= !_choosingDefaultMetric;
|
||||
RebuildTrendPoints();
|
||||
}
|
||||
|
||||
private bool _trendMetricChosen;
|
||||
|
||||
private bool _choosingDefaultMetric;
|
||||
|
||||
/// <summary>
|
||||
/// The first metric a game's trend opens on (beta.8): Presented FPS, unless the game's newest measured session counted
|
||||
/// generated frames — then Native FPS, the rate such sessions have. Kept once the user picks one.
|
||||
/// </summary>
|
||||
private void ChooseDefaultMetric(GameDetail detail)
|
||||
{
|
||||
if (_trendMetricChosen)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SessionRow? newest = detail.Sessions.FirstOrDefault(static s => s.Tier == CaptureTier.Hooked && s.FrameCount > 0);
|
||||
_choosingDefaultMetric = true;
|
||||
TrendMetric = newest is not null && FpsPresentation.FromRow(newest).Kind == FpsReadoutKind.Generated ? TrendMetric.NativeFps : TrendMetric.PresentedFps;
|
||||
_choosingDefaultMetric = false;
|
||||
}
|
||||
|
||||
partial void OnIncludeMidSessionChanged(bool value) => RebuildTrendPoints();
|
||||
|
||||
@@ -389,6 +426,7 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
int excluded = IncludeMidSession ? 0 : TrendSeriesBuilder.ExcludedCount(_detail.Sessions, TrendMetric);
|
||||
TrendExcludedText = excluded > 0 ? string.Format(CultureInfo.CurrentCulture, Strings.Trend_Excluded_Format, excluded) : string.Empty;
|
||||
TrendEmpty = TrendPoints.Count == 0;
|
||||
TrendEmptyMessage = string.Format(CultureInfo.CurrentCulture, Strings.Trend_Empty_Format, TrendMetricText);
|
||||
OnPropertyChanged(nameof(TrendMetricText));
|
||||
TrendPresented?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ public sealed partial class SessionSummaryViewModel : ObservableObject
|
||||
public Task ExportPngAsync(Plot plot)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(plot);
|
||||
return Run(() => ExportAsync("png", "PNG|*.png", path => plot.SavePng(path, 1600, 700)));
|
||||
return Run(() => ExportAsync("png", "PNG|*.png", path => ChartTheme.SavePng(plot, path, 1600, 700)));
|
||||
}
|
||||
|
||||
private async Task Run(Func<Task> work)
|
||||
|
||||
@@ -73,6 +73,10 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
[ObservableProperty]
|
||||
private bool _hideAntiCheatHooking = true;
|
||||
|
||||
/// <summary><c>ui.fps_decimals</c> (beta.8): every FPS figure with two decimals ("62.40") instead of a whole number.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _fpsTwoDecimals;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _onlineMetadata;
|
||||
|
||||
@@ -230,6 +234,18 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
|
||||
partial void OnHideAntiCheatHookingChanged(bool value) => Persist(SettingsRegistry.UiHideAntiCheatHooking, value);
|
||||
|
||||
partial void OnFpsTwoDecimalsChanged(bool value)
|
||||
{
|
||||
if (_loading)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Every formatter reads it from now on; a page shows it the next time it formats a number.
|
||||
FpsDecimals.Two = value;
|
||||
Persist(SettingsRegistry.UiFpsDecimals, value);
|
||||
}
|
||||
|
||||
partial void OnMinimizeToTrayChanged(bool value)
|
||||
{
|
||||
if (!_loading)
|
||||
@@ -340,6 +356,7 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
BackgroundCapture = await _settings.GetBooleanAsync(SettingsRegistry.CaptureBackground).ConfigureAwait(true);
|
||||
MinimizeToTray = await _settings.GetBooleanAsync(SettingsRegistry.UiMinimizeToTray).ConfigureAwait(true);
|
||||
HideAntiCheatHooking = await _settings.GetBooleanAsync(SettingsRegistry.UiHideAntiCheatHooking).ConfigureAwait(true);
|
||||
FpsTwoDecimals = await _settings.GetBooleanAsync(SettingsRegistry.UiFpsDecimals).ConfigureAwait(true);
|
||||
OnlineMetadata = await _settings.GetBooleanAsync(SettingsRegistry.PrivacyOnlineMetadata).ConfigureAwait(true);
|
||||
UpdateChannel = await _settings.GetAsync(SettingsRegistry.UpdateChannel).ConfigureAwait(true);
|
||||
AutoCheckUpdates = await _settings.GetBooleanAsync(SettingsRegistry.UpdateAutoCheck).ConfigureAwait(true);
|
||||
|
||||
@@ -52,6 +52,17 @@ public static class SettingsRegistry
|
||||
Default = "1",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Whether every FPS figure the App shows has two decimals ("62.40") or is a whole number ("62") — beta.8, owner request
|
||||
/// 2026-09-25. Off by default: the whole number is what every page showed until then.
|
||||
/// </summary>
|
||||
public static readonly SettingDefinition UiFpsDecimals = new()
|
||||
{
|
||||
Key = "ui.fps_decimals",
|
||||
Kind = SettingKind.Boolean,
|
||||
Default = "0",
|
||||
};
|
||||
|
||||
/// <summary>Whether the Agent's watcher records tracked games that the App did not launch (FR-3.1/FR-3.3).</summary>
|
||||
public static readonly SettingDefinition CaptureBackground = new()
|
||||
{
|
||||
@@ -139,7 +150,7 @@ public static class SettingsRegistry
|
||||
/// <summary>Every definition, in the order <c>06_DATA_MODEL</c> lists them.</summary>
|
||||
public static IReadOnlyList<SettingDefinition> All { get; } =
|
||||
[
|
||||
UiLanguage, UiTheme, UiStartWithWindows, UiMinimizeToTray, UiHideAntiCheatHooking,
|
||||
UiLanguage, UiTheme, UiStartWithWindows, UiMinimizeToTray, UiHideAntiCheatHooking, UiFpsDecimals,
|
||||
CaptureBackground, HookingKillSwitch, CaptureMinSessionSeconds, TelemetryIntervalMs, RetentionRawSessionsPerGame,
|
||||
UpdateChannel, UpdateAutoCheck, PrivacyOnlineMetadata, LogDebug,
|
||||
];
|
||||
|
||||
@@ -143,5 +143,11 @@ public sealed class CompareViewModelTests
|
||||
higher.Cells.Select(static c => c.IsBest).Should().Equal(true, false, false);
|
||||
CompareRowViewModel none = CompareViewModel.Row("t", rows, static _ => null, Formats.Temperature, higherIsBetter: true);
|
||||
none.Cells.Should().OnlyContain(static c => !c.IsBest);
|
||||
|
||||
// beta.8: a load ranks nothing, and the best is the best as shown — 62.4 and 62.3 both read "62".
|
||||
CompareViewModel.Row("t", rows, static r => r.MaxGpuTemp, Formats.Temperature, higherIsBetter: null).Cells.Should().OnlyContain(static c => !c.IsBest);
|
||||
SessionRow[] close = [rows[0] with { MedianFps = 62.4 }, rows[1] with { MedianFps = 62.3 }, rows[2] with { MedianFps = 55 }];
|
||||
CompareViewModel.Row("t", close, static r => r.MedianFps, static v => Formats.FpsNumber(v!.Value, twoDecimals: false), higherIsBetter: true)
|
||||
.Cells.Select(static c => c.IsBest).Should().Equal([true, true, false], "both are shown as 62");
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using FrameLedger.Shared.Ipc;
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>The Dashboard over a scratch ledger and a fake link: totals and recent from the tables; the live card driven by the three session events; a completed session reloads.</summary>
|
||||
[Collection(StringsCultureCollection.Name)]
|
||||
public sealed class DashboardViewModelTests
|
||||
{
|
||||
private sealed class FakeLink : IAgentLink
|
||||
|
||||
@@ -131,6 +131,22 @@ public sealed class FormatsTests
|
||||
public void TwoFileVersionsAreTheSameFourNumbers(string? a, string? b, bool? expected) =>
|
||||
Formats.SameVersion(a, b).Should().Be(expected);
|
||||
|
||||
/// <summary>
|
||||
/// beta.8 (owner request): two decimals, always, when <c>ui.fps_decimals</c> is on; a whole number otherwise. Half away
|
||||
/// from zero both ways — 62.125 is exactly representable, and rounding half to even would say 62.12.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void FpsHasTwoDecimalsWhenAskedAndRoundsHalfAwayFromZero() => InEnglish(() =>
|
||||
{
|
||||
Formats.FpsNumber(62.4, twoDecimals: true).Should().Be("62.40");
|
||||
Formats.FpsNumber(62, twoDecimals: true).Should().Be("62.00");
|
||||
Formats.FpsNumber(62.125, twoDecimals: true).Should().Be("62.13");
|
||||
Formats.FpsNumber(62.5, twoDecimals: false).Should().Be("63");
|
||||
Formats.FpsNumber(61.5, twoDecimals: false).Should().Be("62");
|
||||
Formats.FpsNumber(62.4, twoDecimals: false).Should().Be("62");
|
||||
return 0;
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void EnginesAreNamedAndAnUnknownIdPassesThrough()
|
||||
{
|
||||
|
||||
@@ -224,11 +224,11 @@ public sealed class FpsPresentationTests
|
||||
FpsReadoutModel m = InEnglish(() => FpsPresentation.FromRow(row));
|
||||
|
||||
m.Kind.Should().Be(FpsReadoutKind.Generated);
|
||||
InEnglish(() => m.Line).Should().Be("58 → 116 FPS (×2.0 FG)");
|
||||
InEnglish(() => m.Line).Should().Be("58 → 116 FPS (×2.0 FG · 75%)", "rule 6: a steady factor is never shown without its share, the Average card included (beta.8)");
|
||||
InEnglish(() => m.FactorChip).Should().Be("×2.0 FG · 75%");
|
||||
InEnglish(() => m.QualifierTooltip).Should().Contain("steady state").And.Contain("75%").And.Contain("Bucket 1 of 8 measured 1.00 against 1.60");
|
||||
InEnglish(() => FpsPresentation.ColumnTooltip(row)).Should().Be(InEnglish(() => m.QualifierTooltip));
|
||||
InEnglish(() => FpsPresentation.FactorColumn(row)).Should().Be("×2.0");
|
||||
InEnglish(() => FpsPresentation.FactorColumn(row)).Should().Be("×2.0 · 75%", "the grid carries the share too");
|
||||
|
||||
SessionRow session = Hooked("dlssg", native: 58.2, displayed: 116.4, factor: 2.0) with { FgFactorScope = "session" };
|
||||
FpsReadoutModel s = InEnglish(() => FpsPresentation.FromRow(session));
|
||||
|
||||
@@ -647,7 +647,8 @@ public sealed class GameDetailViewModelTests
|
||||
vm.TrendMetric = Charts.TrendMetric.Displayed;
|
||||
vm.TrendPoints.Should().BeEmpty("frame generation was measured as none: no displayed rate");
|
||||
vm.TrendMetric = Charts.TrendMetric.MaxGpuTemp;
|
||||
vm.TrendPoints.Single().Value.Should().Be(71);
|
||||
vm.TrendPoints.Should().HaveCount(2, "the machine's metrics are every session's, Tier 2 included (beta.8)");
|
||||
vm.TrendPoints[0].Value.Should().Be(71, "oldest first: the hooked one");
|
||||
|
||||
vm.SelectedSession = vm.Sessions[0]; // newest first: the Tier-2 one
|
||||
Task pending = vm.Pending;
|
||||
|
||||
@@ -308,6 +308,34 @@ public sealed class PagesLoadTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.8: the Trend tab is drawn when the page is made — the view model's load finished before the page subscribed, so
|
||||
/// every first open was blank — and on a date axis that keeps its label (the axis was replaced after the label was set).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheTrendIsDrawnWhenThePageIsMadeOnADateAxisThatKeepsItsLabel()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow game = await s.GameAsync("Alpha");
|
||||
await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddDays(-2), native: 60);
|
||||
await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddDays(-1), native: 64);
|
||||
var detail = new GameDetailViewModel(s.Library, new GameSelection { GameId = game.Id }, new HookingConsent(new NoAgent(), new NoPrompt()),
|
||||
new NoNavigation(), new NoConfirm(), new NoEdit(), new NoStrip(), new NoSummaries(), new SessionSeriesLoader(s.Sessions),
|
||||
new Infrastructure.Persistence.SqliteHardwareSnapshotRepository(s.Db), new SessionSelection(), new NoPicker());
|
||||
Task pending = detail.Pending;
|
||||
await pending;
|
||||
|
||||
(int Drawn, string? Label) chart = await OnStaAsync(() =>
|
||||
{
|
||||
var page = new GameDetailPage(detail);
|
||||
Render(page);
|
||||
return (page.Trend.DrawnPoints, page.Trend.ScottPlot.Axes.Bottom.Label.Text);
|
||||
});
|
||||
|
||||
chart.Drawn.Should().Be(2, "drawn on the first open, not only after a later load");
|
||||
chart.Label.Should().Be(Strings.Trend_Axis_Date);
|
||||
}
|
||||
|
||||
/// <summary>Tools ▸ Database maintenance's dialog body (P4 PR-7) under the real dictionaries: its icons, the converter key, every binding.</summary>
|
||||
[Fact]
|
||||
public async Task TheDatabaseMaintenanceDialogLoads()
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace FrameLedger.App.Tests;
|
||||
/// through the pipe (never a column write), "start with Windows" follows the Run entry, and <c>log.debug</c>
|
||||
/// moves the level switch at once.
|
||||
/// </summary>
|
||||
[Collection(StringsCultureCollection.Name)]
|
||||
public sealed class SettingsViewModelTests
|
||||
{
|
||||
private static CancellationToken Ct => TestContext.Current.CancellationToken;
|
||||
@@ -251,6 +252,28 @@ public sealed class SettingsViewModelTests
|
||||
(await h.Settings.GetBooleanAsync(SettingsRegistry.UiHideAntiCheatHooking, Ct)).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task FpsDecimalsIsOffByDefaultAndItsToggleIsPersistedAndAppliedAtOnce()
|
||||
{
|
||||
// beta.8 (owner request 2026-09-25): ui.fps_decimals, default 0; the formatters read it from the moment it moves.
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
Harness h = await OpenAsync(s);
|
||||
h.Vm.FpsTwoDecimals.Should().BeFalse();
|
||||
try
|
||||
{
|
||||
h.Vm.FpsTwoDecimals = true;
|
||||
Task pending = h.Vm.Pending;
|
||||
await pending;
|
||||
|
||||
(await h.Settings.GetBooleanAsync(SettingsRegistry.UiFpsDecimals, Ct)).Should().BeTrue();
|
||||
FpsDecimals.Two.Should().BeTrue();
|
||||
}
|
||||
finally
|
||||
{
|
||||
FpsDecimals.Two = false;
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ARevokeTheAgentCannotTakeStaysInTheListAndSaysWhy()
|
||||
{
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace FrameLedger.App.Tests;
|
||||
/// assertions and <see cref="StringsTests"/> sets it to <c>vi</c>, and as separate collections they ran in parallel: the
|
||||
/// first gate run on xUnit.net v3 4.0.1 (2026-09-21) read "Settings" where it had just written <c>vi</c>. The race was
|
||||
/// always there; the new scheduler found it. An implicit collection: no fixture, so no definition class is needed.
|
||||
/// Since beta.8 it also holds the classes that write <c>FpsDecimals.Two</c> or read FPS text the setting changes — the
|
||||
/// same kind of process-wide formatting state.
|
||||
/// </summary>
|
||||
internal static class StringsCultureCollection
|
||||
{
|
||||
|
||||
@@ -46,29 +46,38 @@ public sealed class TrendSeriesBuilderTests
|
||||
Row(4, 1, midSession: true, native: 80),
|
||||
];
|
||||
|
||||
IReadOnlyList<TrendPoint> points = TrendSeriesBuilder.Points(rows, TrendMetric.Average, includeMidSessionChanges: false);
|
||||
IReadOnlyList<TrendPoint> points = TrendSeriesBuilder.Points(rows, TrendMetric.PresentedFps, includeMidSessionChanges: false);
|
||||
points.Select(static p => p.Value).Should().Equal(60, 70);
|
||||
points.Should().BeInAscendingOrder(static p => p.At);
|
||||
TrendSeriesBuilder.ExcludedCount(rows).Should().Be(1);
|
||||
|
||||
IReadOnlyList<TrendPoint> all = TrendSeriesBuilder.Points(rows, TrendMetric.Average, includeMidSessionChanges: true);
|
||||
IReadOnlyList<TrendPoint> all = TrendSeriesBuilder.Points(rows, TrendMetric.PresentedFps, includeMidSessionChanges: true);
|
||||
all.Select(static p => p.Value).Should().Equal(60, 70, 80);
|
||||
all[2].SettingsChangedMidSession.Should().BeTrue();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.8: "Average" mixed two rates in one line. Native FPS is the game's own frames where frame generation was measured;
|
||||
/// Presented FPS is on the sessions that counted no generated frame — never on one that did, whose presented rate
|
||||
/// includes them (CLAUDE.md rule 6).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TheAverageIsPresentedWhereFgWasNotMeasuredAndDisplayedOnlyWhereItWas()
|
||||
public void NativeAndPresentedAreTwoMetricsAndNeitherIsAnInflatedNumber()
|
||||
{
|
||||
SessionRow generated = Row(1, 1, fgMode: "dlssg", native: 62, displayed: 118, factor: 1.9);
|
||||
SessionRow none = Row(2, 1, fgMode: "none", native: 90);
|
||||
SessionRow presented = Row(3, 1, fgMode: "na", native: null, presented: 144);
|
||||
SessionRow identified = Row(4, 1, fgMode: "dlssg", native: null, displayed: null, presented: 304, refusal: "no_evaluations");
|
||||
|
||||
TrendSeriesBuilder.ValueOf(generated, TrendMetric.Average).Should().Be(62);
|
||||
TrendSeriesBuilder.ValueOf(identified, TrendMetric.Average).Should().Be(304, "identified but uncounted: the Presented figure is the headline, never a Native");
|
||||
TrendSeriesBuilder.ValueOf(generated, TrendMetric.NativeFps).Should().Be(62);
|
||||
TrendSeriesBuilder.ValueOf(generated, TrendMetric.PresentedFps).Should().BeNull("its presented rate counts generated frames: the inflated number");
|
||||
TrendSeriesBuilder.ValueOf(identified, TrendMetric.PresentedFps).Should().Be(304, "identified but uncounted: the Presented figure is the headline, never a Native");
|
||||
TrendSeriesBuilder.ValueOf(identified, TrendMetric.NativeFps).Should().BeNull();
|
||||
TrendSeriesBuilder.ValueOf(identified, TrendMetric.Displayed).Should().BeNull("no factor was counted, so no displayed rate exists");
|
||||
TrendSeriesBuilder.ValueOf(none, TrendMetric.Average).Should().Be(90);
|
||||
TrendSeriesBuilder.ValueOf(presented, TrendMetric.Average).Should().Be(144, "Presented FPS is the headline when FG is not measured");
|
||||
TrendSeriesBuilder.ValueOf(none, TrendMetric.NativeFps).Should().Be(90);
|
||||
TrendSeriesBuilder.ValueOf(none, TrendMetric.PresentedFps).Should().Be(90, "a measured none: the presents are the application's frames");
|
||||
TrendSeriesBuilder.ValueOf(presented, TrendMetric.PresentedFps).Should().Be(144, "Presented FPS is the headline when FG is not measured");
|
||||
TrendSeriesBuilder.ValueOf(presented, TrendMetric.NativeFps).Should().BeNull();
|
||||
TrendSeriesBuilder.ValueOf(generated, TrendMetric.Displayed).Should().Be(118);
|
||||
TrendSeriesBuilder.ValueOf(none, TrendMetric.Displayed).Should().BeNull("a measured none has no displayed rate distinct from native");
|
||||
TrendSeriesBuilder.ValueOf(presented, TrendMetric.Displayed).Should().BeNull();
|
||||
@@ -116,6 +125,42 @@ public sealed class TrendSeriesBuilderTests
|
||||
all[1].SettingsChangedMidSession.Should().BeTrue("drawn marked: it covers a share of its session, never the session");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.8: a machine metric is every session's telemetry, Tier 2 included — a game never hooked had no trend at all;
|
||||
/// a frame-rate metric stays the hooks'. A steady state is partial for the rates beside the factor too.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MachineMetricsCountEverySessionAndASteadyStatesRatesArePartial()
|
||||
{
|
||||
SessionRow hooked = Row(1, 1, gpu: 70);
|
||||
SessionRow tier2 = Row(2, 1, hooked: false, native: null, gpu: 64);
|
||||
SessionRow steady = Row(3, 1, fgMode: "dlssg", native: 70, displayed: 280, factor: 4) with { FgFactorScope = "steady", FgSteadyShare = 0.75 };
|
||||
|
||||
TrendSeriesBuilder.Points([hooked, tier2], TrendMetric.MaxGpuTemp, includeMidSessionChanges: false).Select(static p => p.Value).Should().Equal(70, 64);
|
||||
TrendSeriesBuilder.Points([hooked, tier2], TrendMetric.PresentedFps, includeMidSessionChanges: false).Should().ContainSingle("the hooks' rate");
|
||||
TrendSeriesBuilder.IsPartial(steady, TrendMetric.NativeFps).Should().BeTrue();
|
||||
TrendSeriesBuilder.IsPartial(steady, TrendMetric.Displayed).Should().BeTrue();
|
||||
TrendSeriesBuilder.IsPartial(steady, TrendMetric.MaxGpuTemp).Should().BeFalse("the machine's numbers are the whole session's");
|
||||
TrendSeriesBuilder.ExcludedCount([hooked, steady], TrendMetric.NativeFps).Should().Be(1);
|
||||
TrendSeriesBuilder.ExcludedCount([hooked, steady], TrendMetric.PresentedFps).Should().Be(0, "a steady session has no presented point to exclude");
|
||||
}
|
||||
|
||||
/// <summary>beta.8: two differences on one day are one marker with both lines; two labels at one place were drawn over each other.</summary>
|
||||
[Fact]
|
||||
public void ChangesOnOneDayAreOneMarker()
|
||||
{
|
||||
DateTimeOffset day = new(2026, 9, 20, 18, 0, 0, TimeSpan.Zero);
|
||||
IReadOnlyList<HardwareChange> merged = TrendSeriesBuilder.MergedByDay(
|
||||
[
|
||||
new HardwareChange(day, "GPU driver: 572.16 → 576.02"),
|
||||
new HardwareChange(day.AddMinutes(1), "OS: 26100 → 26200"),
|
||||
new HardwareChange(day.AddDays(3), "GPU: A → B"),
|
||||
]);
|
||||
|
||||
merged.Should().HaveCount(2);
|
||||
merged[0].Text.Should().Be("GPU driver: 572.16 → 576.02" + Environment.NewLine + "OS: 26100 → 26200");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MarkersAppearWhereConsecutiveSnapshotsDiffer()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user