fix(tests): repair the unit-test suite after the Reactive_E2E refactor (#88)#94
Merged
riita10069 merged 2 commits intoJun 28, 2026
Conversation
… WIP foundation) Root-cause fix for the broken shared test infra after the Reactive_E2E refactor: patch the backbone at its new home (model_components.reactive_e2e.Backbone, not the removed auto_e2e.Backbone); always build BEV fusion (concat/cross_attn were removed); default planner_mode='bezier' (GRU removed). Clears the 57 collection ERRORS (fixture no longer crashes). NOT a complete fix: ~73 test failures remain that are NOT mechanical — they need team decisions: (a) the post-refactor AutoE2E.forward RETURN CONTRACT is undefined (docstring says a 3-tuple, code returns 1-2 values); (b) many tests reference FutureState/TemporalMemory which the WG is removing. Those require the new contract to be defined first (see autowarefoundation#88 / 24-06 meeting). Signed-off-by: GABRIELA CORDOVA <100548769@alumnos.uc3m.es>
…ation#88) The autowarefoundation#86 refactor moved Backbone/FeatureFusion/MapEncoder/planner inside Reactive_E2E and made AutoE2E.forward return ONLY the trajectory; it also removed concat/cross_attn view fusion, the GRU planner, fusion_mode, the BEV FutureState output and the per-planner compute_planner_loss. The tests still asserted the old API, breaking CI. Tests adapted to the new contract: - AutoE2E.forward returns a single trajectory tensor (no (loss, ego_hidden, future) 3-tuple); submodules now live under Reactive_E2E.* — updated every unpacking, attribute path and gradient-group prefix (test_auto_e2e, test_map_encoder, test_history_encoder, test_causal_reasoning, test_integration). - view fusion: concat/cross_attn -> bev (+ view_fusion_kwargs 8x8) in test_feature_fusion / test_view_fusion; FutureState excluded from gradient-coverage checks (instantiated but unused in the reactive forward). - planners: forward returns just the trajectory; removed tests for the deleted compute_planner_loss / trajectory_loss and the GRU planner; default planner is now bezier; training-loss tests reframed as trajectory-MSE backprop checks (test_bezier_planner, test_trajectory_planning). - map fusion cross_attn is still a valid map_fusion_mode and stays covered. - patched model_components.reactive_e2e.Backbone (was auto_e2e.Backbone). Two pre-existing source mypy errors fixed (type-only, no behaviour change): class-level annotations on TrajectoryImitationLoss (loss_fn/temporal_weights) and an Any binding for timm's feature_info in RasterizedMapEncoder. CI green: ruff clean, mypy clean (74 files), pytest 181 passed / 6 deselected (the @integration tier still requires real weights and is run separately). Signed-off-by: GABRIELA CORDOVA <100548769@alumnos.uc3m.es>
This was referenced Jun 25, 2026
Collaborator
|
@gcordova10 I really appreciate your contributions! |
This was referenced Jun 29, 2026
riita10069
added a commit
that referenced
this pull request
Jul 3, 2026
…params/fusion_mode) Was doubly stale: fusion_mode was removed in #94 and camera_params is now gone from forward. Use a PinholeProjection operator (or explicit pseudo), num_views=7 real cameras, and the current keyword forward signature. Signed-off-by: riita10069 <ryota10069.tech5.jizi@gmail.com>
riita10069
added a commit
that referenced
this pull request
Jul 3, 2026
…_modes Was stale from #94 (fusion_mode loop over removed concat/cross_attn, 3-arg forward) and now also from camera_params removal. Use a PinholeProjection operator, pass map_input, num_views=7, and benchmark BEV only. Signed-off-by: riita10069 <ryota10069.tech5.jizi@gmail.com>
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
Closes #88. The #86 refactor (everything moved inside
Reactive_E2E) changed the model's public contract, but the unit tests still asserted the old API, somake testwas red. This PR brings the whole suite back in line with the refactored architecture and fixes two pre-existing source-levelmypyerrors that also kept CI red.No production behaviour changes beyond two type-only annotations — this is a test-and-typing repair.
Root cause (what the refactor changed)
After #86:
AutoE2Eis a thin wrapper aroundself.Reactive_E2E = ReactiveE2E(...); theBackbone,FeatureFusion,MapEncoder/MapBEVFusion,TemporalMemoryandTrajectoryPlannernow live underReactive_E2E.*(so parameter names are prefixedReactive_E2E.).AutoE2E.forward(...)returns onlytrajectory[B, num_timesteps*num_signals], in every mode. The old 3-tuple(loss/trajectory, ego_hidden, future_features)is gone.forward()is inference-only and returns just the trajectory (noego_hidden); the per-plannercompute_planner_losswas removed (the training objective lives in the training loop).bevis registered now (FUSION_REGISTRY == {"bev"});concat/cross_attnare gone. Thefusion_modekwarg was dropped fromAutoE2E/ReactiveE2E(it is hard-wired to"bev"internally);FeatureFusionitself still accepts afusion_modearg.PLANNER_REGISTRY == {flow_matching, bezier}.AutoE2E's defaultplanner_modeisbezier. (Note:ReactiveE2E.__init__still carries a staleplanner_mode="gru"default that would raise if it were ever constructed directly with defaults —AutoE2Ealways passesbezier, so the live path is fine; flagging it as a latent source nit.)future_featuresoutput was removed from the forward path.FutureStateis still constructed insideReactiveE2Ebut is not called byforward, so it produces no output and receives no gradient.The tests were written against all of the above, so they failed en masse (collection-time and assertion-time).
What changed, file by file
Test suite (adapted to the new contract):
conftest.py—_build_model_with_mock_backbonepatchesmodel_components.reactive_e2e.Backbone(wasauto_e2e.Backbone); always BEV at an 8×8 grid;model/full_modelfixtures parametrised on["bev"]only.test_auto_e2e.py—model(...)now returns a singletrajectory; removed theego_hidden/future_featuresshape tests; train-mode calls now return the trajectory (no 3-tuple); gradient/optimizer tests backward through a trajectory MSE and targetReactive_E2E.{Backbone,FeatureFusion,TrajectoryPlanner}, excluding the unusedFutureStateand the alpha-gatedMapEncoder;num_viewsmatrix is BEV-only.test_view_fusion.py— read fused features viamodel.Reactive_E2E.{Backbone,FeatureFusion}; registry/BEV-specific tests unchanged.test_feature_fusion.py—fusion_mode="concat"→"bev"(+view_fusion_kwargs={"bev_h":8,"bev_w":8}).test_map_encoder.py— single-trajectory return; paths viaReactive_E2E.{MapEncoder,MapBEVFusion}; gradient checks now drive a trajectory-MSE backward.cross_attnmap fusion stays covered (it is still a validmap_fusion_mode).test_history_encoder.py— single-trajectory return;Reactive_E2E.TemporalMemory;one_hz/no_memorypaths verified via trajectory backward.test_causal_reasoning.py— asserts the new single-trajectory contract; the (independent)CausalReasoningModuleis exercised on a 256-d embedding since the planner's internal ego embedding is no longer surfaced.test_bezier_planner.py— plannerforwardreturns just the trajectory; removed tests for the deletedcompute_planner_loss/trajectory_loss; default-planner test now asserts bezier (GRU removed); AutoE2E tests patchreactive_e2e.Backboneand useReactive_E2E.TrajectoryPlanner.test_trajectory_planning.py— Flow-Matchingforwardreturns the trajectory; removed thecompute_planner_lossend-to-end / wrong-shape tests andtest_train_mode_requires_target(the forward no longer requires a target); gradient test backprops through the integrated trajectory; AutoE2E-with-FM tests use the single-trajectory contract; "interchangeable planners" now compares bezier vs flow_matching.test_integration.py—TestRealArchitectureSmoke(runs in CI,is_pretrained=False) and the@integrationtier adapted to the single-trajectory contract andReactive_E2E.Backbone.Source (type-only
mypyfixes, no behaviour change):losses/trajectory_loss.py— class-level annotationsloss_fn: nn.Module/temporal_weights: torch.Tensorsomypyresolves them instead ofnn.Module.__getattr__ -> Tensor | Module(which flaggedself.loss_fn(...)as "Tensor not callable").map_encoder/raster_map_encoder.py— bind timm'sfeature_infothroughAnyto iterate it without aunion-attrerror.Tests removed (and why)
Tests for features deleted by #86 were removed rather than left asserting dead behaviour:
concat/cross_attnview fusion, the GRU planner, the plannercompute_planner_loss/trajectory_loss, and theego_hidden/future_featuresreturns. Everything still present (BEV fusion, bezier + flow_matching planners, residual + cross_attn map fusion, temporal memory, the reasoning head) stays covered.Testing
Run exactly as CI does:
The 6 deselected are the
@integrationtier (real pretrained backbones), whichModel/pytest.iniexcludes from the default/CI run via-m "not integration and not e2e_data".Notes
FutureStateis still constructed insideReactiveE2Ebut is not used by itsforward, so it receives no gradient; the gradient-coverage tests exclude it intentionally (flagging in case it should be wired in or dropped).