Record CP shared-KV C11-C14 closure evidence

C11-C14 are now tied to explicit remote verification instead of leaving the ledger at the intermediate failure state.  The mixed-version symbol issue is documented as a caller-sync problem, and the stale C14 expectations are recorded as intentional current contracts rather than open regressions.

Constraint: Local pytest in this workspace is blocked by missing optional runtime dependencies such as orjson, so remote g0034 container tests are the authoritative CPU/unit evidence for these files.

Rejected: Reintroduce cp_shared_kv_mla_prefetch_should_trace_tiny_extend | the current callers no longer import it, and adding a dead compatibility helper would hide sync mistakes.

Confidence: high

Scope-risk: narrow

Directive: Keep C13 validation focused on matching caller/runtime sync; do not resurrect stale helper APIs unless an active caller contract requires them.

Tested: Local py_compile for touched runtime/prefetch/caller/test files; remote caller import check printed CALLER_IMPORT_OK; remote exact C14 set passed 6 passed, 3 warnings; remote three-file suite passed 123 passed, 5 warnings.

Not-tested: CUDA/TAI ETE runtime logs were not rerun in this documentation-only commit.

Co-authored-by: OmX <omx@oh-my-codex.dev>
This commit is contained in:
laoyao0822
2026-05-29 06:26:49 +08:00
parent dd69c5970c
commit 4f9bb7ce30

View File

@@ -864,6 +864,24 @@ Tests:
- Remote CUDA benchmark/runtime for the TAI materialize primitive and full ETE
prefill run.
Verified C12 CPU/unit slice:
- Local syntax verification passed for the touched runtime/prefetch/caller/test
files with `python -m py_compile`.
- Local targeted pytest remains blocked by the already-recorded local dependency
gap (`orjson` import via `sglang.srt.utils.common`), so this branch uses the
remote container as the authoritative unit-test environment for these files.
- Remote container `g0034:/mnt/beegfs/cjy/sglang-dev` passed the three-file CPU
suite:
```text
PYTHONPATH=python python -m pytest -q \
test/registered/unit/layers/test_nsa_cp_utils.py \
test/registered/unit/mem_cache/test_cp_shared_kv_layout.py \
test/registered/unit/mem_cache/test_cp_shared_kv_runtime.py
# 123 passed, 5 warnings
```
### C13. Remote source sync can expose mixed-version symbols
Current state:
@@ -898,10 +916,21 @@ Correction:
Tests:
- Import-level check:
`python - <<'PY' ... import cp_shared_kv_mla_prefetch_should_trace_tiny_extend`.
- Import-level check for the matching caller set:
`import sglang.srt.layers.attention.nsa.nsa_indexer` and
`import sglang.srt.layers.attention.nsa_backend`.
- Re-run the three-file remote pytest suite.
Completed C13:
- The stale helper
`cp_shared_kv_mla_prefetch_should_trace_tiny_extend` is intentionally not a
runtime API in the current code. The fix was to sync matching caller files
(`nsa_indexer.py`, `nsa_backend.py`) with the current runtime instead of
reintroducing a dead compatibility helper.
- Remote caller import check prints `CALLER_IMPORT_OK`.
- The same remote three-file unit suite now passes (`123 passed, 5 warnings`).
### C14. Wider remote unit suite still exposes non-page-padding regressions
Current state:
@@ -955,6 +984,36 @@ Tests:
- Re-run the exact failed tests after each fix, then the three-file remote
suite.
Completed C14:
- Updated the stale unit expectations to the intended contracts:
- direct-write fallback logs require
`[CP_SHARED_KV_FALLBACK][direct_write]`;
- MLA/index prefix materialize is recorded on the current stream while async
reduce is recorded on the prefetch stream;
- `wait_attention_window()` remains a deferred historical hook and does not
launch/wait pending reduce work;
- negative
`SGLANG_CP_SHARED_KV_MLA_PREFETCH_MIN_PREFIX_PAGES` values use the dynamic
default `max(cp_size, ceil(default_tokens / page_size))`, so
`cp_size=4,page_size=64` returns `8` with the current 512-token default.
- Remote exact C14 regression set passed:
```text
test_local_out_cache_loc_logs_every_fallback_event
test_mla_prefetch_materializes_on_current_stream_and_reduces_on_prefetch_stream
test_index_prefetch_materializes_on_current_stream_and_reduces_on_prefetch_stream
test_mla_prefetch_attention_window_does_not_launch_pending_reduce
test_index_prefetch_attention_window_defers_pending_event_wait
test_mla_prefetch_min_prefix_pages_uses_cached_token_default_and_can_override
# 6 passed, 3 warnings
```
- Remote three-file suite passed after sync:
```text
123 passed, 5 warnings
```
## Testing requirements
Add targeted tests before implementation: