jose-compu / jose-compu/funes.cpp

[Memory] Add comprehensive tests for llama_memory_recurrent state operations

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
C++
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Summary
The recurrent memory implementation (`src/llama-memory-recurrent.cpp`) needs comprehensive tests for state operations.

## Current State
- `llama_memory_recurrent` implements the `llama_memory_i` interface for RNN-based models (Mamba, etc.)
- Has state write/read methods but limited test coverage

## Missing Test Coverage
1. **State Write/Read roundtrip**: Verify `state_write()` followed by `state_read()` preserves cell data
2. **Partial sequence operations**: Test `seq_rm`, `seq_cp`, `seq_keep` with various position ranges
3. **Cell metadata**: Verify `pos`, `src`, `src0`, `tail` fields are correctly persisted
4. **Multi-sequence handling**: Test with `n_seq_max > 1`

## Acceptance Criteria
- [ ] Add test file `tests/test-memory-recurrent.cpp`
- [ ] Achieve >80% coverage of `llama-memory-recurrent.cpp`
- [ ] Test both successful operations and error paths

## Related Files
- `src/llama-memory-recurrent.h`
- `src/llama-memory-recurrent.cpp`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.