Skip to content

Add TimingShim for rollout loops positronic does not run - #494

Closed
vertix wants to merge 5 commits into
eval-timingfrom
molmo-timing-shim
Closed

Add TimingShim for rollout loops positronic does not run#494
vertix wants to merge 5 commits into
eval-timingfrom
molmo-timing-shim

Conversation

@vertix

@vertix vertix commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What

Re-integrates the MolmoSpaces pilot's timing shim into positronic, stacked on #479 (eval-timing), per the graduate-before-merge decision (internal#76): the durable half of nebius-competition PR #22 lands here before #22 merges.

  • positronic/eval_timing_shim.pyTimingShim/Episode: an external rollout loop (MolmoSpaces is the first) marks phases (reset / policy / env step / record IO) and outcomes; the shim writes the timing.jsonl records and the recorded-episode stubs (meta.json + static.json + a timestamped parquet signal in the block/episode layout) that positronic eval timing-report joins by episode_uid. Plus a /proc-based host CPU/RAM sampler sidecar (host_stats.log) the reducer deliberately ignores.
  • One schema owner: the pilot's copy re-implemented EpisodeTiming and the dmon sampler as a wire contract; here they are imported from eval_timing, whose start_gpu_sampler is promoted public as the shared GPU sampler (only rename + a log-prefix neutralization touch Opt-in wall-clock telemetry for positronic eval run + eval timing-report #479's file).
  • positronic/tests/test_eval_timing_shim.py — ported from the pilot: schema/invariant round-trip through the real EpisodeTiming, join-layout, abort-discard, GPU/host sampler behavior, and an end-to-end reduce through the real positronic eval timing-report CLI in-repo (the pilot version shelled out to a hardcoded external worktree and skipped when absent — now it always runs).

Changes vs. the pilot source, beyond the imports: PEP 723 header dropped, pyarrow is a hard import (core dependency here), /proc-dependent tests skip cleanly off-Linux, and the pilot's run_pilot.py tests stayed behind (experiment glue, moving to experiments/002 in #22's rework).

Testing

pytest positronic/tests/ --no-cov: 21 passed, 4 skipped (the 9 new tests all pass, e2e reduce included). ruff check + format clean. No references to the old private sampler name remain.

🤖 Generated with Claude Code

An external rollout loop (MolmoSpaces first) marks phases and outcomes on the
shim, which writes the `timing.jsonl` records and recorded-episode stubs
`positronic eval timing-report` joins — one `EpisodeTiming` schema owner,
shared from `eval_timing`. `start_gpu_sampler` is promoted public there as
the shared GPU sampler. Includes a host CPU/RAM sampler sidecar the reducer
ignores.

Requested-by: Vladimir Yakunin
Ticket: Positronic-Robotics/internal#76 #refs
@vertix

vertix commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: edb980136e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread positronic/eval_timing_shim.py
@vertix

vertix commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb598749d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread positronic/eval_timing_shim.py Outdated
Comment thread positronic/eval_timing_shim.py Outdated
Append each `EpisodeTiming` to `timing.jsonl` as the episode seals instead of
buffering until `close()`, so a pass killed mid-run keeps every completed
rollout's timing. `run()` truncates the file up front; explicit `begin/finish`
without `run()` truncates lazily on the first flush, and `close()` no longer
rewrites the whole file (still returns the path, leaving an empty valid file
for a zero-episode pass). Clear a stale `host_stats.log` in `run()`, symmetric
with the `gpu_dmon.log` clear, so a prior pass's samples aren't mistaken for
current telemetry with `sample_host=False`.

Requested-by: Vladimir Yakunin
Ticket: Positronic-Robotics/internal#76 #refs
@vertix

vertix commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5cbecf8883

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread positronic/eval_timing_shim.py
Freeze `wall_s` and `finished_at` on the same side of the stub write in
`finish_episode`, passing `finished_at` into `to_timing` instead of stamping it
after the `_write_episode_dir` I/O. The reducer reconstructs an episode's start
as `finished_at - wall_s`; capturing the two across the stub write skewed that
start by the write duration on slow filesystems. The stub write is shim
bookkeeping, not part of the rollout, so it now falls outside the episode window
entirely.

Requested-by: Vladimir Yakunin
Ticket: Positronic-Robotics/internal#76 #refs
@vertix

vertix commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 5f0145ee0a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@vertix

vertix commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 5f0145ee0a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@vertix

vertix commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f0145ee0a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread positronic/eval_timing_shim.py
A preemption between the episode dir becoming visible and its last file
landing left a half-written stub that `timing-report` read as a finished
episode. Bracket the stub writes with LocalDataset's `.unfinished`
marker (same contract as its writer) and clear it after the last write.

Ticket: Positronic-Robotics/internal#73 #refs
@vertix

vertix commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 0b0f215197

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@vertix

vertix commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing unmerged — TimingShim instruments an external rollout loop "positronic does not run", which the loop-ownership invariant (#503) rejects: positronic always owns the control loop, so MolmoSpaces (and any own-harness benchmark) integrates behind the env wire (#504) and is timed natively by our own loop — there is no external loop left to shim. The native eval-timing reducer this was stacked on (#479) is unaffected and stays open.

@vertix vertix closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant