MonteCarlo `append=True` does not continue the same seeded run
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by reading simulate() and how _initial_sim_idx and num_of_loaded_sims are used, then inspect the output-file loading and parallel worker index handling. The issue proposes storing root state in a versioned sidecar and validating append seeds, but calls out migration or re-baselining for older files. Done means appended runs preserve the seeded sequence and use present simulation indices correctly, with tests covering interrupted runs and seed mismatches.
由索引模型根据 Issue 内容生成。
描述
Context
Per-simulation seeding from #1054 makes a single simulate() run reproducible, but continuing a run across calls with append=True is a separate piece that still has two gaps. This came up while reviewing #1054, and I am filing it on its own so that PR can stay scoped to the per-index seeding in #1053.
The two gaps
The root seed is not persisted. simulate() re-derives the seed root from random_seed on every call, so:
mc.simulate(100, random_seed=42)
mc.simulate(200, append=True) # random_seed defaults to None -> a fresh root
the second call draws a new root, and indices 100..199 belong to a different random draw than the first 100. Passing a different seed on the append is worse, since the output then mixes samples from two unrelated roots with no warning.
The next index comes from a row count. _initial_sim_idx is num_of_loaded_sims, which counts rows in the output file. If a parallel run is interrupted and leaves a gap (indices 0, 2, 3 written, 1 missing), the append starts at index 3: index 3 repeats and index 1 is never filled. Workers claim an index before running and finish out of order, so a gap after a failure is a real possibility rather than a corner case.
A possible direction
Persist the root state (plus a small schema version) in a sidecar next to the output. On append=True, load that root instead of deriving a new one, take the next index from the set of indices actually present rather than a row count, and reject an append whose random_seed disagrees with the stored root. Output files written before this exists would need an explicit migration or a re-baseline.
Happy to take this on as a follow-up to #1054.
- 主要语言
- Python
- 星标
- 1.1k
- 派生
- 280
- 平均合并
- 3 天 2 小时
- 30 天内合并 PR
- 24
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RocketPy-Team/RocketPy 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
RocketPy-Team/RocketPy#1255 ·
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
RocketPy-Team/RocketPy#1241 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
RocketPy-Team/RocketPy#1202 ·
维护者通常 3 天内回复
-
Monte Carlo test fixtures write their logs into the working directory可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
RocketPy-Team/RocketPy#1189 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
RocketPy-Team/RocketPy#1171 · 1 条评论 ·
维护者通常 3 天内回复
查看 RocketPy-Team/RocketPy 的全部 Issue
相似的 Issue
-
docs(contributing): the two things that silently block a PR可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭available documentation good first issue
难度 1/5 1-3 小时 新手友好度 95/100
Nixitov/Riptide-Native#944 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
JTHCode/secretguard#24 ·
维护者通常 1 天内回复
-
area: middleware documentation good first issue
难度 2/5 1-3 小时 新手友好度 88/100
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
omarelshamy25x/shamy-hijri#63 ·
维护者通常 1 天内回复