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) <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-09 12:45:08 -04:00
parent d2e9cc5a99
commit 9aca1b733d

View File

@@ -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);