From 9aca1b733d3baecaee790c3658435796c0d78192 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Thu, 9 Jul 2026 12:45:08 -0400 Subject: [PATCH] feat(engine): 0xADDR=VAL seeds for trace --trace-json Lets the differential oracle inject pre-scene state the cold --boot misses (e.g. 0x6c1=1, the ADV-chrome enable). Seed test: seeding G[0x6c1]=1 pushes SC0000 VM-vs-engine agreement 27 -> 65 ops; residual mismatches are operand-hook blind spots (comment/set-string read inline args, not via vm_operand_fetch), provably not control-flow forks. Observe-only; parity unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- engine/Age.Cli/Program.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/Age.Cli/Program.cs b/engine/Age.Cli/Program.cs index c2d2146..a8285cd 100644 --- a/engine/Age.Cli/Program.cs +++ b/engine/Age.Cli/Program.cs @@ -236,6 +236,15 @@ if (args[0] == "trace") var jscripts = Paths.Scripts(); var target = Sys4Loader.Load(jscripts[sceneName.ToUpperInvariant()], table); var session = new GameSession(); + // optional 0xADDR=VAL seeds — inject pre-scene state the cold --boot misses (e.g. 0x6c1=1, the + // ADV-chrome enable set by the real engine's system boot). Applied before boot so they persist. + foreach (var s in args.Where(a => a.Contains('=') && a != outPath)) + { + var kv = s.Split('='); + int k = kv[0].StartsWith("0x") ? Convert.ToInt32(kv[0], 16) : int.Parse(kv[0]); + long v = kv[1].StartsWith("0x") ? Convert.ToInt64(kv[1], 16) : long.Parse(kv[1]); + session.Seed(k, v); + } if (boot) foreach (var b in new[] { "INITCONFIG.BIN", "INIT2.BIN", "INIT.BIN" }) session.RunScene(Sys4Loader.Load(jscripts[b], table), table, new CaptureHost(), null, provider);