Skip to content

Commit 0ad4c4e

Browse files
committed
refactor(passes): remove --switches flag (raw RT data available via draws)
1 parent a3e9882 commit 0ad4c4e

6 files changed

Lines changed: 1 addition & 312 deletions

File tree

src/rdc/_skills/SKILL.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ rdc events --json | jq '.[] | select(.type == "DrawIndexed")'
6868
```bash
6969
rdc passes # TSV table
7070
rdc passes --json # includes load_ops/store_ops per pass
71-
rdc passes --switches # adds RT_SWITCHES column (TBR optimization)
7271
rdc passes --deps --table # per-pass READS/WRITES/LOAD/STORE
7372
```
7473

src/rdc/_skills/references/commands-quick-ref.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,6 @@ List render passes.
652652
| `--dot` | Graphviz DOT output (requires --deps). | flag | |
653653
| `--graph` | Human-readable graph (requires --deps). | flag | |
654654
| `--table` | Per-pass I/O table (requires --deps). | flag | |
655-
| `--switches` | Show RT switch count per pass (TBR flush risk). | flag | |
656655
| `--no-header` | Omit TSV header | flag | |
657656
| `--jsonl` | JSONL output | flag | |
658657
| `-q, --quiet` | Print primary key column only | flag | |

src/rdc/commands/resources.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,20 +173,13 @@ def resource_cmd(resid: int, use_json: bool) -> None:
173173
default=False,
174174
help="Per-pass I/O table (requires --deps).",
175175
)
176-
@click.option(
177-
"--switches",
178-
is_flag=True,
179-
default=False,
180-
help="Show RT switch count per pass (TBR flush risk).",
181-
)
182176
@list_output_options
183177
def passes_cmd( # noqa: PLR0913
184178
use_json: bool,
185179
deps: bool,
186180
dot: bool,
187181
graph: bool,
188182
table: bool,
189-
switches: bool,
190183
no_header: bool,
191184
use_jsonl: bool,
192185
quiet: bool,
@@ -204,10 +197,7 @@ def passes_cmd( # noqa: PLR0913
204197
_passes_deps(use_json, dot, graph, table)
205198
return
206199

207-
params: dict[str, Any] = {}
208-
if switches:
209-
params["switches"] = True
210-
result = call("passes", params)
200+
result = call("passes", {})
211201
tree: dict[str, Any] = result.get("tree", {})
212202
if use_json:
213203
write_json(tree)
@@ -221,8 +211,6 @@ def passes_cmd( # noqa: PLR0913
221211
sys.stdout.write(str(p.get("name", "")) + "\n")
222212
else:
223213
header = ["NAME", "DRAWS", "DISPATCHES", "TRIANGLES", "BEGIN_EID", "END_EID"]
224-
if switches:
225-
header.append("RT_SWITCHES")
226214
tsv_rows = [
227215
[
228216
p.get("name", "-"),
@@ -232,7 +220,6 @@ def passes_cmd( # noqa: PLR0913
232220
p.get("begin_eid", "-"),
233221
p.get("end_eid", "-"),
234222
]
235-
+ ([p.get("rt_switches", {}).get("count", 0)] if switches else [])
236223
for p in passes
237224
]
238225
write_tsv(tsv_rows, header=header, no_header=no_header)

src/rdc/handlers/query.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,6 @@ def _handle_passes(
200200
actions = state.adapter.get_root_actions()
201201
tree = get_pass_hierarchy(actions, state.structured_file)
202202

203-
if params.get("switches"):
204-
from rdc.services.query_service import _count_rt_switches
205-
206-
for p in tree.get("passes", []):
207-
p["rt_switches"] = _count_rt_switches(actions, p["begin_eid"], p["end_eid"])
208-
209203
return _result_response(request_id, {"tree": tree}), True
210204

211205

src/rdc/services/query_service.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -774,53 +774,6 @@ def _flush() -> None:
774774
return passes
775775

776776

777-
def _count_rt_switches(
778-
actions: list[Any],
779-
begin_eid: int,
780-
end_eid: int,
781-
) -> dict[str, Any]:
782-
"""Count render-target switches within a pass EID range.
783-
784-
Args:
785-
actions: Root action list from ReplayController.
786-
begin_eid: First EID of the pass (inclusive).
787-
end_eid: Last EID of the pass (inclusive).
788-
789-
Returns:
790-
Dict with ``count`` (int) and ``switches`` list of dicts
791-
containing ``eid``, ``from_targets``, and ``to_targets``.
792-
"""
793-
leaf_actions: list[Any] = []
794-
795-
def _collect(nodes: list[Any]) -> None:
796-
for a in nodes:
797-
flags = int(a.flags)
798-
if flags & _DRAW_OR_DISPATCH_OR_CLEAR:
799-
if begin_eid <= a.eventId <= end_eid:
800-
leaf_actions.append(a)
801-
if a.children:
802-
_collect(a.children)
803-
804-
_collect(actions)
805-
leaf_actions.sort(key=lambda a: a.eventId)
806-
807-
switches: list[dict[str, Any]] = []
808-
prev_key: tuple[int, ...] | None = None
809-
for a in leaf_actions:
810-
key = _rt_key(a)
811-
if prev_key is not None and key != prev_key:
812-
switches.append(
813-
{
814-
"eid": a.eventId,
815-
"from_targets": prev_key,
816-
"to_targets": key,
817-
}
818-
)
819-
prev_key = key
820-
821-
return {"count": len(switches), "switches": switches}
822-
823-
824777
def _pass_list_with_fallback(actions: list[Any], sf: Any = None) -> list[dict[str, Any]]:
825778
"""Build pass list, merging explicit passes with gap-filling synthetic passes."""
826779
explicit = _build_pass_list(actions, sf)

tests/unit/test_rt_switches.py

Lines changed: 0 additions & 243 deletions
This file was deleted.

0 commit comments

Comments
 (0)