Compare commits

...
Author SHA1 Message Date
poli0981andClaude Opus 5.5 d8ea308fee test(capturehost): the Vulkan launch case asks the harness before the host runs; the target-exit case holds 15 s (beta.18 PR-5)
The two CaptureHost end-to-end races that failed beta.18's CI (both re-run green), taken at the owner's request
(2026-10-07) before the tag.

LaunchModeOnAVulkanTargetAttachesToTheLayersRingAndInjectsNothing failed #288 (run 37627351438) with
"session: RefusedByGuard / verdict: ModuleScanFailed  a module list came back incomplete". A hosted runner has the
Vulkan loader and no device, so the harness exits 77 with a "[SKIP]" line; the test read that line, or the session's
LaunchTargetExited, off the HOST's output. The runner is elevated, so the host starts the harness through
CreateProcessWithTokenW (UnelevatedProcess), which hands the child no stdout: the line never reached the host's output,
and when the guard's scan hit the dying harness the test failed instead of skipping. It now runs the plain harness
itself first (`--vulkan --hold-presenting 1`, bounded at 60 s), skips on 77 with the harness's own line, and otherwise
runs in full with no skip after the host - once the harness has presented here, every failure is real.
Measured: on this machine (a device) both cases pass, the Vulkan one in full; with the probe's ICDs hidden
(VK_DRIVER_FILES / VK_ICD_FILENAMES at a missing file, a throwaway edit) it skips in 0.66 s:
"[SKIP] vkCreateInstance failed (no ICD, or no surface extensions)".

WhenTheTargetExitsTheHostStopsAndSaysWhy failed #286 (run 37619719203) with TargetNotRunning: the host resolves its
target once, as it starts, and a host slower than the harness's 6 s hold found it gone (recorded since 2026-09-21).
The host prints nothing until its session ends, so there is no "attached" to wait for; the hold is 15 s, a margin.

The class's remark said CI does not run it; CI has, since 2026-09-06 - corrected in place. Docs: 13_CI_CD (the flake
tally), HANDOFF (beta.18's trap, struck to fixed), CHANGELOG [0.1.0-beta.18] (this ships in that tag).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:52:59 +07:00
4 changed files with 70 additions and 19 deletions

No files matched your search

+5
View File
@@ -68,6 +68,11 @@ the database changes and nothing is shown again for you to accept; sessions alre
the build, and the build id was read from the tree after that. It is read from the clean checkout first and handed to
the build, and `tools/buildid-check.ps1` reads it back out of the published binaries (`docs/12_BUILD.md` §Release-time
token substitution). Nothing changes for a game: both sides of the ring's handshake always carried the same id.
- **Two end-to-end tests no longer fail CI by a race** (developers only). The Vulkan launch test asks the test harness
whether this machine can present through Vulkan before it starts the capture host: on GitHub's runners the harness's
own "skip" line never reached the host's output, and a scan of the exiting harness failed the test instead of skipping
it. The target-exit test holds its harness 15 seconds instead of 6, the margin a slow runner's host needed
(`docs/13_CI_CD.md`).
## [0.1.0-beta.17] - 2026-10-07
+11
View File
@@ -52,6 +52,17 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an
case. `Kill` now waits for exit (bounded, asserted) and the delete retries. Not §S19(b) either — a test-harness
race, and the third flake shape of the day (the registry-subtree race between `VkLayerRegistrationTests` and the
GOG reader's test, fixed in #188) was the same kind.
- **Two more on 2026-10-07 (beta.18), both re-run green and then fixed the same day.**
`WhenTheTargetExitsTheHostStopsAndSaysWhy` ended **`TargetNotRunning`** (#286, run 37619719203): the host resolves its
target once, as it starts, and a host slower than the harness's 6 s hold found it gone — the shape recorded since
2026-09-21. The hold is 15 s: a margin, not a signal, because the host prints nothing until its session ends.
`LaunchModeOnAVulkanTargetAttachesToTheLayersRingAndInjectsNothing` ended **`RefusedByGuard` / `ModuleScanFailed`**
(#288, run 37627351438): the hosted runner has the Vulkan loader and no device, so the harness exits 77 with a
`[SKIP]` line — but the runner is elevated, the host starts the harness through `CreateProcessWithTokenW`
(`UnelevatedProcess`), the child gets no stdout, and the line never reached the host's output; the test then
depended on the session reading `LaunchTargetExited`, and a scan that hit the dying harness failed it instead. The
test now asks the harness directly, before the host runs (exit 77 = skip, with the harness's own line); hiding the
Vulkan ICDs from that probe makes it skip in under a second, and on a machine with a device it runs in full.
- **A re-run ERASES the evidence, which is why the count above had to be kept by hand.**
`gh run rerun --failed` updates the original run's conclusion, so `gh run list` showed **18 success, 1
cancelled, 0 failed** across the twenty runs that contained all three failures above. Anyone measuring
+2 -1
View File
@@ -2118,7 +2118,8 @@ blends into the background in dark mode").
device, so the harness exits 77 with a `[SKIP]` line — but the runner is elevated, the launch goes through
`CreateProcessWithTokenW` (`UnelevatedProcess`), the child inherits no stdout, and the line never reaches the host's
output; when the guard's scan hits the exiting harness (`ModuleScanFailed`) the test fails instead of skipping. Re-run;
the deterministic fix is a task of its own.
~~the deterministic fix is a task of its own~~ fixed the same day by beta.18 PR-5 (the test asks the harness itself,
before the host runs), which also gave the `TargetNotRunning` case a 15 s hold (`13_CI_CD` §ci.yml).
**Owner-only, added to the list below:** item 14.
@@ -39,11 +39,10 @@ namespace FrameLedger.CaptureHost.Tests;
/// machine, so the record's path is pinned too.
/// </para>
/// <para>
/// <b>Category=Integration, and CI will not run it.</b> §S19(b): the guard refuses a
/// .NET test host that has loaded a <c>protect</c>-matching module, measured on CI.
/// On this dev box the guard allows it, so these are dev-box-reproducible and
/// merge-gate-absent — the same split <c>ShmDrainIntegrationTests</c> lives with, and
/// stated rather than implied.
/// <b>Category=Integration — and CI runs it.</b> This paragraph said CI would not (corrected 2026-10-07): §S19(b), the
/// guard refusing a .NET test host that had loaded a <c>protect</c>-matching module, was answered on 2026-09-06 by the
/// signer check, and <c>./build.ps1 check</c> runs the Integration category on CI since (<c>13_CI_CD</c> §ci.yml). A green
/// CI is evidence for this suite, and a race in it fails a merge: two did on 2026-10-07 (the two cases below that say so).
/// </para>
/// </remarks>
[Trait("Category", "Integration")]
@@ -454,13 +453,26 @@ public sealed class CaptureHostEndToEndTests : IDisposable
// P1 item 3, from OUTSIDE the process: the host launches the harness in its Vulkan mode with the
// layer's environment, the guard passes and injects nothing (TargetIsVulkanLayered), and the
// records come from the layer's ring. Skipped honestly where there is no Vulkan loader or no
// presentable device -- the harness says so with exit 77, which the session reports as
// LaunchTargetExited before any ring existed.
// presentable device -- the harness says so itself, with exit 77 and a "[SKIP]" line.
if (!File.Exists(Path.Combine(Environment.SystemDirectory, "vulkan-1.dll")))
{
Assert.Skip("no Vulkan loader on this machine");
}
// ASKED BEFORE THE HOST RUNS, of the harness itself (beta.18). This used to be read off the host's run: its output
// for the harness's "[SKIP]" line, or the session's LaunchTargetExited. Neither holds on a hosted runner, which has
// the loader and no device. The runner is elevated, so the host starts the harness through CreateProcessWithTokenW
// (UnelevatedProcess), which hands the child no stdout -- the line never reached the host's output -- and the
// harness's exit races the guard's poll: #288's CI run scanned it while it died and ended RefusedByGuard
// (ModuleScanFailed, "a module list came back incomplete"), failing where it should have skipped. Run directly, the
// harness's own output and exit code are this test's; and once it HAS presented here, every failure below is real.
(int probeExit, string probeOutput) = await ProbeVulkanAsync();
if (probeExit == 77)
{
Assert.Skip("the harness found no presentable Vulkan device on this machine: " + probeOutput);
}
probeExit.Should().Be(0, "the harness presents through Vulkan on this machine, or says why it cannot: " + probeOutput);
(await GrantConsentAsync()).Should().Be(ConsentWriteOutcome.Written);
using Process host = StartHost("launch", "--exe", ConsentedExecutable, "--args", "--vulkan --hold-presenting 8",
@@ -470,16 +482,6 @@ public sealed class CaptureHostEndToEndTests : IDisposable
await host.WaitForExitAsync(TestContext.Current.CancellationToken);
stdout += "\n---- stderr ----\n" + await stderrTask + $"\n---- exit {host.ExitCode} ----\n";
// The harness says so itself (exit 77, a "[SKIP]" line on the shared console) when this
// machine has a loader but no device -- a hosted runner's shape. Its exit races the guard's
// poll, so the session may read LaunchTargetExited or, if it died under the scan, whatever
// the scan could not read; the harness's own line is the signal that does not race.
if (stdout.Contains("[SKIP]", StringComparison.Ordinal)
|| stdout.Contains(nameof(SessionEndReason.LaunchTargetExited), StringComparison.Ordinal))
{
Assert.Skip("the harness found no presentable Vulkan device on this machine: " + stdout);
}
stdout.Should().Contain("vulkan layer: ", "the launch names the manifest it wrote and the enable-list entry");
stdout.Should().Contain("capture side: the Vulkan implicit layer", stdout);
stdout.Should().Contain("apiMask=0x8", "FL_API_VULKAN is bit 3; the ring is the layer's, not an Overlay's");
@@ -487,6 +489,34 @@ public sealed class CaptureHostEndToEndTests : IDisposable
host.ExitCode.Should().Be(0, stdout);
}
/// <summary>
/// The plain harness asked to present through Vulkan for a second, under its own name — never the consented copy, whose
/// name the host resolves its target by — with its output and exit code read here: 77 and a "[SKIP]" line where this
/// machine cannot, 0 where it can. Bounded: a driver that hangs is a failure to report, not a test that never ends.
/// </summary>
private static async Task<(int ExitCode, string Output)> ProbeVulkanAsync()
{
using var probe = Process.Start(new ProcessStartInfo(Harness, "--vulkan --hold-presenting 1")
{
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
})!;
using var bound = CancellationTokenSource.CreateLinkedTokenSource(TestContext.Current.CancellationToken);
bound.CancelAfter(TimeSpan.FromSeconds(60));
try
{
string output = await probe.StandardOutput.ReadToEndAsync(bound.Token).ConfigureAwait(false);
await probe.WaitForExitAsync(bound.Token).ConfigureAwait(false);
return (probe.ExitCode, output);
}
catch (OperationCanceledException e) when (!TestContext.Current.CancellationToken.IsCancellationRequested)
{
probe.Kill(entireProcessTree: true);
throw new TimeoutException("hook-harness --vulkan --hold-presenting 1 did not end within 60 s", e);
}
}
[Fact]
public async Task WhenTheTargetExitsTheHostStopsAndSaysWhy()
{
@@ -494,7 +524,11 @@ public sealed class CaptureHostEndToEndTests : IDisposable
// DLL_PROCESS_DETACH teardown — so this can only come from the held process handle.
(await GrantConsentAsync()).Should().Be(ConsentWriteOutcome.Written);
Process harness = StartHarness("--real --hold-presenting 6");
// 15 s, not 6 (beta.18): the host resolves its target once, as it starts, and on a loaded runner a host that took
// longer than the hold found the harness gone and ended TargetNotRunning — #286's first CI run, as on 2026-09-21
// and before. The host prints nothing until its session ends, so there is no "attached" to wait for; the hold is
// the margin, and the case's run time with it.
Process harness = StartHarness("--real --hold-presenting 15");
Process? host = null;
try
{