Files
TeslaRel410/emulator/deploy
CydandClaude Fable 5 72da9b2f14 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>
2026-07-16 23:51:52 -05:00
..

deploy/ -- install-side artifacts

Sources for the self-contained, air-gapped pod install. See ../DEPLOYMENT-PLAN.md for the full design.

Files

File Role
postinstall.bat elevated entry TeslaLauncher runs after extraction: finds the package folder, installs bundled Npcap, calls configure.ps1
configure.ps1 the per-pod step: detects the NIC + bay IP, derives the game IP = bayIP+100, binds DOSBox's pcap (realnic), renders the conf templates, stamps WATTCP.CFG my_ip
net_loop.conf.tmpl BattleTech conf template (looped netnub)
net_rp.conf.tmpl Red Planet conf template (looped netnub via loop_rp.bat)
package.ps1 assembles the deployable zip from repo sources + a fresh self-contained pod-launch publish

Template tokens filled at install: @@ROOT@@ (package dir), @@REALNIC@@ (this pod's NIC GUID fragment), @@MACADDR@@ (stable MAC derived from the game IP).

Packaged zip layout

The archive extracts to the games root (C:\games). Zip root = one package folder + postinstall.bat:

C:\games\
  postinstall.bat                 <- from deploy/postinstall.bat
  TeslaPod410\                     <- the single package folder (= ROOT)
    pod-launch.exe                 <- built from ../pod-launch (self-contained)
    dosbox-x.exe (+ DLLs)
    net_loop.conf.tmpl             <- from deploy/  (rendered -> net_loop.conf)
    net_rp.conf.tmpl               <- from deploy/  (rendered -> net_rp.conf)
    renderer.exe                   <- frozen renderer (OPEN: packaging w/ David)
    roms\awe32.raw
    ALPHA_1\...                    <- game content (incl. the WATTCP.CFG files)
    net-boot\...                   <- ODI/packet drivers, NET.CFG @340/INT10
    deploy\
      configure.ps1                <- from deploy/
      npcap.exe                    <- bundled Npcap silent installer (NOT in repo)
      vc_redist.x64.exe            <- optional, if the DOSBox build needs it

postinstall.bat derives ROOT as the single folder beside it, so the folder can be named per package.

What runs at install (elevated, no network -- air-gapped)

  1. postinstall.bat locates ROOT, runs ROOT\deploy\npcap.exe /S.
  2. configure.ps1 -Root ROOT:
    • finds the one static IPv4 (the bay IP) + its adapter GUID;
    • realnic = a contiguous, letter-leading fragment of a single GUID block (DOSBox reads a leading digit as an interface index; the fragment must be a substring of \Device\NPF_{GUID});
    • game IP = bay IP + 100 on the last octet (≤32 pods, bays .1-.100);
    • macaddr = 02:00:<game IP octets in hex> (stable, locally-administered);
    • renders *.conf.tmpl -> *.conf (tokens filled);
    • stamps my_ip = gameIP into every ALPHA_1\...\WATTCP.CFG.
  3. pod-launch.exe (the supervisor) then selects + launches the rendered conf.

Verified against a scratch package tree: NIC detect, realnic (contiguous-match checked), bayIP+100, MAC, conf render, and WATTCP stamp all correct.

Building the zip

deploy\package.ps1 [-PackageName TeslaPod410] [-Npcap <installer>] `
                   [-Renderer <exe>] [-VcRedist <exe>] [-NoContent] [-SkipBuild]

Publishes pod-launch self-contained, stages the tree (postinstall.bat at the zip root + the package folder), and writes emulator\dist\<PackageName>.zip. -NoContent skips ALPHA_1/net-boot for a fast structural check. Externally- procured pieces are bundled only when their paths are passed (else flagged).

DLLs / runtime

dosbox-x.exe is a static build (182 MB): its import table is only Windows system DLLs and the delay-import table is empty, so there are no MinGW/SDL DLLs to bundle. The one runtime DLL it needs, wpcap.dll, is provided by the Npcap install. (Its other LoadLibrary strings are optional features our confs don't use -- Glide/3dfx, ASPI, ANGLE, inpout -- or Windows-provided D3D/DXGI.)

Both deploy confs run netnub in a loop until the supervisor is killed (loop.bat for BT, loop_rp.bat for RP) -- no single-shot in the deployable.

Not yet in the repo / OPEN

  • npcap.exe (licensed installer -- procured out-of-band) and any vc_redist.
  • The frozen renderer.exe (packaging decision with David; pod-launch falls back to pyw live_bridge.py when absent).