Skip to content

fix(ds4): harden sparse verifier metadata for DCP1 and padded replays - #101

Merged
lukealonso merged 1 commit into
dev/fathomless-firmamentfrom
codex/ff-ds4-sparse-metadata-safety-20260717
Jul 17, 2026
Merged

fix(ds4): harden sparse verifier metadata for DCP1 and padded replays#101
lukealonso merged 1 commit into
dev/fathomless-firmamentfrom
codex/ff-ds4-sparse-metadata-safety-20260717

Conversation

@voipmonitor

Copy link
Copy Markdown

Problem

Two metadata edge cases could feed invalid sparse-attention state into DS4 verification:

  1. DCP=1 reconstructed causal lengths from padded capacity instead of exact GPU positions.
  2. Padded CUDA-graph rows reused a live request slot, so stale request metadata could affect global top-k/cache indexing.

Both are correctness risks under long-context or capacity-padded replays and were previously mixed into the large #88 stack.

Fix

  • Preserve and consume exact GPU causal lengths for the DCP1 path.
  • Reserve a dedicated safe padding request slot and ensure stale padding indices cannot enter global top-k selection.
  • Keep TP/DCP metadata construction deterministic across replay shapes.

Validation

  • test_global_topk_ignores_stale_padding_request_index
  • DCP variant of the stale-padding test
  • exact GPU-position/causal-length test
  • Result: 3 passed on SM120
  • ruff check, ruff format --check, and git diff --check

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@voipmonitor, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cedf21e4-4189-4439-ad1f-7d75b2ef776e

📥 Commits

Reviewing files that changed from the base of the PR and between e4879e1 and 458a946.

📒 Files selected for processing (4)
  • tests/models/deepseek_v4/test_cache_utils.py
  • tests/v1/attention/test_sparse_mla_backends.py
  • vllm/models/deepseek_v4/common/ops/cache_utils.py
  • vllm/v1/attention/backends/mla/b12x_mla_sparse.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ff-ds4-sparse-metadata-safety-20260717

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants