← Back to Pull requests

test(prims-ts): fix the 1-CTA MLA task-cache host test after #9641 and #9846 #9806

Closed
unknown closed this pull request without merging on Nov 30, 2026 23:44 UTC
View on GitHub
unknown unknown commented on Nov 21, 2026 01:44 UTC
Author

<!-- .github/pull_request_template.md -->

📌 Description

#9641 passes cp_rank=self.cp_rank from the 1-CTA MLA task to runtime_seq_len_kv_from_task_cache (mla_decode/throughput_latency_1cta/tasks.py). test_native_task_cache_refreshes_for_each_work_tile in tests/experimental/test_deepseek_v41_defaults_cpu.py replaces that function with a local stub, visible_length, that takes no cp_rank. All 8 cases therefore fail on main:

TypeError: test_native_task_cache_refreshes_for_each_work_tile.<locals>.visible_length() got an unexpected keyword argument 'cp_rank'

The stub now accepts cp_rank as a keyword and asserts that the task forwards its default rank, 0.

#9846 then added the caches_visible_kv_end property to the same task. The native_task fixture strips every decorator so the task's methods run without CuTe, which turns the property into a bound method that is always true, so get_domain calls cta_visible_kv_end, which the fixture doesn't define. With only the stub fixed, the 8 cases fail on current main with:

NameError: name 'cta_visible_kv_end' is not defined

The fixture now keeps @property when it strips the DSL decorators, and stubs the property's predicate with tile rows that share one K prefix. This is a test-only change.

This PR was prepared with AI assistance (Claude Code) and reviewed by the author.

🔍 Related Issues

  • Fixes #9803.

  • Regressions from #9641 and #9846.

  • Found in the targeted CI run on #9647, where these 8 cases are the only failures (Targeted Unittest (H100)). They fail the same way on main without #9647.
  • 🚀 Pull Request Checklist

    ✅ Pre-commit Checks

  • I have installed pre-commit by running pip install pre-commit (or used your preferred method).

  • I have installed the hooks with pre-commit install.

  • I have run the hooks manually with pre-commit run --all-files and fixed any reported issues.
  • The hooks ran on the changed file and pass.

    🧪 Tests

  • Tests have been added or updated as needed.

  • All tests are passing (unittest, etc.).

  • This PR requires full-scope CI, not targeted tests (expensive; justify below).
  • Suggested CI test targets (optional; paths under tests/, whitespace-separated — a starting
    point for @flashinfer-bot run <targets> / /bot run <targets>, reviewers may adjust): tests/experimental/test_deepseek_v41_defaults_cpu.py

    Validation

    tests/experimental/test_deepseek_v41_defaults_cpu.py is CPU-only. Full file, Python 3.12, on main 4d5a6ce3:

    | | nvidia-cutlass-dsl 4.8.0 | 4.9.0.dev1 |
    |---|---|---|
    | main | 8 failed (TypeError), 124 passed | 8 failed (TypeError), 124 passed |
    | main with only the cp_rank stub | 8 failed (NameError), 124 passed | 8 failed (NameError), 124 passed |
    | This PR | 132 passed | 132 passed |

    tests/experimental/test_deepseek_v41_cache.py also passes on 4.8.0. Merged with #9647, both files pass on both DSL versions (174 passed, 1 skipped).

    Reviewer Notes

    #9647 will be rebased onto this fix once it merges, so its targeted run can include this file again.

    🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Tests
    Updated test coverage for task decorator handling and KV-prefix behavior.
    * Updated a test callback to accept and verify the CPU rank argument.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 455 lines (+341 / -114) across 5 files Reviewer: qsang-nv Review duration: 14280m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.45) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 455 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.366
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #9806"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.5% (MEDIUM) · Higher = larger blast radius
    45.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.7% · Safe to merge
    19.7%