[Test] Organize v2 test layout, fix stale integrations/ references (#513) - #602
[Test] Organize v2 test layout, fix stale integrations/ references (#513)#602spaingnv wants to merge 4 commits into
Conversation
Move apps/interactive_drive/interactive_drive/tests/ to apps/interactive_drive/tests/, matching every other v2 app's layout (tests beside the package, not inside it). Document the v2 test ownership rule in AGENTS.md and CONTRIBUTING.md: engine tests in flashdreams/test_v2/, app tests in apps/<name>/tests/, architecture/adapter tests in integrations_v2/<model>/tests/. Fix stale references to the v1 integrations/ layout, fully removed by NVIDIA#581 but still described as current or mid-migration in AGENTS.md, CONTRIBUTING.md (two spots), flashdreams/test_v2/README.md (test_cli.py moved to apps/t2v/tests/, not deleted), and pyproject.toml's workspace globs. Verified: pytest collection matches before/after the move (84/84, apps/interactive_drive + apps/t2v). Full-repo collection inside tests/run_tests_docker.sh on real GPU hardware: 2350/3188 collected, 0 errors. Actual execution of the moved interactive_drive tests: 21/21 passed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test 197e667 |
| - `flashdreams/flashdreams/recipes/`: built-in reusable recipe code such as WAN, Cosmos, TAEHV, and template wiring. | ||
| - `flashdreams/flashdreams/configs/`, `plugins/`, and `scripts/`: runner registry, plugin discovery, and CLI entry points. | ||
| - `integrations/<name>/`: workspace-member model/plugin packages with their own configs, runners, tests, README files, and `pyproject.toml` entry points. | ||
| - `integrations_v2/<model>/`: v2 architecture + checkpoint wiring (`config.py`, `impl/`), adapters (`apps/<demo>/adapter.py`), tests (`tests/`). Replaces the now-fully-removed v1 `integrations/`. |
There was a problem hiding this comment.
Informing the agent of v1 is unnecessary.
The description of the files are wrong. Example: impl/ is model implementation, not "v2 architecture + checkpoint wiring".
We could simplify the file by just stating: "File structure is located in CONTRIBUTING.md".
Then we can have a ## File Tree Of Flashdreams section that has a basic file-tree with explanation
apps/ # Contains all model-antagonistic demo templates
apps/<app_slug>/<app_slug>/ # Implementation of app & entrypoint
apps/<app_slug>/pyproject.toml # ...
apps/<app_slug>/README.md # Specifies in order: program purpose, controls, example cmd-line use, command-line-options table
flashdreams/ #..
...
| - Tests live next to the thing they validate: engine tests in | ||
| `flashdreams/test_v2/`, app tests in `apps/<name>/tests/`, architecture/adapter | ||
| tests in `integrations_v2/<model>/tests/`. v1 tests remain in | ||
| `flashdreams/tests/` until migrated. Use `pytest` and prefer existing | ||
| fixtures over hand-rolled setup. See |
There was a problem hiding this comment.
This is not a complete explanation of our new file-tree.
| # extractions and don't ship a ``pyproject.toml`` yet. | ||
| "integrations/*", | ||
| # extractions and don't ship a ``pyproject.toml`` yet. The v1 | ||
| # ``integrations/`` layout this replaced has been fully removed (#581). |
There was a problem hiding this comment.
V1 does not need to be referenced.
integrations/ is fully removed, not just replaced — stop narrating its history in AGENTS.md, CONTRIBUTING.md, and pyproject.toml comments. Replace AGENTS.md's partial/inaccurate repo map (impl/ mislabeled as "checkpoint wiring" rather than model implementation) with a pointer to a new CONTRIBUTING.md "File Tree Of Flashdreams" section, so there is one accurate source instead of two partial ones. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Set Paing <spaing@nvidia.com>
|
Addressed all three: dropped every |
|
|
||
| Every pytest test must carry exactly one of `ci_cpu`, `ci_gpu`, or `manual`; `CONTRIBUTING.md` has the exact rules. Use module-level `pytestmark = pytest.mark.ci_cpu` for pure Python/metadata tests. Keep GPU, `libGL`/`cv2`, large-checkpoint, credential, and download-heavy checks out of `ci_cpu`. | ||
|
|
||
| **v2 test ownership** — put a new test next to the thing it validates, not in a mirror of old package names: |
There was a problem hiding this comment.
old package names:
What is an "old package name"? we should not be defining new terms
|
|
||
| | You are testing… | Test lives in… | | ||
| | --- | --- | | ||
| | Engine loop (window, threads, presentation) | `flashdreams/test_v2/` | |
There was a problem hiding this comment.
| | Engine loop (window, threads, presentation) | `flashdreams/test_v2/` | | |
| | Flashdreams Runtime/Protocol (window, threads, presentation) | `flashdreams/test_v2/` | |
| | An app (flags, WASD, physics) | `apps/<name>/tests/` | | ||
| | An architecture or its adapter | `integrations_v2/<model>/tests/` | | ||
|
|
||
| App tests must not need a real checkpoint or neural renderer — a stub network is enough; apps must not import `integrations_v2/<model>/impl/` directly. |
There was a problem hiding this comment.
Wrong location for this, we have a Boundaries section to draw "Boundaries"/depdencies
Additionally, intention on why we have this rule should be clear.
| ## Boundaries | ||
|
|
||
| Keep dependency direction strict: `core` -> `infra` -> recipes/integrations. `core` and `infra` must not import from `integrations/`; expose a generic config slot or override hook instead of adding model-specific branches. Built-in reusable model pieces belong in `flashdreams/flashdreams/recipes/`; standalone plugin packages belong in `integrations/<name>/`. | ||
| Keep dependency direction strict: `core` -> `infra` -> recipes/integrations. `core` and `infra` must not import from `integrations_v2/`; expose a generic config slot or override hook instead of adding model-specific branches. Built-in reusable model pieces belong in `flashdreams/flashdreams/recipes/`; standalone plugin packages belong in `integrations_v2/<name>/`. |
There was a problem hiding this comment.
Lets rename this section Dependencies and fix it so it maps correctly.
* ...
* `apps` depends on...
* `integrations_v2` depends on `apps/` and ...
Due to these rules, tests in `apps/` should not import models/entry-points from `integrations_v2` since this would break the dependency rules we set here.
We likely want CI to validate boundaries as well if we are going to draw them... but this is a seperate task
| ## File Tree Of Flashdreams | ||
|
|
||
| ```text | ||
| apps/<slug>/ # v2 interactive app (Drive, T2V, Cam2V, ...) |
There was a problem hiding this comment.
| apps/<slug>/ # v2 interactive app (Drive, T2V, Cam2V, ...) | |
| apps/<app_slug>/ # apps (Drive, T2V, Cam2V, ...) |
Not all apps are interactive
| README.md | ||
|
|
||
| integrations_v2/<model>/ # v2 model architecture + demo bindings | ||
| config.py # model's pipeline config |
There was a problem hiding this comment.
| config.py # model's pipeline config | |
| config.py # collection of pipeline definitions for a particular `<model>` |
this file can have multiple configs
|
|
||
| integrations_v2/<model>/ # v2 model architecture + demo bindings | ||
| config.py # model's pipeline config | ||
| impl/ # all model-specific implementation |
There was a problem hiding this comment.
| impl/ # all model-specific implementation | |
| impl/ # implementation details of a model |
| integrations_v2/<model>/ # v2 model architecture + demo bindings | ||
| config.py # model's pipeline config | ||
| impl/ # all model-specific implementation | ||
| tests/ # model-level tests (stub net + optional real checkpoint) |
There was a problem hiding this comment.
| tests/ # model-level tests (stub net + optional real checkpoint) | |
| tests/ # validate model implementation |
| config.py # model's pipeline config | ||
| impl/ # all model-specific implementation | ||
| tests/ # model-level tests (stub net + optional real checkpoint) | ||
| apps/<demo>/adapter.py # create_app() -> IApplication, binds model to an app |
There was a problem hiding this comment.
| apps/<demo>/adapter.py # create_app() -> IApplication, binds model to an app | |
| apps/<demo>/adapter.py # contains all entry point definitions (ex: `create_app`) for a particular `<demo>` |
| flashdreams/flashdreams/ # the framework package | ||
| core/ # numerical primitives, checkpoint loading, attention, I/O | ||
| infra/ # framework contracts: configs, pipelines, encoders/decoders, schedulers, runners | ||
| recipes/ # built-in reusable recipe code (WAN, Cosmos, TAEHV, ...) | ||
| api_v2/ # protocols an application implements | ||
| runtime_v2/ # the two-thread loop that runs one | ||
| configs/, plugins/, scripts/ # runner registry, plugin discovery, CLI entry points | ||
|
|
||
| flashdreams/test_v2/ # v2 engine tests (window, run_session, threads) | ||
| flashdreams/tests/ # framework tests not yet migrated to test_v2/ | ||
| tests/ # repo-wide test-runner scripts + meta checks, not package tests | ||
| docs/source/ # Sphinx sources |
- Drop the undefined "old package names" phrase. - Apply suggested table wording (Flashdreams Runtime/Protocol, not "Engine loop") consistently across AGENTS.md and CONTRIBUTING.md. - Rename Boundaries -> Dependencies; state apps/integrations_v2 dependency direction explicitly, with the consequence for app tests spelled out and why. Note CI enforcement as a separate follow-up. - Apply suggested File Tree wording verbatim (impl/, config.py, adapter.py, tests/ descriptions). Verified against the actual tree: config.py holds multiple pipeline definitions (checked omnidreams and wan21), every adapter.py exports create_app, tests/ presence pattern holds, no leftover nested apps/ tests/ anywhere, docs/source/ and the flashdreams/flashdreams/* breakdown are accurate. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Set Paing <spaing@nvidia.com>
|
Addressed all of these — applied your suggested wording throughout, renamed One thing I found while verifying the new dependency rule: |
This should be fixed if we want to enforce rules as presented. |
|
|
||
| ## Repo Map | ||
|
|
||
| - `flashdreams/flashdreams/core/`: reusable numerical primitives, checkpoint loading, distributed helpers, attention, and I/O. Keep it model-agnostic. |
There was a problem hiding this comment.
Why are we referring to "Ignore .claude/worktrees/ when scanning the source tree; those are nested worktree artifacts, not the repo's current source." and not other AI specific hidden directories?
There was a problem hiding this comment.
No good reason. I missed that. It points at .gitignore now instead of naming one tool. Thanks for pointing it out
| - `core` -> `infra` -> `recipes`/`integrations_v2`. `core` and `infra` must not import from `integrations_v2/`; expose a generic config slot or override hook instead of adding model-specific branches. Built-in reusable model pieces belong in `flashdreams/flashdreams/recipes/`; standalone plugin packages belong in `integrations_v2/<name>/`. | ||
| - `apps/<name>/` depends only on `flashdreams` (`core`, `infra`, `api_v2`) — never on `integrations_v2/`. A demo app must run against a stub network; wiring in a real model is the adapter's job, not the app's. | ||
| - `integrations_v2/<model>/` depends on `flashdreams` and on the `apps/<demo>/` it adapts for (via `apps/<demo>/adapter.py`) — never the other way around. |
There was a problem hiding this comment.
We are specifying dependency chains in 3 different ways. Please keep things consistent.
|
|
||
| flashdreams/test_v2/ # Flashdreams Runtime/Protocol tests (window, run_session, threads) | ||
| flashdreams/tests/ # framework tests not yet migrated to test_v2/ | ||
| tests/ # repo-wide test-runner scripts + meta checks, not package tests |
There was a problem hiding this comment.
https://github.com/NVIDIA/flashdreams/pull/602/changes#r3972653616
was not addressed
There was a problem hiding this comment.
Checked against the repo. It's accurate. Also filled in the subpackages that were missing: runtime/, serving/, demo/, accelerated/, quality/, _pytest_plugins/. Sorry, I answered this in a top-level comment last time instead of here, which is why it looked untouched.
… file tree Stop app tests from importing model packages. apps/crazy_robotaxi/tests/ now builds a stub pipeline config from base flashdreams config classes; the tests that genuinely needed OmniDreams internals moved to integrations_v2/omnidreams/tests/test_recipe_configs.py, beside the interactive_drive adapter tests already there. No app test imports a model package now. Nest apps/v2v/ to apps/v2v/v2v/ with a sibling tests/, replacing its package-dir remap with the same auto-discovery every other app uses. It was the last app not matching the documented shape. Fix claims in AGENTS.md that were not true: apps do import integrations_v2 in one live-feature path, and the submodule list omitted runtime_v2, the most-used one. Rename Boundaries to Dependencies and state every direction the same way. Generalize the .claude/worktrees note to gitignored AI-tool directories. Complete the CONTRIBUTING.md file tree with the subpackages it omitted (runtime/, serving/, demo/, accelerated/, quality/, _pytest_plugins/), one entry per line, and note that the five fixture packages do not follow the model shape. Drop remaining references to the deleted v1 integrations/ directory from README.md, docs/README.md, and docs/source/, including a link that 404s and two sentences that only existed to contrast against v1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Set Paing <spaing@nvidia.com>
|
Addressed the rest. |
Closes #513.
What changed
Test layout
apps/interactive_drive/interactive_drive/tests/moved toapps/interactive_drive/tests/, so tests sit beside the package rather thaninside it.
apps/crazy_robotaxi/tests/no longer importsomnidreams. It builds a stubpipeline config from base
flashdreamsconfig classes, and the tests thatgenuinely needed OmniDreams internals moved to
integrations_v2/omnidreams/tests/test_recipe_configs.py, beside theinteractive_driveadapter tests already there.apps/v2v/is nested toapps/v2v/v2v/with a siblingtests/, replacing apackage-dirremap with the same auto-discovery every other app uses. Allseven apps now match one shape.
Documentation
AGENTS.md: the repo map points atCONTRIBUTING.mdinstead of duplicatingit; a table says which of the three test locations a new test belongs in;
Boundariesis renamedDependenciesand every bullet states a direction thesame way.
CONTRIBUTING.md: newFile Tree Of FlashDreamssection covering eachflashdreams/flashdreams/subpackage, with a note that the five fixturepackages do not follow the model-integration shape.
flashdreams/test_v2/README.md:test_cli.pywas not deleted by [Demos] Refactor+Move 6 T2V demos & Underlying integrations to v2 API #558, itmoved to
apps/t2v/tests/test_cli.py. Fixed the reference.Stale
integrations/references. That directory was removed by #581 but wasstill described as current in
AGENTS.md,CONTRIBUTING.md, rootpyproject.toml(a dead workspace glob and exclude),README.md,docs/README.md,docs/source/api/integrations.rst,docs/source/community/faq.rst, anddocs/source/developer_guides/new_integration.rst, which had a link that 404s.Why
Most of the layout was already right after #558. What was missing was the rule
written down. Once it was written, the things contradicting it had to be fixed
too, or it is not a rule.
Not in this PR
test_v2/runtime/grouping. This issue's original text asks for it and[API] Organize test_v2 into runtime/ and t2v/ #569 did exactly that. The review landed on engine tests staying flat under
flashdreams/test_v2/until v2 concludes and then merging intotests/, whichmakes a subfolder now churn that gets undone. I raised this as an open question
in the design comment and nothing came back, so I am recording it here as a
decision rather than a silent drop. Say the word if you would rather have it.
apps/crazy_robotaxi/crazy_robotaxi/live_edit/style_ability.pylazy-importsomnidreams.impl._edit_loraandomnidreams.impl._drift_corrector(lines 247,309, 590, 690). That is app code reaching into a model's private
impl/, andomnidreamsis not in that app'spyproject.tomlat all, so the path onlyresolves because the workspace installs everything. Unpicking it changes a live
feature rather than test layout, so I left it and worded
Dependenciestodescribe the intended direction without claiming the violation is absent.
Happy to fix it here or file it separately.
apps/<slug>/<slug>/. The nesting is what lets[tool.setuptools.packages.find]auto-discover submodules; flattening tradesthat for a hand-maintained package list, for a shorter path and no functional
gain.
skills/*.mdstill describe the removedintegrations/<name>/layout inseveral worked examples. Same bug class as the sweep above, but it is workflow
guidance that needs re-verifying against current conventions rather than a path
rename, so it belongs in its own change.
separate follow-ups per the review.
Validation
pytest apps/ integrations_v2/omnidreams/tests/test_recipe_configs.py -m ci_cpugives 297 passed, 3 skipped. No app test imports a model package, checked
including lazy imports inside function bodies.
ruff checkandruff format --checkclean on the touched files.sphinx-build -Ecompletes with no warnings.