refactor(history): replace HashMap<Index, Agent<D>> with dense AgentStore<D>

AgentStore<D> is a Vec<Option<Agent<D>>>-backed store indexed directly
by Index.0, eliminating per-iteration hashing in the cross-history
forward/backward sweep. Implements Index<Index>/IndexMut<Index> for
ergonomic agent access.

AgentStore is public (so benches/batch.rs can use it). SkillStore
remains pub(crate) since Skill is pub(crate) in batch.rs.

HashMap<Index, _> is now only used for the posteriors() return value
(temporary; will be replaced in T2 with a proper typed return) and
for the add_events_with_prior(priors: HashMap<Index, Player<D>>) API
(also T2 target).

Part of T0 engine redesign.
This commit is contained in:
2026-04-24 07:15:21 +02:00
parent 8f60258dba
commit 49d2b317da
6 changed files with 179 additions and 60 deletions

View File

@@ -18,7 +18,7 @@ mod history;
mod matrix;
mod message;
pub mod player;
pub(crate) mod storage;
pub mod storage;
pub use drift::{ConstantDrift, Drift};
pub use error::InferenceError;