Fix CLI/tooling robustness gaps and dedupe the Conditioning enum
CI / Lint (ruff check) (push) Successful in 35s
CI / Format (ruff format) (push) Failing after 31s
CI / Type check (ty) (push) Successful in 30s
CI / Sync project version with tag (push) Has been skipped
CI / Tests (push) Successful in 1m7s

- run_create_manifest gains --force; it previously overwrote an
  existing manifest (including holdout.manifest, which
  check_holdout_overlap exists specifically to protect) with no
  warning or backup on a second run.
- _git_user_name only caught OSError, not subprocess.TimeoutExpired (a
  SubprocessError, not an OSError) — a slow/loaded shared portal
  machine could crash `dwarf bump-gen`/`bump-schema` instead of
  degrading to by=None as intended.
- `dwarf convert --jobs`/`make-root --jobs` now warn (never block) when
  the requested count exceeds ~1/4 of the machine's CPUs, matching the
  same shared-machine etiquette check added to giant train in the
  previous commit.
- The Conditioning enum was independently redefined in both
  giant/cli.py and scripts/dwarf.py; moved to a single
  giant.config.Conditioning both now import, removing the drift risk
  of a third conditioning mode being added to one but not the other.

Each fix has a regression test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 13:49:09 +02:00
parent ad1b8e7835
commit ca3a2a3462
6 changed files with 124 additions and 10 deletions
+4 -3
View File
@@ -211,9 +211,10 @@ class Mode(str, Enum):
wgan = "wgan"
class Conditioning(str, Enum):
physical = "physical"
embedding = "embedding"
# Conditioning itself lives in giant.config (imported below as gconfig) —
# shared with scripts/dwarf.py's Typer commands so the two CLIs can't
# silently drift apart on the option's valid values.
Conditioning = gconfig.Conditioning
class Coord(str, Enum):
+12
View File
@@ -4,11 +4,23 @@ import subprocess
import sys
import tomllib
from datetime import datetime, timezone
from enum import Enum
from pathlib import Path
import numpy as np
import torch
class Conditioning(str, Enum):
"""`model.conditioning` choices — shared by `giant.cli` and `scripts.dwarf`'s
Typer commands so the two CLIs can't silently drift apart on the option's
valid values (see DEFAULT_CONFIG["model"]["conditioning"] for what each
value means)."""
physical = "physical"
embedding = "embedding"
DEFAULT_CONFIG: dict = {
"train": {
"mode": "flow",