java-topology/defects/llamacpp/patch
russell@unturf.com 53a4e369b2 llama.cpp + aria2: 2 CWE-407 defects, MOAD 0002-0005 CLEAN
llamacpp-0001: llama-grammar.cpp advance_stack/accept_token stacks_new
  dedup via std::find on vector<vector<ptr>>, O(S^2) per grammar-constrained
  token. Fix: companion std::set<llama_grammar_stack> for O(S log S). ~16x at S=300.

aria2-0001: DHTPeerAnnounceEntry addPeerAddrEntry peerAddrEntries_ vector
  std::find dedup, O(P^2) as DHT peers accumulate per infohash. Fix:
  unordered_map keyed by ip:port for O(P) amortized. ~15x at P=3000.

Both: MOADs 0002-0005 CLEAN per scan markers.
2026-03-31 21:32:53 -04:00
..
llamacpp-CLEAN.md llama.cpp + aria2: 2 CWE-407 defects, MOAD 0002-0005 CLEAN 2026-03-31 21:32:53 -04:00