Commit 7d57055
[nightshift] 20260422 multi-cleanup (#5044)
> *dcebae8d — haiku*
> Dead code falls away
> Stale comments drift with the breeze
> Logs hoist at module root
## Summary
Nightshift cleanup sweep across `lib/iris` and `lib/zephyr`. Two scouts
produced
changes; two filed `no_change` with notes recorded below for follow-up.
### lib/iris/src/iris (applied — 7505fd9)
- Hoisted the `from iris.rpc import logging_pb2` import and the
`_STR_TO_ENUM`
mapping in `iris/logging.py` out of the `str_to_log_level` function body
to
module scope. The deferred import had no corresponding circular
dependency
(`iris.rpc.logging_pb2` does not import `iris.logging`) and every file
that
imports `str_to_log_level` already imports `logging_pb2` directly.
- Widened the `str_to_log_level` parameter type to `str | None` and
folded the
falsy-check into the function, allowing four call sites to drop their
redundant `if level_name else 0` guards.
- Fixed a stale code comment in `cluster/types.py` that pointed at
`iris.logging` for `LevelPrefixFormatter` / `_LEVEL_PREFIX` — those
helpers
live in `rigging.log_setup`.
### lib/zephyr/src/zephyr (applied — a3d9e7c)
- Removed the dead `scatter_manifest_dir` parameter from
`_regroup_result_refs`,
its two call sites, and the two local variables (`output_stage_name`,
`join_output_stage_name`) that only existed to construct the now-unused
path.
The coordinator-side scatter manifest was removed in #4853 but this
plumbing
was left behind.
### lib/levanter/src/levanter (no_change — findings only)
Scout flagged but could not commit (sandbox denied file writes):
- **Correctness bug**: `levanter/schedule.py:value_at_step` iterates the
schedule forward and returns the first entry whose `start <= step`,
which
always yields the earliest segment's value for any schedule with more
than
one `ScheduleStep`. The call site
`levanter/trainer.py:batch_axis_at_step`
depends on this, so a training run configuring `train_batch_size` as an
`IntSchedule` gets the wrong batch size after the first segment
boundary.
Regressed in PR #887 / commit 83f3f34 (renamed `until` → `start`
without
reversing the iteration order).
- `utils/stat_utils.py:RunningMean.add` recomputes `self.total + total`
twice
(harmless duplicate).
- `shapes.py:conforms` appears unreferenced across `lib/`.
- `utils/background_iterable.py:80-87` has tautological `except
StopIteration:
raise` / `except Exception as e: raise e` blocks flagged by the
AGENTS.md
LLM-pitfall list.
### lib/marin/src/marin (no_change — findings only)
Scout identified dead code but was also blocked by the sandbox:
- `asdict_excluding` in `utils.py` (~27 LOC + self-referential tests) —
last real caller was removed when speedrun code was deleted in #4541.
- `lib/marin/src/marin/cluster/ray.py` (959 LOC, entirely unused) —
already
being removed in open PR #5028, so not duplicated here.
- `evaluation/utils.py` uses `print` instead of `logger` in
`download_from_gcs` / `upload_to_gcs`.
- `core/runtime.py` still calls `datetime.utcnow()` (deprecated in
3.12).
## Test plan
- [x] `./infra/pre-commit.py --all-files --fix` — clean
- [x] `uv run pytest -x lib/iris/tests/test_logging.py` — 19 passed
- [x] `uv run pytest -x lib/zephyr/tests/test_execution.py` — 42 passed
---------
Co-authored-by: Nightshift Scout <nightshift@example.com>
Co-authored-by: Nightshift Scout <nightshift-scout@anthropic.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 53bf959 commit 7d57055
7 files changed
Lines changed: 22 additions & 28 deletions
File tree
- lib
- iris/src/iris
- cluster
- log_store
- providers/k8s
- worker
- zephyr/src/zephyr
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
| 528 | + | |
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
| 528 | + | |
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
| 484 | + | |
485 | 485 | | |
486 | | - | |
| 486 | + | |
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
898 | 898 | | |
899 | 899 | | |
900 | 900 | | |
901 | | - | |
| 901 | + | |
902 | 902 | | |
903 | 903 | | |
904 | 904 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
13 | 23 | | |
14 | 24 | | |
15 | | - | |
16 | | - | |
| 25 | + | |
| 26 | + | |
17 | 27 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
869 | | - | |
870 | 869 | | |
871 | 870 | | |
872 | 871 | | |
| |||
881 | 880 | | |
882 | 881 | | |
883 | 882 | | |
884 | | - | |
885 | 883 | | |
886 | 884 | | |
887 | 885 | | |
| |||
923 | 921 | | |
924 | 922 | | |
925 | 923 | | |
926 | | - | |
927 | 924 | | |
928 | 925 | | |
929 | 926 | | |
| |||
933 | 930 | | |
934 | 931 | | |
935 | 932 | | |
936 | | - | |
937 | 933 | | |
938 | 934 | | |
939 | 935 | | |
| |||
1313 | 1309 | | |
1314 | 1310 | | |
1315 | 1311 | | |
1316 | | - | |
1317 | 1312 | | |
1318 | 1313 | | |
1319 | 1314 | | |
| |||
0 commit comments