From fa911db1d604ab29a2744db9dab043f6ff205603 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Wed, 29 Jul 2026 19:02:55 -0400 Subject: [PATCH] Remove interactive VM lifetime step cap --- docs/phase-b-framework.md | 14 +++++++++++--- docs/tools-reference.md | 13 +++++++------ engine/Age.Engine.Tests/Age.Engine.Tests.csproj | 1 + engine/Age.Engine.Tests/GodotVmOptionsTests.cs | 17 +++++++++++++++++ godot/GodotVmOptions.cs | 13 +++++++++++++ godot/Main.cs | 5 +---- 6 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 engine/Age.Engine.Tests/GodotVmOptionsTests.cs create mode 100644 godot/GodotVmOptions.cs diff --git a/docs/phase-b-framework.md b/docs/phase-b-framework.md index 0bdcd2a..c8a439c 100644 --- a/docs/phase-b-framework.md +++ b/docs/phase-b-framework.md @@ -928,7 +928,7 @@ installed-A1215 regressions prove the exact prefix and unchanged PCM payload. Va tests, a zero-warning Godot build, and the Himegari-targeted threaded selftest, which loads the real A1215 buffer through Godot and reports `first-riff-boundary=ok` without seek spam. -**Stage 01-01 STEP-LIMIT diagnostics added (2026-07-29):** after a reveal-zone event, the persistent +**Stage 01-01 cumulative STEP-LIMIT corrected (2026-07-29):** after a reveal-zone event, the persistent SYSTEM4 run reached its artificial 20,000,000-instruction cap. `SYSTEM4 P592` correctly identifies the last ADV boundary (`SC0600@0x33fd`, followed by cleanup and return), but the page map cannot identify code that runs after that page. The final page was recorded about 29 seconds before the halt, so the existing report @@ -938,8 +938,16 @@ Godot now retains the deepest frame chain before a halted frame unwinds and auto STEP-LIMIT report: exact script/offset/opcode, nested frame chain, hottest sites in the final 128 instructions, and the final 16-instruction sequence. It also writes the ordinary full stall snapshot as `user://diagnostics/step-limit-.json` and copies its coordinate/path. Focused formatter/stack -regressions and all 530 engine tests pass; the Godot build is warning-free and the Himegari-targeted threaded -selftest passes. No loop behavior or safety limit has been changed pending one instrumented reproduction. +regressions made the next reproduction decisive: the cap fired at `DRAWMINIMAP@0xc4` under +`SYSTEM4 > TITLE > SAVE > SYSTEM4 > FIELD > DRAWMINIMAP`, 127.452 seconds into the run. Its final trace is +the ordinary bounded minimap scan: X increments at `0x77`, exits after 25, and the outer scan spans a fixed +101 rows. `DRAWMINIMAP` was only where the boot-to-session counter happened to reach exactly 20,000,000; +FIELD polling and redraw calls had accumulated those steps normally. + +`GodotVmOptions` now gives persistent interactive runs `long.MaxValue` rather than a test-harness lifetime +ceiling. Selftest and CLI/corpus paths keep their bounded diagnostic budgets, and the automatic halt report +remains available for bounded Godot modes. The focused policy regression and all 531 engine tests pass; the +Godot build is warning-free and the Himegari-targeted threaded selftest passes. **Cyclic reset implemented (2026-07-29):** `0x230(handle)` now gets or creates the retained object, disables the four looping channels represented by the compositor, and clears the complete native diff --git a/docs/tools-reference.md b/docs/tools-reference.md index 76ba381..5ce60f6 100644 --- a/docs/tools-reference.md +++ b/docs/tools-reference.md @@ -213,12 +213,13 @@ and pending movie records include `first_frame_source_pts_ms`; the ordinary `mov the same source PTS alongside the render frame, which distinguishes encoded stream lead-in from decode/presentation latency. -If the interactive VM reaches its `STEP-LIMIT` safety cap, Godot now captures the same diagnostic -automatically as `user://diagnostics/step-limit-.json` and copies its coordinate/path to the -clipboard. Before nested frames unwind, the trace sink preserves the deepest active script stack. The console -also prints the exact final script/offset/opcode, that frame chain, the hottest sites in the bounded final -128-instruction window, and the final 16-instruction sequence. This makes the last ADV locator unnecessary for -identifying a post-dialogue loop; send either the `step-limit` console block or the generated JSON. +Normal interactive Godot sessions have no cumulative instruction ceiling. Bounded Godot diagnostic runs retain +`STEP-LIMIT`; if one fires, Godot captures the same diagnostic automatically as +`user://diagnostics/step-limit-.json` and copies its coordinate/path to the clipboard. Before nested +frames unwind, the trace sink preserves the deepest active script stack. The console also prints the exact final +script/offset/opcode, that frame chain, the hottest sites in the bounded final 128-instruction window, and the +final 16-instruction sequence. This makes the last ADV locator unnecessary for identifying a post-dialogue loop; +send either the `step-limit` console block or the generated JSON. ## Native FFmpeg movie shim (Windows x64) diff --git a/engine/Age.Engine.Tests/Age.Engine.Tests.csproj b/engine/Age.Engine.Tests/Age.Engine.Tests.csproj index 3e7e782..5639a33 100644 --- a/engine/Age.Engine.Tests/Age.Engine.Tests.csproj +++ b/engine/Age.Engine.Tests/Age.Engine.Tests.csproj @@ -31,6 +31,7 @@ + diff --git a/engine/Age.Engine.Tests/GodotVmOptionsTests.cs b/engine/Age.Engine.Tests/GodotVmOptionsTests.cs new file mode 100644 index 0000000..0346ca1 --- /dev/null +++ b/engine/Age.Engine.Tests/GodotVmOptionsTests.cs @@ -0,0 +1,17 @@ +public class GodotVmOptionsTests +{ + [Fact] + public void PersistentInteractiveRunIsUnboundedButSelftestRetainsDiagnosticCap() + { + var interactive = GodotVmOptions.Create(selftest: false, ignoreExitRequests: true); + var selftest = GodotVmOptions.Create(selftest: true, ignoreExitRequests: false); + + Assert.Equal(long.MaxValue, interactive.MaxSteps); + Assert.True(interactive.IgnoreExitRequests); + Assert.False(interactive.NoSaveDat); + + Assert.Equal(GodotVmOptions.DiagnosticMaxSteps, selftest.MaxSteps); + Assert.False(selftest.IgnoreExitRequests); + Assert.True(selftest.NoSaveDat); + } +} diff --git a/godot/GodotVmOptions.cs b/godot/GodotVmOptions.cs new file mode 100644 index 0000000..3674c97 --- /dev/null +++ b/godot/GodotVmOptions.cs @@ -0,0 +1,13 @@ +using Age.Engine.Vm; + +/// Separates bounded diagnostic runs from the persistent interactive AGE session. +public static class GodotVmOptions +{ + public const long DiagnosticMaxSteps = 20_000_000; + + public static VmOptions Create(bool selftest, bool ignoreExitRequests) + => new( + MaxSteps: selftest ? DiagnosticMaxSteps : long.MaxValue, + IgnoreExitRequests: ignoreExitRequests, + NoSaveDat: selftest); +} diff --git a/godot/Main.cs b/godot/Main.cs index 89244e8..fa78970 100644 --- a/godot/Main.cs +++ b/godot/Main.cs @@ -391,10 +391,7 @@ public partial class Main : Godot.Control if (histFile != null) { _hist = new Age.Engine.Diagnostics.HistogramTraceSink(); sink = new Age.Engine.Diagnostics.CompositeTraceSink(_trace, _hist); } _vm = new VirtualMachine(script, table, _host, - new VmOptions( - MaxSteps: 20_000_000, - IgnoreExitRequests: nativeDebugMenu, - NoSaveDat: _selftest), + GodotVmOptions.Create(_selftest, nativeDebugMenu), provider, sink, sharedProfile: sharedProfile, nativeDatStore: nativeSaveStore,