Emulator: parity-safe EMU8000 sample counter -- AWEUTIL runs; wire the

VGL_LABS cockpit test suite as pod-launch 'test' mode

The WC hang, root-caused in three layers (each necessary):
1. WC was rendered-samples + 100ms-capped interpolation; AWEUTIL's poll
   storm (~550k port-ops/s) starved the render thread of awe_lock, so the
   clock crawled ~90x slow. Fixed: free-running host-clock derivation +
   a fairness gate so the render thread can always take the lock.
2. Free-running at true 44.1kHz still failed: trapped port reads cost
   ~30us -- MORE than one 22.7us tick -- so consecutive reads skipped
   counter values, and AWEUTIL's WaitUntilWC (decoded at COM offset
   0x5F42) exits only on EQUALITY with a target tick: skipped value =
   missed target = 1.49s wrap penalty, or forever.
3. Advancing +1 per read still failed: WaitUntilWC reads WC TWICE per
   iteration, so its equality sample saw only every 2nd value -- wrong
   parity = infinite loop. Final semantics: during a poll storm the
   counter advances once per FOUR reads (every value observable by all
   of AWEUTIL's loop shapes; its 8192-unchanged-reads dead-clock bailout
   never trips), and resyncs to true wall time after any 50ms idle gap.
   Result: the full stock TEST.BAT (DIAGNOSE + AWEUTIL /S on both cards)
   completes in seconds.

Also: pod-launch 'test' mode -> vwetest.conf (stock TEST.BAT -> TSTALL),
DOSBox window defaults to 900,600 in test mode (the DOS screen is the
suite's UI), VWE_AWE_LOG gains storm bursts with guest cs:ip + caller and
rare-read tracing (the instrumentation that cracked this).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-16 23:51:52 -05:00
co-authored by Claude Fable 5
parent 6dc017cb3d
commit 72da9b2f14
7 changed files with 184 additions and 33 deletions
+12 -6
View File
@@ -49,6 +49,7 @@ namespace VwePod
var o = new Options();
string modeName = null, confArg = null, rootArg = null, dosboxArg = null,
bridgeScriptArg = null, rendererArg = null, aweArg = null;
bool dosboxXySet = false;
for (int i = 0; i < args.Length; i++)
{
@@ -72,7 +73,7 @@ namespace VwePod
case "--layout": o.Layout = Next(a).Equals("explode", StringComparison.OrdinalIgnoreCase) ? LayoutMode.Explode : LayoutMode.Cockpit; break;
case "--bridge-pos": o.BridgePos = Next(a); break;
case "--bridge-size": ParseWH(Next(a), out o.BridgeW, out o.BridgeH); break;
case "--dosbox-xy": ParseWH(Next(a), out o.DosBoxX, out o.DosBoxY); break;
case "--dosbox-xy": ParseWH(Next(a), out o.DosBoxX, out o.DosBoxY); dosboxXySet = true; break;
case "--no-bridge": o.NoBridge = true; break;
case "--no-sound": o.NoSound = true; break;
case "--mipmap": o.Mipmap = true; break;
@@ -92,6 +93,10 @@ namespace VwePod
// reason and exits without touching the launch env.
if (!o.Mode.Supported) return o;
// test mode: the DOS screen IS the suite's UI -- default it out from
// under the render window unless the caller placed it explicitly.
if (!dosboxXySet && o.Mode.Name == "test") { o.DosBoxX = 900; o.DosBoxY = 600; }
o.DosBox = dosboxArg ?? FirstExisting(
Path.Combine(o.Root, "dosbox-x.exe"),
Path.Combine(o.Root, "src", "src", "dosbox-x.exe"))
@@ -155,11 +160,12 @@ namespace VwePod
Supervising entry-point: launches DOSBox-X + the render bridge into a job
object and blocks; killing this process kills them too (no orphans).
mode bt | rp (default bt). bt/rp also serve the camera ship
+ live mission-review roles -- the console picks the
role via the egg hostType, so no separate mode. Also
recognized (not yet wired): review, test-plasma,
reset-rio, audio-test.
mode bt | rp | test (default bt). bt/rp also serve the
camera ship + live mission-review roles -- the console
picks the role via the egg hostType, so no separate
mode. test = the VGL_LABS factory cockpit test suite
(C:\VWETEST -> TSTALL.EXE). Also recognized (not yet
wired): review, test-plasma, reset-rio, audio-test.
--mode <name> same as the positional mode
--conf <path> explicit conf (overrides the mode's conf)
--root <dir> base dir for dosbox/conf/bridge (default: exe dir)