Skip to content

engine: a run that stops early reports unsaved rows as results #939

Closed

Description

@bpowers

When a VM run stops early (for example a conveyor raises ConveyorTransitTooLong partway through), Vm::into_results() should report only the rows the run actually saved.
It used to report the full allocated row count, so callers read the zeroed tail of the buffer as simulated data, and get_series and into_results disagreed about how many steps there were.

Example

A conveyor model whose run aborts after saving 14 of 25 rows: the wasm backend reports 14 saved rows; vm.into_results().step_count reported 25.

Fix

Both into_results and get_series now count rows from the same cursor (Vm::saved_rows), so an early-stopped run reports the rows it saved.

Pointers

  • src/simlin-engine/src/vm.rs: into_results, saved_rows, get_series
  • Downstream readers of Results::step_count: simlin_sim_get_stepcount in src/libsimlin, pysimlin's Run.data
  • engine: a conveyor step error leaves the VM half-advanced #938: the same early-stop path leaves conveyor state half-advanced (a separate problem)

Activity

  1. added
    bug
    engine
    on Jul 11, 2026
  2. changed the title [-]engine: Vm::into_results() reports slab capacity as step_count, not rows actually saved[/-] [+]engine: a run that stops early reports unsaved rows as results[/+] on Oct 12, 2026
  3. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing: already fixed on main.

    Vm::into_results and Vm::get_series both count rows through Vm::saved_rows (the save cursor) at src/simlin-engine/src/vm.rs:1424-1441 and vm.rs:1882 (PR #1075); a conveyor error returns before the save/advance step (vm.rs:1162-1175), so the failing step is not counted. A partial run's step_count is pinned in vm_step_grid_tests.rs:142-146 and VM-vs-wasm saved-row parity in wasmgen/module_tests.rs run_to_at_save_and_between_save_points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugengine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions