![]() |
JaffarPlus
High-performance best-first search optimizer for tool-assisted speedruns
|
Abstract strategy for remembering the input path that produced each search state. More...
#include <inputHistory.hpp>
Public Member Functions | |
| virtual | ~InputHistory ()=default |
| Virtual destructor for the strategy interface. | |
| virtual void | reset ()=0 |
| Resets the cursor to the empty path. | |
| virtual void | pushInput (const size_t stepCount, const InputSet::inputIndex_t input)=0 |
Records one applied input at path position stepCount (the runner's current step counter). | |
| virtual void | serializeCold (jaffarCommon::serializer::Base &s) const =0 |
| Writes the compact "cold" path representation (stored in each StateDb slot), excluding the count. | |
| virtual void | deserializeCold (jaffarCommon::deserializer::Base &d)=0 |
| Restores the cursor from a "cold" representation (the count is restored by the runner). | |
| virtual void | serializeFull (jaffarCommon::serializer::Base &s) const =0 |
| Writes the self-contained "full" path representation (for standalone snapshot buffers), excluding the count. | |
| virtual void | deserializeFull (jaffarCommon::deserializer::Base &d, const size_t stepCount)=0 |
| Restores the cursor from a "full" representation. | |
| virtual std::string | toString (const std::map< InputSet::inputIndex_t, std::string > &inputStringMap, const size_t stepCount) const =0 |
| Reconstructs the path as a newline-separated string of input strings (the solution). | |
| virtual size_t | getColdSize () const =0 |
| Size, in bytes, of the cold path representation in a StateDb slot (EXCLUDING the runner's count). | |
| virtual size_t | getFullSize () const =0 |
| Size, in bytes, of the full (self-contained) path representation in a snapshot buffer (EXCLUDING the count). | |
| virtual void | initColdSlot (void *cold) const |
| Prepares a fresh/recycled cold slot (e.g. marks it as holding no trie node). Default: no-op. | |
| virtual void | releaseColdSlot (void *cold, const size_t shard) const |
| Releases any shared resource a freed cold slot was holding (trie GC). | |
| virtual void | captureColdToFull (const void *cold, void *full) const =0 |
| Converts a stored cold path into a self-contained full one (best/worst snapshot). | |
| virtual size_t | getApproxMemoryBytes () const |
| Approximate resident memory of any shared structure (e.g. the trie), in bytes. Default: 0. | |
Abstract strategy for remembering the input path that produced each search state.
Concrete strategies (none / raw bit-packed / shared-prefix trie) implement the per-runner cursor ops and the manager ops on stored cold-slot bytes; see the file header and inputHistoryFactory.hpp.
Definition at line 39 of file inputHistory.hpp.
|
pure virtual |
Converts a stored cold path into a self-contained full one (best/worst snapshot).
Operates on the path only; the runner's count prefix is copied separately by the StateDb.
Implemented in jaffarPlus::InputHistoryNone, jaffarPlus::InputHistoryRaw, and jaffarPlus::InputHistoryTrie.
|
pure virtual |
Restores the cursor from a "cold" representation (the count is restored by the runner).
Implemented in jaffarPlus::InputHistoryNone, jaffarPlus::InputHistoryRaw, and jaffarPlus::InputHistoryTrie.
|
pure virtual |
Restores the cursor from a "full" representation.
stepCount is the runner's already-restored step counter, needed by strategies (the trie) that rebuild their cursor from the path length.
Implemented in jaffarPlus::InputHistoryNone, jaffarPlus::InputHistoryTrie, and jaffarPlus::InputHistoryRaw.
|
inlinevirtual |
Approximate resident memory of any shared structure (e.g. the trie), in bytes. Default: 0.
Reimplemented in jaffarPlus::InputHistoryTrie.
Definition at line 94 of file inputHistory.hpp.
|
pure virtual |
Size, in bytes, of the cold path representation in a StateDb slot (EXCLUDING the runner's count).
Implemented in jaffarPlus::InputHistoryNone, jaffarPlus::InputHistoryRaw, and jaffarPlus::InputHistoryTrie.
|
pure virtual |
Size, in bytes, of the full (self-contained) path representation in a snapshot buffer (EXCLUDING the count).
Implemented in jaffarPlus::InputHistoryNone, jaffarPlus::InputHistoryRaw, and jaffarPlus::InputHistoryTrie.
|
inlinevirtual |
Prepares a fresh/recycled cold slot (e.g. marks it as holding no trie node). Default: no-op.
Reimplemented in jaffarPlus::InputHistoryTrie.
Definition at line 81 of file inputHistory.hpp.
|
pure virtual |
Records one applied input at path position stepCount (the runner's current step counter).
Implemented in jaffarPlus::InputHistoryRaw, jaffarPlus::InputHistoryTrie, and jaffarPlus::InputHistoryNone.
|
inlinevirtual |
Releases any shared resource a freed cold slot was holding (trie GC).
shard is the freeing thread's id, used to recycle into a contention-free per-thread pool. Default: no-op.
Reimplemented in jaffarPlus::InputHistoryTrie.
Definition at line 84 of file inputHistory.hpp.
|
pure virtual |
Resets the cursor to the empty path.
Implemented in jaffarPlus::InputHistoryNone, jaffarPlus::InputHistoryRaw, and jaffarPlus::InputHistoryTrie.
|
pure virtual |
Writes the compact "cold" path representation (stored in each StateDb slot), excluding the count.
Implemented in jaffarPlus::InputHistoryNone, jaffarPlus::InputHistoryRaw, and jaffarPlus::InputHistoryTrie.
|
pure virtual |
Writes the self-contained "full" path representation (for standalone snapshot buffers), excluding the count.
Implemented in jaffarPlus::InputHistoryNone, jaffarPlus::InputHistoryRaw, and jaffarPlus::InputHistoryTrie.
|
pure virtual |
Reconstructs the path as a newline-separated string of input strings (the solution).
stepCount is the runner's step counter, bounding how many recorded steps are rendered.
Implemented in jaffarPlus::InputHistoryNone, jaffarPlus::InputHistoryRaw, and jaffarPlus::InputHistoryTrie.