fix(main): preserve per-run dot output under --simulation_first_traces#363
Merged
Merged
Conversation
Each captured run wrote to a shared `outDir/graph.dot` path, so all
but the last overwrite silently. Only the final write survived and
the flag's intent — capture the first N runs as separate samples —
was unreachable. Reproduced on the salon spec with
`--max_runs 1000 --simulation_first_traces 5`: five "Writen graph
dotfile" log lines all pointed at the same path and the on-disk
content was the fifth run only.
Thread a fileName argument through writeDotFileIfNeeded:
- non-simulation call site keeps "graph.dot" (unchanged behavior)
- simulation in-loop site uses "graph_run_<i>.dot" so the first
N runs land in distinct files
- post-loop "last run" write keeps the canonical "graph.dot" name
so any downstream tooling reading the well-known path keeps
working
Backward compatible: anything that consumed `graph.dot` keeps
finding it (the post-loop write now fires unconditionally in
simulation mode, including the edge case where --max_runs <=
--simulation_first_traces and the canonical name would otherwise
not exist). New consumers can also read `graph_run_*.dot` for the
captured first-N samples.
Verified on the salon spec for both `--max_runs 5
--simulation_first_traces 5` (regression case, all 5 captures +
graph.dot) and `--max_runs 1000 --simulation_first_traces 5` (5
captures + graph.dot from a non-captured later run).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each captured run wrote to a shared
outDir/graph.dotpath, so all but the last overwrite silently. Only the final write survived and the flag's intent — capture the first N runs as separate samples — was unreachable. Reproduced on the salon spec with--max_runs 1000 --simulation_first_traces 5: five "Writen graph dotfile" log lines all pointed at the same path and the on-disk content was the fifth run only.Thread a fileName argument through writeDotFileIfNeeded:
Backward compatible: anything that consumed
graph.dotkeeps finding it (the post-loop write now fires unconditionally in simulation mode, including the edge case where --max_runs <= --simulation_first_traces and the canonical name would otherwise not exist). New consumers can also readgraph_run_*.dotfor the captured first-N samples.Verified on the salon spec for both
--max_runs 5 --simulation_first_traces 5(regression case, all 5 captures + graph.dot) and--max_runs 1000 --simulation_first_traces 5(5 captures + graph.dot from a non-captured later run).