Skip to content

drm/asahi: remove the items rustc reports as never used (-96) - #2433

Merged
RyanTheTide merged 1 commit into
mainfrom
deadweight/asahi-rustc-dead
Nov 24, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
deadweight/asahi-rustc-dead

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A fleet-config build of drm/asahi, with every GPU backend on, prints 14 dead_code warnings. Most are methods left behind as the G17/M5 code moved on.

Change

Remove the 11 that nothing uses in any build (net -96 lines):

  • CrashBuffers::Fixed and its match arm (no hw table constructs it)
  • Gpu::submit_m5_work, RenderIds::availability, ComputePool::completed_submissions, Lease::needs_release_observation
  • InitData::publish_work and InitData::m5_policy_telemetry_word
  • the render generation's retire, render_pool_owner, UatPageTable::visit_runs and m5_queue_configurations

Keep three that rustc flags but another build uses:

  • QueueSlot::cancel and Availability::notify_own: the asahi_g17_queue_slot_cancel KUnit test, which is only built with CONFIG_KUNIT=y.
  • g16 board data::select: the asahi-m4 host selftest test-perf.py compiles that file.

Most of the removed items came from the M5 bring-up commits (9b1f778, b311814, 524c575, c75d823, 0668eca, 476cf7f), and Fixed from 9038ef8.

Testing

  • Combined fleet build of all eleven deadweight code branches stacked on 0abc2f3 (DEBUG_INFO off): make Image modules dtbs RC=0, 5,909 modules, modpost reports no undefined symbols, and the only warnings are ones the baseline already had in untouched files.
  • Fleet config, make drivers/gpu/drm/asahi/: RC=0. The dead_code warnings go from 14 to 3 (exactly the kept items), with no new warnings.
  • .modinfo of aurora.o is byte-identical to the baseline.
  • Fleet config plus CONFIG_KUNIT=y (all asahi #[kunit_tests] modules compiled): RC=0.
  • Host tools that slice these files by text (g17-firmware-selection, g17-resource, g17-telemetry-integration, g17-growth tests) don't reference a removed item, and their markers still match.

Still to run

Nothing hardware-side. No removed item was reachable.

With every GPU backend enabled (G15, G16, G18, M5, M3_T8122), rustc
reports 14 dead_code items in the driver. Eleven of them have no user
in any build: CrashBuffers::Fixed (no table constructs it) and its
match arm, Gpu::submit_m5_work, RenderIds::availability,
ComputePool::completed_submissions, Lease::needs_release_observation,
InitData::publish_work, InitData::m5_policy_telemetry_word,
the render generation's retire, render_pool_owner,
UatPageTable::visit_runs and m5_queue_configurations. Remove them.

Three stay because a build outside the fleet config uses them:
QueueSlot::cancel and Availability::notify_own (a KUnit test, built
with CONFIG_KUNIT=y) and g16 board data::select (the asahi-m4 host
selftest compiles that file).

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

No blockers.

I grepped current integration/aurora (drivers/gpu/drm/asahi, tools, rust) for every removed item. None has a user outside its own definition:

  • The only CrashBuffers::Fixed is the match arm removed here.
  • The .retire( calls in queue/render.rs are on memory::Memory, not Generation.
  • No host tool or KUnit test names a removed item.

FixedBuffer keeps its user in FirmwareDataOrFixed. The rewritten doc links (mod.rs:284/369, initdata.rs, runtime.rs:1753) point at items that still exist. The PR merges cleanly. The commit has only a human sign-off.

  1. drm/asahi: g17: M5: drop the unreachable EAGAIN retry of a host-port submission #2437 removes the same Firmware::submit_m5_work (g17/mod.rs:905 on the base; the body calls it Gpu::submit_m5_work) together with the retry in submit_m5_render_pair. The two merge cleanly (checked with git merge-tree). Land drm/asahi: g17: M5: drop the unreachable EAGAIN retry of a host-port submission #2437 first, or drop this hunk here, so that only one PR carries the deletion.
  2. Only host-tests ran on this head; rust-build did not. The local fleet and CONFIG_KUNIT=y builds cover it, but a CI Rust build of the G16/G17/G18 config before merge would show the 3 remaining dead_code warnings.

HW row: none needed (removed items were unreachable; .modinfo unchanged).

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide
RyanTheTide marked this pull request as ready for review November 22, 2026 10:11
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Adversarial pass at f4db4c4: no blockers. Every removed name was checked against the tree, the other open pull requests and our kits, and nothing still uses it.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formal §1–§6 pre-PR review at live head f4db4c48daf11 against live integration/aurora (70a00e583b03): APPROVE.

Verification Summary

  • Scope, correctness & live-tree check: Not superseded and merges cleanly (git merge-tree clean against live integration/aurora 70a00e583b03 and against open #2437 3c53d3e2095c). Independently verified across drivers/, rust/, and tools/ on 70a00e583b03 that all 11 removed items (CrashBuffers::Fixed + match arm, Firmware::submit_m5_work, RenderIds::availability, ComputePool::completed_submissions, Lease::needs_release_observation, InitData::publish_work, InitData::m5_policy_telemetry_word, Generation::retire, Vm::render_pool_owner, UatPageTable::visit_runs, G17Resources::m5_queue_configurations) have zero callers and that the updated doc comments in g17/mod.rs, g17/initdata.rs, and g17/runtime.rs resolve cleanly on the merged tree.
  • §1–§3 (No model gating / production-ready / safety): PASS — unreachable dead-code removal only (-96 lines), no behavioral change.
  • §4 (Clean-room & attribution): PASS — commit f4db4c48daf11 carries human author/committer + human Signed-off-by: only (zero AI trailers); PR body carries Assisted-by:.
  • §5 (Evidence): PASS — full fleet config build (G15/G16/G18/M5/M3_T8122), CONFIG_KUNIT=y build, and byte-identical aurora.o .modinfo documented; no hardware row needed for unreachable dead code.
  • §6 (Naming & live CI): PASS — live CI host-tests is green on f4db4c48daf11 (only workflow triggered for drivers/gpu/drm/asahi/**).
  • Minor non-blocking note: the commit message refers to Gpu::submit_m5_work, whereas the removed method in g17/mod.rs is Firmware::submit_m5_work (also removed cleanly by open #2437).

Assisted-by: LLM (Gemini 4 Neon)

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) needs-hw-row No hardware row at the PR head (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
@github-actions

Copy link
Copy Markdown

Merge readiness at f4db4c48: not ready yet

Check Detail
CI at head ok 1 check passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head no no line with the head SHA f4db4c48, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text adopt when you next edit add a 'Tested:' line; a 'Risk:' line (door and Macs) (guide)

Areas: area:gpu

Updated by pr-readiness on every push, edit and review, and every 30 minutes. Rules: merge policy · labels.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Verdict at f4db4c48daf11ba68bffabcae9271db0f266372b: Merge.

Blockers: None.

Testing: No runtime change. I checked all 11 removed items against the PR parent and current main. No caller references the deleted methods, and neither tree constructs the removed internal enum variant. The target retirement and register submission methods with similar names remain in use and remain in the tree. Exact hosted host-tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) needs-hw-row No hardware row at the PR head (bot) needs-template PR body lacks Tested or Risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants