|
20 | 20 | Block selection — entry-pattern based only: |
21 | 21 | VisualGen does NOT have its own `condition.terms.backend`; VG test |
22 | 22 | entries live in `backend: pytorch` and `backend: tensorrt` blocks. |
23 | | -A block "belongs to VG" iff any of its `tests:` entries matches one |
24 | | -of the three stable VG entry path families: |
25 | | - - `unittest/_torch/visual_gen/...` (28 entries) |
26 | | - - `examples/test_visual_gen.py...` (1 entry) |
27 | | - - `visual_gen/test_visual_gen_benchmark.py` (1 entry) |
| 23 | +A block "belongs to VG" iff any of its `tests:` entries lives under a |
| 24 | +dedicated `visual_gen/` test path or is the VisualGen perf-sanity entry. |
28 | 25 |
|
29 | 26 | Outward-facing fallback: |
30 | 27 | Unlike AutoDeploy, VG is imported eagerly (module-level) by non-VG |
31 | 28 | code: `commands/serve.py`, `commands/utils.py`, and |
32 | 29 | `serve/openai_server.py` import `VisualGenArgs` / `ParallelConfig` / |
33 | 30 | `VisualGen` / `VisualGenParams` at top level. A signature change to |
34 | 31 | those symbols can break trtllm-serve startup, which would affect |
35 | | -non-VG tests. The 5 files that define / re-export those symbols are |
36 | | -listed in `_VG_OUTWARD_FILES`; touching any of them forces fallback |
37 | | -even if the rest of the diff is VG-internal. |
| 32 | +non-VG tests. The public API package prefix is listed in |
| 33 | +`_VG_OUTWARD_PREFIXES`; touching any file under it forces fallback even |
| 34 | +if the rest of the diff is VG-internal. |
38 | 35 | """ |
39 | 36 |
|
40 | 37 | from __future__ import annotations |
|
55 | 52 | "tensorrt_llm/visual_gen/", |
56 | 53 | ) |
57 | 54 |
|
58 | | -# Files inside _VG_SRC_PREFIXES that are imported eagerly by non-VG |
59 | | -# code (top-level `from ... import VisualGenArgs / ParallelConfig / |
60 | | -# VisualGen / VisualGenParams`). Touching any of these can break |
61 | | -# trtllm-serve / trtllm-bench startup paths, so the rule defers to |
62 | | -# baseline rather than narrowing. |
63 | | -_VG_OUTWARD_FILES: frozenset[str] = frozenset( |
64 | | - { |
65 | | - "tensorrt_llm/_torch/visual_gen/config.py", |
66 | | - "tensorrt_llm/visual_gen/__init__.py", |
67 | | - "tensorrt_llm/visual_gen/args.py", |
68 | | - "tensorrt_llm/visual_gen/params.py", |
69 | | - "tensorrt_llm/visual_gen/visual_gen.py", |
70 | | - } |
71 | | -) |
| 55 | +# Public VisualGen API package imported eagerly by non-VG code. Touching |
| 56 | +# any non-doc file under this prefix can break trtllm-serve / trtllm-bench |
| 57 | +# startup paths, so the rule defers to baseline rather than narrowing. |
| 58 | +_VG_OUTWARD_PREFIXES: tuple[str, ...] = ("tensorrt_llm/visual_gen/",) |
72 | 59 |
|
73 | | -# Substrings that mark a test entry as VG. Cover all three path |
74 | | -# families that appear in test-db YAMLs (audited 2026-05). |
| 60 | +# Substrings that mark a test entry as VG. VG tests are expected to live |
| 61 | +# under dedicated visual_gen test directories, except the perf-sanity |
| 62 | +# frontend which stays with the shared perf tests. |
75 | 63 | _VG_ENTRY_PATTERNS: tuple[str, ...] = ( |
76 | | - "unittest/_torch/visual_gen/", |
77 | | - "examples/test_visual_gen.py", |
78 | | - "visual_gen/test_visual_gen_benchmark.py", |
| 64 | + "visual_gen/", |
| 65 | + "perf/test_visual_gen_perf_sanity.py", |
79 | 66 | ) |
80 | 67 |
|
81 | 68 |
|
@@ -122,19 +109,19 @@ def apply(self, pr: PRInputs) -> Optional[RuleResult]: |
122 | 109 | if not claimed: |
123 | 110 | return None |
124 | 111 |
|
125 | | - # Outward-facing VG files break the "self-contained subsystem" |
| 112 | + # Outward-facing VG paths break the "self-contained subsystem" |
126 | 113 | # assumption — they are imported eagerly by trtllm-serve / |
127 | 114 | # trtllm-bench. Claim the files (so they don't go unhandled and |
128 | 115 | # silently fallback) but emit scope=None so Selector falls back |
129 | 116 | # to baseline coverage instead of narrowing to VG-only stages. |
130 | | - outward = claimed & _VG_OUTWARD_FILES |
| 117 | + outward = {f for f in claimed if f.startswith(_VG_OUTWARD_PREFIXES)} |
131 | 118 | if outward: |
132 | 119 | return RuleResult( |
133 | 120 | handled_files=claimed, |
134 | 121 | affected_stages=set(), |
135 | 122 | scope=None, |
136 | 123 | reason=( |
137 | | - f"visualgen: {len(outward)} outward-facing VG file(s) " |
| 124 | + f"visualgen: {len(outward)} outward-facing VG path(s) " |
138 | 125 | f"touched ({sorted(outward)[0]}{'...' if len(outward) > 1 else ''}); " |
139 | 126 | "fallback to baseline" |
140 | 127 | ), |
|
0 commit comments