Skip to content

P0.1: restore immediate FAT evidence priority without UI starvation - #163

Merged
masarray merged 1 commit into
mainfrom
agent/p0-1-evidence-priority-yield
Aug 13, 2026
Merged

P0.1: restore immediate FAT evidence priority without UI starvation#163
masarray merged 1 commit into
mainfrom
agent/p0-1-evidence-priority-yield

Conversation

@masarray

Copy link
Copy Markdown
Owner

Root cause

PR #150 intentionally raised FAT evidence dispatch from Background to DataBind so a FALSE→TRUE edge is evaluated and its ON evidence/timestamp is visible before a later FALSE edge. P0 #159 later moved the dispatcher back to Background to avoid UI starvation under a large pending-snapshot queue. The P0 bounded drain (64 snapshots / 4 ms) solved the unbounded-drain problem, but the dispatcher change accidentally regressed #150's immediate edge priority.

Fix

Keep both improvements instead of choosing one:

  • a newly scheduled FAT evidence drain is posted at DispatcherPriority.DataBind, preserving immediate TRUE-edge processing;
  • if IoTestSessionController reschedules another bounded chunk from inside the active drain, the wrapper detects that active drain and posts the continuation at DispatcherPriority.Background;
  • the existing 64 snapshots / 4 ms bounded drain remains unchanged;
  • startup evidence batching/hash-chain behavior remains unchanged.

This makes the priority policy burst-aware: first evidence edge is urgent; backlog continuation yields to normal render/input work.

Regression guard

Update the P0 regression contract so it now locks the combined invariant instead of incorrectly requiring Background only:

  • bounded 64/4 ms drain still required;
  • DataBind required for the first FAT evidence dispatch;
  • Background required for continuation dispatch while the drain callback is active;
  • increment/decrement guard required around the active drain callback.

Integration safety

Branch is based on current main 6980a2899edad4249ae2e8542d9a9e7f61e6af82, so PR #162 first-run SCL/IP/Excel launcher restoration is already included. Only two files are changed:

  • MainWindow.IoTesting.cs
  • tests/ARSAS.Tests/IoTestFatP0RegressionTests.cs

No IEC 61850 engine, Clock Sync/SNTP, multi-IED FAT, smart binding, timestamp formatting/evidence precision, clean-FAT semantics, or release metadata is modified.

Do not merge until focused IO FAT checks plus full Windows build/test/package pass on the exact head.

@masarray
masarray marked this pull request as ready for review August 13, 2026 09:07
@masarray
masarray merged commit 38fdf55 into main Aug 13, 2026
3 checks passed
@masarray masarray mentioned this pull request Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant