Skip to content

test: batchflow test suite and retained tooling - #557

Open
ElmoPA wants to merge 4 commits into
bf/5-evalfrom
bf/6-tests
Open

test: batchflow test suite and retained tooling#557
ElmoPA wants to merge 4 commits into
bf/5-evalfrom
bf/6-tests

Conversation

@ElmoPA

@ElmoPA ElmoPA commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

The tests covering the preceding layers, plus the scripts worth keeping: the
CUDA kernel build, ops/, the eval entrypoint, and the sim replay tooling.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

ElmoPA commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@ElmoPA
ElmoPA force-pushed the bf/6-tests branch 2 times, most recently from 088a9cf to 48db95d Compare August 8, 2026 05:33
@ElmoPA
ElmoPA force-pushed the bf/6-tests branch 2 times, most recently from 0b796a7 to ae704d6 Compare August 8, 2026 19:02
@ElmoPA
ElmoPA force-pushed the bf/5-eval branch 2 times, most recently from 3806b2a to 0c3a107 Compare August 8, 2026 20:07
ElmoPA and others added 4 commits August 9, 2026 07:18
The tests covering the preceding layers, plus the scripts worth keeping: the
CUDA kernel build, ops/, the eval entrypoint, and the sim replay tooling.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
They exercise egomimic.algo.diffusion / egomimic.eval.dfot, which move to the
DFoT PR stacked above.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
No test referenced MultiDataModuleWrapper at all, which is why the missing
pack_collate dispatch survived: test_packed_pipeline covers the *other*
pack_collate call site (norm-stat inference), so the subsystem looked tested.

Asserts the dispatch itself and that it reaches the DataLoader, for both the
train and valid loaders, and that unpacked datasets still get annotation_collate.
Uses MagicMock(spec=ZarrEpisodePackedDataset) -- the same pattern
test_packed_pipeline already uses -- so it needs no dataset on disk.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
All four groups were stale tests, not broken code. Nothing under egomimic/ is
touched by this commit.

test_training_recipe (7): PackedAlgoBase takes an assembled outer_stage now --
action_dim / action_horizon / d_model / cond_encoder / hnet moved onto
HNetOuterStage. The tests still passed them flat, so __init__ raised TypeError
for the missing positional. They now build the HNetOuterStage and pass it; what
each test asserts (lr stamping, parameter_groups, init_weights_range) is
unchanged.

test_pi (4): skipped at module level, not repaired. They describe a
PI.visualize_preds API that exists nowhere -- no branch of this repo defines it
(main included), egomimic.algo.pi.algo exposes no draw_actions to monkeypatch,
and neither EgoVerse2 nor EgoVerse-gmm-dualstream implements it, so it was never
ported into this lineage rather than dropped from it. Kept rather than deleted
so the intent stays on record. (Their first error was a stale aria_bimanual
domain, renamed to human_bimanual by the human/eva collapse; fixing that only
exposed the missing method underneath.)

test_core_defaults_byte_identical (1): the tx forward checksum was never a valid
invariant. tx's output cancels from an absolute sum of 7163 down to a signed sum
of ~1e-5, so the value moves with BLAS reduction order -- measured -1.21e-05 at
one thread vs -4.43e-05 at two, on identical weights -- while the test compared
it to a fixed ~1e-6 absolute bound. The reference simply captured one machine's
rounding noise; refreshing it would fail again elsewhere. The guard is now the
ABSOLUTE sum, stable to ~1e-8 relative across thread counts and still sensitive
to any real forward change, with the signed sum kept at a tolerance scaled to
the magnitude summed. lstm and hnet were unaffected because their sums are O(1)
and O(100) and do not cancel.

test_packed_pipeline (1): PUSHT_FOLDER pointed one directory level too high.
circle/ now holds a basic/ subfolder rather than .zarr episodes and the resolver
does not recurse, so the isdir() skip-guard passed while the resolver matched
nothing. Same drift as data/pushshapes/packed_episode/simulation/delta.yaml.
Correcting it also un-skipped three dataset-gated tests, which pass.

Suite: 13 failed / 297 passed -> 0 failed / 309 passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Claude Code Review

Review of PR #557

Summary

Adds a batch of standalone smoke/regression test scripts under tests/regression/ plus tooling scripts (scripts/build_cuda_exts.sh, scripts/install_cuda_kernels*.sh, scripts/eval_cfg_latest.py, scripts/replay_episode_in_sim.py, scripts/run_drift_eval.py, scripts/test_sim_replay.py) and moves three shell utilities under scripts/ops/. No production code changes.

Key concerns

  1. Hardcoded absolute paths everywhere. These are not portable across users/clusters:

    • scripts/build_cuda_exts.sh, scripts/install_cuda_kernels.sh, scripts/install_cuda_kernels_sky1.sh all cd /coc/flash7/paphiwetsa3/projects/EgoVerse{,-pact} — will fail for any other operator.
    • scripts/install_cuda_kernels_pace.sh hardcodes /storage/project/r-dxu345-0/paphiwetsa3/install/bin on PATH.
    • tests/regression/smoke_packed_*.py and scripts/test_sim_replay.py hardcode /coc/cedarp-dxu345-0/Tsim_datasets2/circle and /coc/flash7/paphiwetsa3/datasets/circle/basic. These "tests" cannot be run by anyone else, so they can't gate anything in CI.
  2. tests/regression/ files are not real tests. They're if __name__ == "__main__" scripts named smoke_*.py (not test_*.py), with no pytest assertions returned via test runner. If the intent is regression coverage, they won't be discovered by pytest. If the intent is manual smoke scripts, they should live under scripts/smoke/, not tests/.

  3. Three near-identical install scripts (install_cuda_kernels.sh, install_cuda_kernels_sky1.sh, install_cuda_kernels_pace.sh) with duplicated logic and slightly different pins (mamba_ssm==2.2.4 vs 2.2.5, causal_conv1d==1.4.0 in build script vs 1.5.0.post8 in installers). This is a maintenance trap — the build_cuda_exts.sh even pins causal_conv1d==1.4.0 while its docstring in the installer scripts explicitly says 1.4.0 has a broken csrc layout. Which is right?

  4. eval_cfg_latest.py mutates algo.inference_mode, algo.cfg_scale, algo.ar_inference_chunk_size, algo.ar_inference_step_size at attribute level with no validation that the algo class actually declares these fields. Silent typos become no-ops.

  5. run_drift_eval.py re-implements load_algo_from_ckpt (copy-pasted from smoke_sim_eval per the comment), duplicating the loader that already exists at egomimic.eval.core.ckpt_loading.load_algo_from_ckpt (used by eval_cfg_latest.py in this same PR). Pick one.

  6. test_sim_replay.py name collides with pytest conventions (test_*.py) but is not actually a test — pytest will try to collect it, find no test_ functions, and it'll pass vacuously, hiding whether the script itself works.

Suggestions

  • Parametrize all hardcoded paths via env vars or CLI args with sensible fallbacks (e.g., ${EGOVERSE_ROOT:-$PWD}, --data-dir on the replay/norm-stats scripts).
  • Rename tests/regression/smoke_*.pyscripts/smoke/*.py. Keep tests/ for pytest-collectable tests only. If you want them as regression gates, wrap each in a test_* function with assertions and mark them @pytest.mark.slow / @pytest.mark.gpu.
  • Consolidate the three install scripts into one install_cuda_kernels.sh with a --cluster {skynet,pace} flag or auto-detect. Reconcile the causal_conv1d pin between build_cuda_exts.sh and the installer scripts.
  • Delete the duplicated load_algo_from_ckpt in run_drift_eval.py and import from egomimic.eval.core.ckpt_loading.
  • Rename scripts/test_sim_replay.pyscripts/replay_sim_dataset.py to avoid pytest collection.
  • Consider adding a top-level comment in each smoke script noting hardware/dataset assumptions so future operators aren't blocked.

Verdict: Request Changes

The intent (retain useful tooling + smoke coverage of the packed pipeline) is good and doesn't touch training code, but as landed these are unrunnable outside your workstation and don't actually integrate into the test suite. Address the path portability + the tests-vs-scripts distinction and this is a clean merge.


Reviewed by Claude · Review workflow

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