Remove interactive VM lifetime step cap

This commit is contained in:
gamer147
2026-07-29 19:02:55 -04:00
parent fdb7ff6782
commit fd9f9e7fb7
6 changed files with 50 additions and 13 deletions

View File

@@ -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 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. 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 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 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 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, 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 and the final 16-instruction sequence. It also writes the ordinary full stall snapshot as
`user://diagnostics/step-limit-<timestamp>.json` and copies its coordinate/path. Focused formatter/stack `user://diagnostics/step-limit-<timestamp>.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 regressions made the next reproduction decisive: the cap fired at `DRAWMINIMAP@0xc4` under
selftest passes. No loop behavior or safety limit has been changed pending one instrumented reproduction. `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, **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 disables the four looping channels represented by the compositor, and clears the complete native

View File

@@ -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 the same source PTS alongside the render frame, which distinguishes encoded stream lead-in from decode/presentation
latency. latency.
If the interactive VM reaches its `STEP-LIMIT` safety cap, Godot now captures the same diagnostic Normal interactive Godot sessions have no cumulative instruction ceiling. Bounded Godot diagnostic runs retain
automatically as `user://diagnostics/step-limit-<timestamp>.json` and copies its coordinate/path to the `STEP-LIMIT`; if one fires, Godot captures the same diagnostic automatically as
clipboard. Before nested frames unwind, the trace sink preserves the deepest active script stack. The console `user://diagnostics/step-limit-<timestamp>.json` and copies its coordinate/path to the clipboard. Before nested
also prints the exact final script/offset/opcode, that frame chain, the hottest sites in the bounded final frames unwind, the trace sink preserves the deepest active script stack. The console also prints the exact final
128-instruction window, and the final 16-instruction sequence. This makes the last ADV locator unnecessary for script/offset/opcode, that frame chain, the hottest sites in the bounded final 128-instruction window, and the
identifying a post-dialogue loop; send either the `step-limit` console block or the generated JSON. 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) ## Native FFmpeg movie shim (Windows x64)

View File

@@ -31,6 +31,7 @@
<Compile Include="..\..\godot\GodotTimelineLog.cs" Link="GodotTimelineLog.cs" /> <Compile Include="..\..\godot\GodotTimelineLog.cs" Link="GodotTimelineLog.cs" />
<Compile Include="..\..\godot\GodotTraceSink.cs" Link="GodotTraceSink.cs" /> <Compile Include="..\..\godot\GodotTraceSink.cs" Link="GodotTraceSink.cs" />
<Compile Include="..\..\godot\StepLimitDiagnosticFormatter.cs" Link="StepLimitDiagnosticFormatter.cs" /> <Compile Include="..\..\godot\StepLimitDiagnosticFormatter.cs" Link="StepLimitDiagnosticFormatter.cs" />
<Compile Include="..\..\godot\GodotVmOptions.cs" Link="GodotVmOptions.cs" />
<Compile Include="..\..\godot\PerformanceFrameLog.cs" Link="PerformanceFrameLog.cs" /> <Compile Include="..\..\godot\PerformanceFrameLog.cs" Link="PerformanceFrameLog.cs" />
<Compile Include="..\..\godot\MovieSurfaceRegistry.cs" Link="MovieSurfaceRegistry.cs" /> <Compile Include="..\..\godot\MovieSurfaceRegistry.cs" Link="MovieSurfaceRegistry.cs" />
<Compile Include="..\..\godot\RiffWaveSanitizer.cs" Link="RiffWaveSanitizer.cs" /> <Compile Include="..\..\godot\RiffWaveSanitizer.cs" Link="RiffWaveSanitizer.cs" />

View File

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

13
godot/GodotVmOptions.cs Normal file
View File

@@ -0,0 +1,13 @@
using Age.Engine.Vm;
/// <summary>Separates bounded diagnostic runs from the persistent interactive AGE session.</summary>
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);
}

View File

@@ -391,10 +391,7 @@ public partial class Main : Godot.Control
if (histFile != null) { _hist = new Age.Engine.Diagnostics.HistogramTraceSink(); if (histFile != null) { _hist = new Age.Engine.Diagnostics.HistogramTraceSink();
sink = new Age.Engine.Diagnostics.CompositeTraceSink(_trace, _hist); } sink = new Age.Engine.Diagnostics.CompositeTraceSink(_trace, _hist); }
_vm = new VirtualMachine(script, table, _host, _vm = new VirtualMachine(script, table, _host,
new VmOptions( GodotVmOptions.Create(_selftest, nativeDebugMenu),
MaxSteps: 20_000_000,
IgnoreExitRequests: nativeDebugMenu,
NoSaveDat: _selftest),
provider, sink, provider, sink,
sharedProfile: sharedProfile, sharedProfile: sharedProfile,
nativeDatStore: nativeSaveStore, nativeDatStore: nativeSaveStore,