Skip to content

[nightshift] 20260422 multi-cleanup#5044

Merged
claude-nightshift[bot] merged 2 commits intomainfrom
nightshift/cleanup-20260422
Apr 22, 2026
Merged

[nightshift] 20260422 multi-cleanup#5044
claude-nightshift[bot] merged 2 commits intomainfrom
nightshift/cleanup-20260422

Conversation

@claude-nightshift
Copy link
Copy Markdown
Contributor

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 [zephyr] Eliminate coordinator-side scatter manifest consolidation #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 Reproduce Olmo 2 SFT #887 / commit 83f3f34 (renamed untilstart 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:

Test plan

  • ./infra/pre-commit.py --all-files --fix — clean
  • uv run pytest -x lib/iris/tests/test_logging.py — 19 passed
  • uv run pytest -x lib/zephyr/tests/test_execution.py — 42 passed

Nightshift Scout and others added 2 commits April 22, 2026 11:11
Move ``from iris.rpc import logging_pb2`` and the ``_STR_TO_ENUM`` mapping
to module scope so each ``str_to_log_level`` call no longer re-executes
the import and rebuilds the dict. 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. Widen the parameter type to
``str | None`` and fold the falsy-check into the function itself, then
drop the redundant ``if level_name else 0`` guards at four call sites.
Update the stale CALLABLE_RUNNER comment that pointed at ``iris.logging``
for ``LevelPrefixFormatter``/``_LEVEL_PREFIX`` — those moved to
``rigging.log_setup``.
The coordinator-side scatter manifest was removed in #4853 but its
plumbing — the `scatter_manifest_dir` parameter on
`_regroup_result_refs` and the `output_stage_name` /
`join_output_stage_name` locals that only existed to build that path —
was left behind. Remove the unused parameter, its two call sites, and
the two dead locals.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@claude-nightshift claude-nightshift Bot added agent-generated Created by automation/agent nightshift Automated nightshift fixes labels Apr 22, 2026
@claude-nightshift claude-nightshift Bot enabled auto-merge (squash) April 22, 2026 11:14
@claude-nightshift claude-nightshift Bot requested a review from rjpower April 22, 2026 11:14
@claude-nightshift claude-nightshift Bot merged commit 7d57055 into main Apr 22, 2026
40 of 41 checks passed
@claude-nightshift claude-nightshift Bot deleted the nightshift/cleanup-20260422 branch April 22, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-generated Created by automation/agent nightshift Automated nightshift fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant