Skip to content

[misc] Remove unreferenced dead code across the repo - #2083

Open
fv-superagent wants to merge 1 commit into
mainfrom
agent/dead-code-sweep-f8249dba3607
Open

fv-superagent wants to merge 1 commit into
mainfrom
agent/dead-code-sweep-f8249dba3607

Conversation

@fv-superagent

@fv-superagent fv-superagent commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

— fv-superagent · grep said nobody called; deletion approved · run by aryan5v

Problem:
Main carries definitions and imports left behind by refactors that no code, config, docstring or config string references. There is no red lane or issue to link: this is a repo-wide dead-code sweep (the follow-up to the comment sweep), so the failing object is the surface area contributors have to read.

Change:
A stdlib-only AST/reference sweep over every tracked Python file, backed by whole-repo word-boundary checks across .py, .md, .mdx, .yaml, .json, .toml, .sh and C/CUDA sources. It removes 42 unreferenced definitions/classes (for example VisionEncoderInfo, FlashAttnMetadataBuilder, flash_attn_no_pad_v3, _rotate_neox/_rotate_gptj, the MLX benchmark_mlx_* helpers, plus the now-uncalled topk_index_to_map_kernel) and drops 52 unused-import lines. Four zero-reference symbols were kept because their docstrings document external use: set_extension, read_vision_index_header, get_current_fastvideo_args, load_transformer_state_dict_from_safetensors.

fastvideo/dataset/latent_datasets.py and fastvideo/layers/utils.py are fully unreferenced too, but their module pages are frozen entries in docs-site/migration-anchors.json; deleting them would fail docs-site/tests/content.test.mjs with Missing route. They are left in place; dropping them needs a separate change to that frozen contract.

Verification:

  • python3 -c "import ast; ast.parse(open(f).read())" for all 54 changed modules: every file parsed.
  • git grep -w <symbol> for each removed name: 0 remaining references (an independent fresh-context audit repeated this for every name plus substring and dynamic-dispatch patterns).
  • GitHub pre-commit check on 318bfd0: green.
  • Buildkite pr-fastcheck build #2287: fastcheck-passed; microscope Unit, Kernel, DreamVerse App, Encoder, VAE and Transformer lanes all green. MLX smoke checks green.
  • pre-commit and pytest cannot run inside the agent container (no network, read-only pre-commit cache, no torch/pytest); the CI checks above covered both.

Risk:
No behavior change on any reachable path: each removed symbol has zero references, so no caller, registry string, config or doc touched it. No numerical output, public API (fastvideo/__init__.py, CLI) or CI configuration changes. A downstream fork importing these internal helpers directly would have to stop. The diff touches some of the same files as #2082, so a conflict is possible if that lands first.

@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 2 protections blocking · waiting on 👀 reviews and 🤖 CI

Protection Waiting on
🔴 PR merge requirements 👀 reviews and 🤖 CI
🟢 MLX smoke requirements —

🔴 PR merge requirements

Waiting for

  • #approved-reviews-by>=1
  • check-success=full-suite-passed
This rule is failing.
  • #approved-reviews-by>=1
  • check-success=full-suite-passed
  • check-success=fastcheck-passed
  • check-success~=pre-commit
  • title~=(?i)^\[(feat|feature|bugfix|fix|refactor|perf|ci|doc|docs|misc|chore|kernel|new.?model|skill|skills|infra)\]

Show 1 satisfied protection

🟢 MLX smoke requirements

  • check-success=mlx-smoke
  • check-success=mlx-smoke-linux-cpu

@mergify mergify Bot added type: misc Cleanup, config, dependencies scope: inference Inference pipeline, serving, CLI scope: attention Attention backends (VSA, STA, Flash, etc.) scope: kernel CUDA kernels, fastvideo-kernel scope: data Data preprocessing, datasets scope: distributed SP, FSDP, USP, multi-node scope: model Model architecture (DiTs, encoders, VAEs) labels Nov 10, 2026
@fv-superagent
fv-superagent force-pushed the agent/dead-code-sweep-f8249dba3607 branch from eae557d to 98ac7eb Compare November 10, 2026 02:09

This branch has not been deployed

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

Labels

scope: attention Attention backends (VSA, STA, Flash, etc.) scope: data Data preprocessing, datasets scope: distributed SP, FSDP, USP, multi-node scope: inference Inference pipeline, serving, CLI scope: kernel CUDA kernels, fastvideo-kernel scope: model Model architecture (DiTs, encoders, VAEs) type: misc Cleanup, config, dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants