Skip to content

[https://nvbugs/6104831][test] Add reproducers for KV-cache-block cascade prune assertion#13571

Draft
chienchunhung wants to merge 1 commit intoNVIDIA:mainfrom
chienchunhung:dev/nvbug-6104831-cascade-prune-repro
Draft

[https://nvbugs/6104831][test] Add reproducers for KV-cache-block cascade prune assertion#13571
chienchunhung wants to merge 1 commit intoNVIDIA:mainfrom
chienchunhung:dev/nvbug-6104831-cascade-prune-repro

Conversation

@chienchunhung
Copy link
Copy Markdown
Collaborator

@chienchunhung chienchunhung commented Apr 28, 2026

@coderabbitai summary

Summary

Manifest a bug by introducing 4 new unit tests under RadixBlockTreeTest. These tests deterministically reproduce the templatedTrie.h:249 cascade prune: parent did not find this node as a child assertion observed on the Dynamo 1P1D disagg deployment hang documented in NVBugs 6104831. Tests pass on rc7+ through current main — i.e., they pass because the assertion fires, i.e., errors thrown. Once the underlying fix lands, they must be flipped from EXPECT_THROW to EXPECT_NO_THROW to serve as the regression net.

Root cause (high level)

KVCacheBlock::removeNextBlock calls mLookupNode->clearNode(blockKey) to erase a child entry from the parent's mNextNodes map but does not reset the orphaned child's mPrevNode weak back-pointer. Any subsequent operation that empties the orphaned node and lets cascade-prune run (attachToLookupNode's clearValue, detachFromLookupNode, or freeBlockAndAllDescendants) walks back via mPrevNode to a parent map that no longer contains the entry and fires the assertion. The lone production caller of this pattern is the re-keying block at WindowBlockManager::storeBlocks (kvCacheManager.cpp:2289-2297). The structural defect was introduced by f931f4e9e2 (UnifiedBlockTree refactor, in rc7); rc11 is just when a real workload first hit the trigger sequence.

Tests added (all RadixBlockTreeTest::Regression_NVBugs6104831_*)

  1. DetachOrphanedBlockFiresAssertion — minimal direct repro: orphan via removeNextBlock, then detachFromLookupNode. Isolates the trie-invariant violation.
  2. FreeBlockAndAllDescendantsOnOrphanedSubtree — same root cause via the literal bug-report stack trace (addSequence → … → freeBlockAndAllDescendants).
  3. StoreBlocksRekeyTriggersAssertion — mirrors kvCacheManager.cpp:2289-2297 verbatim: prev->removeNextBlock(oldKey); setBlockKey(newKey); searchRoot->addNextBlock(newKey, block).
  4. StressPrefixOverlappingInsertEvictReuseLoop — workload mirror with shared system prefix + per-request suffixes + periodic freeBlockAndAllDescendants. Asserts the bug fires under workload-like operation order.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@chienchunhung chienchunhung changed the title [https://nvbugs/6104831][test] Add reproducers for KV-cache-block cascade prune assert [https://nvbugs/6104831][test] Add reproducers for KV-cache-block cascade prune assertion Apr 28, 2026
Add unit tests that isolate the KV-cache-block trie invariant violation behind the cascade-prune assertion seen in NVBugs 6104831.

Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
@chienchunhung chienchunhung force-pushed the dev/nvbug-6104831-cascade-prune-repro branch from a58f265 to a873694 Compare April 28, 2026 20:08
chienchunhung added a commit to chienchunhung/TensorRT-LLM that referenced this pull request Apr 30, 2026
…rmanent wedge

Document the multi-signature disaggregated-serving wedge surfaced by the
rc11 deployment. The report covers the 1P1D reproducer harness, the six
labelled failure signatures (sender-side broken-promise after ready,
trie cascade-prune assertion, decode-side bad optional access, gen-side
checkGenTransferStatus blocking on at_least_num=1, receiver-side queued
cancel broken-promise, and the suspected control-path send stall),
their mapping to chained test/fix PR pairs (NVIDIA#13571/NVIDIA#13572 for sig NVIDIA#2,
NVIDIA#13639/NVIDIA#13640 for sig #1), the in-flight fixes for sig NVIDIA#4 and sig NVIDIA#5,
and the relationship to the unrelated companion fixes NVIDIA#12718 and NVIDIA#13119
which are not in rc11. Includes an investigation timeline that explains
why each signature surfaced only after the previous one was fixed, and
a test-coverage analysis of why the existing unit and integration tests
did not catch any of these bugs.

Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Made-with: Cursor
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.

1 participant