Refactor: L3 SceneTestCase — HostCallable as Python DAG#514
Merged
ChaoWao merged 1 commit intohw-native-sys:mainfrom Apr 10, 2026
Merged
Refactor: L3 SceneTestCase — HostCallable as Python DAG#514ChaoWao merged 1 commit intohw-native-sys:mainfrom
ChaoWao merged 1 commit intohw-native-sys:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for Level 3 (L3) scene tests, enabling orchestration via Python DAG functions. Key additions include the CallableNamespace for dot-access to callables and lifetime management, refactored path resolution and compilation logic to support multiple callables, and updated test runners to handle L3 worker initialization. Feedback addresses a potential name collision in the standalone runner's shared sub_ids dictionary, risks of attribute overwriting in CallableNamespace due to direct dict updates, and a potential IndexError in the keep method when invoked without arguments.
b0eb626 to
8a95a98
Compare
…e + SubCallable Extend SceneTestCase to support L3 distributed tests (multi-chip + SubWorker). L3 CALLABLE mirrors L2 structurally: - orchestration: Python DAG function (vs C++ binary for L2) - callables: list of ChipCallable entries (compiled) + SubCallable entries (registered), distinguished by field presence Key additions: - CallableNamespace: dot-access container for orch functions to access compiled ChipCallables and registered SubCallable IDs by name, with keep() for lifetime management of transient objects past drain() - _compile_chip_callable_from_spec: extracted from compile_chip_callable, reused by both L2 and L3 compilation paths - _run_and_validate_l3: builds CallableNamespace, wraps orch in Task, compares all tensors against golden - conftest.py L3 branch: registers SubCallable entries from CALLABLE, reads device_count/num_sub_workers from case config dict - Rewrites test_l3_dependency.py and test_l3_group.py as SceneTestCase subclasses with module-level orch + sub functions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8a95a98 to
bcce511
Compare
ChaoWao
approved these changes
Apr 10, 2026
ChaoWao
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SceneTestCaseto support L3 distributed tests (multi-chip + SubWorker)CALLABLEstructure mirrors L2:orchestrationis a Python DAG function,callablesis a mixed list of ChipCallable entries (compiled like L2) and SubCallable entries (registered ascallable_id)CallableNamespacefor orch functions to access compiled callables by name with dot-access, withkeep()for lifetime management pastdrain()_compile_chip_callable_from_spechelper reused by both L2 and L3 pathstest_l3_dependency.pyandtest_l3_group.pyasSceneTestCasesubclasses with module-level orch + sub functionsconftest.pyL3 fixture to register SubCallable entries and readdevice_count/num_sub_workersfrom caseconfigdictTest plan
pip install .builds successfullypytest tests/ut -x -q— 149 passedpytest examples/.../test_vector_example.py --platform a2a3sim— PASSEDf[0]=47.0(correct)🤖 Generated with Claude Code