transformers+vllm: 5-MOAD rescan; transformers-0004 CWE-407 all_special_ids per-loop rebuild in wav2vec2/esm

Rescan both targets against all 5 MOADs (2026-04-03).

New defect:
- transformers-0004: wav2vec2, wav2vec2_phoneme, esm tokenizers call
  self.all_special_ids/@property inside per-token decode loops, rebuilding
  list every iteration. O(T) -> O(1) fix: cache set before loop.
  wav2vec2_phoneme also has type mismatch (str vs list[int]), making
  the check always False, leaking special tokens.
  9/9 unit tests PASS.

Existing defects confirmed still present (not re-filed):
- transformers-0001/0002/0003: unchanged from 2026-03-31 scan.
- vllm-0001/0002: unchanged from 2026-03-31 scan.

MOAD-0002/0003/0004/0005: CLEAN on both targets (see SCAN-2026-04-03.md).

SCAN-TODO.md: marked transformers and vllm as complete with full summary.

Also includes UNDF stamps on jicofo-0001, jicofo-0002, langchain-0002 patches
from prior generate_undf.py run.
This commit is contained in:
russell@unturf.com 2026-04-03 15:32:37 -04:00
parent 09012e7ec1
commit a89cc53fed
8 changed files with 458 additions and 0 deletions

View file

@ -0,0 +1,44 @@
SCAN — vLLM (RESCAN) — all 5 MOADs — 2026-04-03
Repository: https://github.com/vllm-project/vllm
Version: HEAD (depth=1 clone, 2026-04-03)
Previous scan: 2026-03-31 (found vllm-0001..0002)
Language: Python, CUDA/Triton kernels
## MOAD-0001 (CWE-407): NO NEW DEFECTS
Deep scan of hot-path inference code (lora/, v1/scheduler, v1/sample, entrypoints/,
tokenizers/) found no new list membership in loops beyond existing vllm-0001 and vllm-0002.
Candidates reviewed and cleared:
- vllm/v1/attention/backends/tree_attn.py:288: `sorted_tree_choices.index(...)` in triple
nested loop -- computed once at __init__ (setup cost, not per-inference). Severity: LOW,
not a hot-path defect. Not filing a ticket.
- vllm/tokenizers/kimi_audio.py:311: `special_ids = set(...)` built once per decode call
(not per token). CLEAN.
- vllm/tokenizers/mistral.py: already uses `_special_token_ids_set: frozenset`. CLEAN.
- vllm/lora/model_manager.py:308: `lora_index_to_id.index(lora_id)` called once per
LoRA deactivation (not per token). Management path, not hot path.
Previously found (see 2026-03-31 scan):
- vllm-0001: LoRA punica_wrapper lora_index_to_id.index() per token (UNDF-2026-000000874)
- vllm-0002: Grok2Tokenizer dict.values() scan per output token (UNDF-2026-000001175)
## MOAD-0002 (Intertangle): CLEAN
Well-separated subsystems (engine, scheduler, model runner, workers) communicating
through clean SchedulerOutput/ExecuteModelReq interfaces. Module-level dicts
(_REGISTERED_TRACING_BACKENDS, _TOOL_PARSERS_TO_REGISTER, etc.) are plugin registries,
read-only after init.
## MOAD-0003 (Leaked Context): CLEAN
`_current_stream_tls = threading.local()` in vllm/utils/torch_utils.py holds CUDA stream
(GPU device infrastructure), not per-request identity. ContextVar in tensorizer.py is
a serialization flag, not request identity.
## MOAD-0004 (Logged Secret): CLEAN
EXA_API_KEY: only logs "is not set" warning (not our value). VLLM_API_KEY never logged.
MODELSCOPE_API_TOKEN passed to client constructor, not printed. HF tokens not logged.
## MOAD-0005 (Thundering Herd): CLEAN
_CPU_MOE_LAYER_CACHE: keyed by layer id, written once per layer at model init via
weakref.ref. No concurrent race. KV cache allocation runs in single async scheduler loop.