Skip to content

Repo cleanup: remove run logs and forwarding stubs, single source for pins, merge weight and lag bounds - #239

Open
michaellchung wants to merge 11 commits into
s22-agentic-sft-modalfrom
s23-p0-verified
Open

michaellchung wants to merge 11 commits into
s22-agentic-sft-modalfrom
s23-p0-verified

Conversation

@michaellchung

Copy link
Copy Markdown
Contributor

Summary

First batch of the repository cleanup (OpenSpec change rl-code-quality-cleanup, stages 0 and 2). No training numerics or scheduling behaviour change.

Stage 0 - repo hygiene and one import path

  • Move run logs out of git (236 files, ~3.8 MB). They now live outside the repo; each old directory keeps an EVIDENCE.md pointer. .gitignore covers run-logs/, *.stderr, *.stdout, *metrics*.json and no longer whitelists logs. New tests/test_no_tracked_logs.py fails if a log is tracked again.
  • Delete the 46 forwarding stubs (18 in yeto/rl/, 28 in yeto/rl/engine/miles_adapter/); every import uses the real module path. python -m yeto.rl.learner still works as a CLI entry point.
  • Define the Miles/critic fork lineage and harness pins once in pins.py; loss_variants, critic_fork and the Miles entry derive from it.
  • Syncer --island-lease-s default is now 300 s, matching the launcher and CLI help.

Stage 2 - one bridge, one weight and staleness definition

  • Delete dead code with no production caller: ElasticRlBridge, make_island_bridge, TwoRoleStrictAvg, and the unused PPO role-lane.
  • Add a StrictRlBridge vs StrictAvgSync parity test (byte-identical).
  • Define the learner merge weight once in merge.rs; elastic.rs calls it. The step argument is widened to u64 losslessly, so values are unchanged.
  • Lock the Python merge weight and the lag bounds to the Rust syncer with parity tests.
  • Document the strict / decoupled / elastic sync rules as one table.
  • Fix: the committed-evidence equivalence test now skips when its run logs are absent (they were moved out of git).

Known deviation

  • tests/import_boundary_allowlist.txt cap goes from 10 to 11. Removing the miles_overlay stub exposed a pre-existing launcher -> adapter overlay import that the stub had hidden. This is not a new import, but it does relax the "allowlist only shrinks" rule. Follow-up: remove that import.

Test plan

  • Local safe suite on this branch (pytest tests/, excluding the Ray-spawning mismatch_tape / upstream_parse_args tests): 17 failed / 33 errors before the evidence-skip fix, and the failure set matched the pre-change baseline except for the one test fixed in the last commit. That test now passes or skips.
  • cargo test in syncer/: 157 passed, 0 failed.
  • No GPU run. These changes do not touch rollout or training code paths.

Stacked on #238 (base s22-agentic-sft-modal). Retarget to main after #238 merges.

🤖 Generated with Claude Code

chowhsu and others added 11 commits October 12, 2026 11:38
Untrack 236 run-log files (run-logs/, *.log, *.jsonl, *.out, *.err) under
openspec/changes/*. Copies live in infra-drafts/evidence/<change>/; each old
directory keeps an EVIDENCE.md pointer. Drop log re-include lines from
.gitignore and add trailing log rules. Add tests/test_no_tracked_logs.py;
test_fn_learning_signal reads the try27 log from the out-of-repo evidence dir.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove yeto/rl/engine/miles_adapter/ (28 stubs) and 17 yeto/rl/ stubs;
rewrite every import, mock target, -m command and path string in yeto/,
tests/, scripts/, tools/, docker/ and docs/ to the real module.
yeto/rl/learner.py is now a command-line entry only: python -m
yeto.rl.learner runs island_entry, importing it raises ImportError.
test_import_boundaries forbids the old paths everywhere. Removing the
miles_overlay stub exposed a pre-existing launcher -> adapter import the
check could not see; it is now an allowlist entry (cap 10 -> 11).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pins.py gains MILES_FORK_LINEAGE, CRITIC_FORK_LINEAGE and
miles_fork_lineage_from(); loss_variants.FORK_COMMITS, critic_fork and the
Miles declaration pins in entry.py derive from them instead of hand-copied
SHA sets (values unchanged). The torch_memory_saver preload pins move from
ssh_harness.py into pins.py. test_rl_engine_pins asserts all sets agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
syncer --island-lease-s defaulted to 30 s while the launcher always passes
300 s and the CLI help says 300. Change the syncer default to 300.0 and add a
test that the syncer, CLI help and launcher defaults agree. cargo test: 155
passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove ElasticRlBridge and make_island_bridge from yeto/rl/bridge.py (no
production caller; the elastic island path is engine.bridges.ElasticAvgSync),
TwoRoleStrictAvg with its helpers from critic_state.py (critic sync is
DualStrictAvgSync), and the unused PPO role lane in local_learner.py (role
lanes are SAO-only in production). Delete or narrow the tests that only
covered this code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both strict paths push byte-identical delta payloads and round metadata for
the same base and local result, and the reference token^2/steps merge of
those payloads is elementwise equal (three seeds, two islands).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
elastic.rs merge_weight now calls merge::learner_weight and keeps its
zero-tokens/zero-steps branch. learner_weight takes c_steps as u64 so the
elastic wire value needs no narrowing; strict callers widen u32 losslessly.
A new Rust test checks the result is bit-identical to the old formula.
cargo test: 156 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_rl_inter_island_rust_golden writes merge_weight_golden.txt from Python
island_ledger.merge_weight; a new merge.rs test replays it bit for bit. Lag
bounds are read from elastic.rs (MAX_SAMPLE_OUTER_LAG, DEFAULT_MAX_CARRY_LAG)
and compared with island_ledger, printing both values on a mismatch. The
golden tape must keep its lag=3 carry_lag_exceeded rejection. cargo test:
157 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine/bridges.py module docstring now holds the merge weight, staleness
and finish rules of the three sync modes; test_rl_sync_mode_table checks the
header, the three rows, and that the change spec carries the same table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bsent

The run logs this test reads were moved out of the repository, so in a clean
checkout the arm discovery raises FileNotFoundError instead of skipping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants