From 0b0c8fe781220fbaad64436741aeb7351fc7b3f3 Mon Sep 17 00:00:00 2001 From: Nucleic Date: Wed, 29 Jul 2026 01:02:50 -0700 Subject: [PATCH] Merge nucleic/olive-jade-civet-rznt into dev --- spikes/WslcApiDump/Program.cs | 43 +++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/spikes/WslcApiDump/Program.cs b/spikes/WslcApiDump/Program.cs index 4b4ccef..540777b 100644 --- a/spikes/WslcApiDump/Program.cs +++ b/spikes/WslcApiDump/Program.cs @@ -392,11 +392,44 @@ internal static class Program Console.WriteLine(); Console.WriteLine(" second Session with the SAME name — attach, or reserved?"); var second = CreateSession(settingsType, sessionType, name, dataDir, "second"); - Console.WriteLine(second is not null - ? " → CONSTRUCTED. The compat SDK may attach by name; check `wslc container ps` for " - + "the first session's containers, and record it against D13 (§13.1)." - : " → REFUSED (see the HRESULT above). D13's premise holds: the compat surface cannot " - + "re-adopt a session, so reattach needs IWSLCSessionManager::OpenSessionByName."); + if (second is null) + { + Console.WriteLine(" → REFUSED (see the HRESULT above). D13's premise holds: the compat " + + "surface cannot re-adopt a session, so reattach needs " + + "IWSLCSessionManager::OpenSessionByName."); + } + else + { + // Starting it is one more signal: re-adopting a RUNNING session should be a no-op, + // whereas a genuinely separate session would be booting a second VM here. + if (start is not null) + { + try { start.Invoke(second, null); Console.WriteLine(" second Start() ok"); } + catch (TargetInvocationException e) + { + Console.WriteLine($" second Start() threw {Describe(e.InnerException)}"); + } + } + Console.WriteLine(" → CONSTRUCTED — the constructor did NOT refuse."); + Console.WriteLine(); + // Be honest about what this does and does not show. A constructed object is not proof + // of attachment: construction may simply be lazy, and WSLC_E_SESSION_RESERVED clearly + // fires under SOME condition or it would not exist in wslc.idl. The compat surface has + // no enumeration, so identity cannot be settled from inside this process. + Console.WriteLine(" This does NOT by itself prove it re-adopted the first session —"); + Console.WriteLine(" construction may be lazy, and WSLC_E_SESSION_RESERVED exists in"); + Console.WriteLine(" wslc.idl, so it fires under some condition. The compat surface has"); + Console.WriteLine(" no enumeration, so identity cannot be settled from in here."); + Console.WriteLine(); + Console.WriteLine(" DECISIVE CHECK — run this now: wslc session ls"); + Console.WriteLine($" ONE session named '{name}' → it attached; the SESSION half of"); + Console.WriteLine(" §2.3 reattach may not need the"); + Console.WriteLine(" internal COM interface after all."); + Console.WriteLine($" TWO sessions named '{name}' → it did not; two VMs are running and"); + Console.WriteLine(" the name is not an identity."); + Console.WriteLine(" Either way the CONTAINER half of D13 is unaffected: there is still"); + Console.WriteLine(" no way to enumerate containers on the compat surface."); + } Console.WriteLine(); Console.WriteLine(" session left running — `wslc session ls`; whether it outlives this "