koboldcpp/tests/llama-context
Pascal ab3768cdc2
memory: refuse rollbacks past the snapshots of the last ubatch (#31368)
* memory: refuse rollbacks past the snapshots of the last ubatch

The recurrent memory and the DSV4 cache accepted any rollback up to
n_rs_seq, whether or not the last ubatch wrote that snapshot. Each now
records the deepest rollback its last ubatch guarantees and seq_rm
refuses anything past it:

- recurrent: n - 1 for a ubatch of n <= n_rs_seq + 1 tokens, 0 for a
  longer one, which only guarantees the final state
- DSV4: min(n, n_rs_seq), the snapshots are rebuilt from the state
  before the ubatch

The dead rollback block of the rollback test becomes the assertion it
asked for, and rollback_bound checks the exact bound of each memory
after ubatches of 1, 2, n_rs_seq + 1 and n_rs_seq + 2 tokens.

* tests: address review from ggerganov

Detect architectures with llama_arch_from_string in comp_padding and
arch_reserves_single_seq, as in rollback_bound.
2026-10-30 10:11:58 +02:00
..
cases-kv.cpp memory: refuse rollbacks past the snapshots of the last ubatch (#31368) 2026-10-30 10:11:58 +02:00
cases-rs.cpp memory: refuse rollbacks past the snapshots of the last ubatch (#31368) 2026-10-30 10:11:58 +02:00
test-case.cpp tests : consolidate context state tests into test-llama-context (#30023) 2026-10-13 16:21:55 +03:00
test-case.h tests : consolidate context state tests into test-llama-context (#30023) 2026-10-13 16:21:55 +03:00
test-log.cpp tests : consolidate context state tests into test-llama-context (#30023) 2026-10-13 16:21:55 +03:00
test-log.h tests : consolidate context state tests into test-llama-context (#30023) 2026-10-13 16:21:55 +03:00
test-runner.cpp tests : consolidate context state tests into test-llama-context (#30023) 2026-10-13 16:21:55 +03:00
test-runner.h tests : consolidate context state tests into test-llama-context (#30023) 2026-10-13 16:21:55 +03:00
test-util.cpp memory: refuse rollbacks past the snapshots of the last ubatch (#31368) 2026-10-30 10:11:58 +02:00
test-util.h tests : consolidate context state tests into test-llama-context (#30023) 2026-10-13 16:21:55 +03:00