Skip to content

cli: debug silently drops rows when reference and run differ in length #437

Open

Description

@bpowers

simlin debug pairs the simulation's rows with the reference file's rows by position and stops at whichever runs out first.
When the two differ in length, the extra rows are dropped without any message, so a divergence late in the run can go unseen.
It should say on stderr when the lengths differ, and by how much.

Example

A reference file with 50 saved rows compared against a run that saves 10 (for example a systems model, which the CLI always runs for 10 rounds, #439) prints 10 row pairs and nothing else.
The same happens in the other direction: a short reference silently cuts off the simulation's output.

Rows are also paired by position, not by time, so a reference saved at a different interval is compared against the wrong rows, again silently.

Fix

Before printing, compare the two row counts and the first few times; if they disagree, print a warning to stderr naming both counts (or the first mismatched time).
Keep the TSV on stdout unchanged.
Pairing rows by time instead of position would be more correct but is a bigger change for a debugging tool; a warning is enough.

Pointers

  • src/simlin-engine/src/results.rs: Results::write_tsv (the reference branch breaks when the reference runs out)
  • src/simlin-cli/src/main.rs: print_filtered_tsv_comparison (systems models, uses zip) and the Command::Debug arm

Activity

  1. added
    hygiene
    on Jun 8, 2026
  2. added
    engine
    on Oct 12, 2026
  3. changed the title [-]cli debug and print_tsv_comparison silently truncate on length mismatch[/-] [+]cli: debug silently drops rows when reference and run differ in length[/+] on Oct 12, 2026
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

    enginehygiene

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions