![]() |
JaffarPlus
High-performance best-first search optimizer for tool-assisted speedruns
|
Stores the full bit-packed input sequence in every state (JaffarPlus's classic behavior): self-contained per state, but the largest per-state footprint. More...
#include <inputHistoryRaw.hpp>
Public Member Functions | |
| InputHistoryRaw (const uint32_t maxInputIndex, const uint32_t maxSize) | |
| Constructs the strategy and sizes the per-state bit-packed buffer. | |
| void | reset () override |
| Resets the cursor to the empty path. | |
| void | pushInput (const size_t stepCount, const InputSet::inputIndex_t input) override |
Records one applied input at path position stepCount (the runner's current step counter). | |
| void | serializeCold (jaffarCommon::serializer::Base &s) const override |
| Writes the compact "cold" path representation (stored in each StateDb slot), excluding the count. | |
| void | deserializeCold (jaffarCommon::deserializer::Base &d) override |
| Restores the cursor from a "cold" representation (the count is restored by the runner). | |
| void | serializeFull (jaffarCommon::serializer::Base &s) const override |
| Writes the self-contained "full" path representation (for standalone snapshot buffers), excluding the count. | |
| void | deserializeFull (jaffarCommon::deserializer::Base &d, const size_t) override |
| Restores the cursor from a "full" representation. | |
| std::string | toString (const std::map< InputSet::inputIndex_t, std::string > &inputStringMap, const size_t stepCount) const override |
| Reconstructs the path as a newline-separated string of input strings (the solution). | |
| size_t | getColdSize () const override |
| Size, in bytes, of the cold path representation in a StateDb slot (EXCLUDING the runner's count). | |
| size_t | getFullSize () const override |
| Size, in bytes, of the full (self-contained) path representation in a snapshot buffer (EXCLUDING the count). | |
| void | captureColdToFull (const void *cold, void *full) const override |
| Converts a stored cold path into a self-contained full one (best/worst snapshot). | |
| 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 size_t | getApproxMemoryBytes () const |
| Approximate resident memory of any shared structure (e.g. the trie), in bytes. Default: 0. | |
Private Member Functions | |
| void | setInput (const size_t step, const InputSet::inputIndex_t input) |
Writes the input index for step into the bit-packed buffer. | |
| InputSet::inputIndex_t | getInput (const size_t step) const |
Reads the input index recorded for step from the bit-packed buffer. | |
Private Attributes | |
| const uint32_t | _maxSize |
| Maximum number of steps recorded. | |
| size_t | _bits = 0 |
| Bits used to encode one input index. | |
| std::vector< uint8_t > | _buffer |
| Bit-packed input sequence. | |
Static Private Attributes | |
| static std::atomic< bool > | _truncationWarned = false |
| Set once after the first over-Max-Size push. | |
Stores the full bit-packed input sequence in every state (JaffarPlus's classic behavior): self-contained per state, but the largest per-state footprint.
Selected with {"Type": "Raw", ...}.
Definition at line 23 of file inputHistoryRaw.hpp.
|
inline |
Constructs the strategy and sizes the per-state bit-packed buffer.
| maxInputIndex | One past the highest input index (sets the per-step bit width). |
| maxSize | Maximum number of steps recorded; longer solutions are truncated. |
Definition at line 29 of file inputHistoryRaw.hpp.
|
inlineoverridevirtual |
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.
Implements jaffarPlus::InputHistory.
Definition at line 66 of file inputHistoryRaw.hpp.
|
inlineoverridevirtual |
Restores the cursor from a "cold" representation (the count is restored by the runner).
Implements jaffarPlus::InputHistory.
Definition at line 47 of file inputHistoryRaw.hpp.
|
inlineoverridevirtual |
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.
Implements jaffarPlus::InputHistory.
Definition at line 49 of file inputHistoryRaw.hpp.
|
inlinevirtualinherited |
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.
|
inlineoverridevirtual |
Size, in bytes, of the cold path representation in a StateDb slot (EXCLUDING the runner's count).
Implements jaffarPlus::InputHistory.
Definition at line 63 of file inputHistoryRaw.hpp.
|
inlineoverridevirtual |
Size, in bytes, of the full (self-contained) path representation in a snapshot buffer (EXCLUDING the count).
Implements jaffarPlus::InputHistory.
Definition at line 64 of file inputHistoryRaw.hpp.
|
inlineprivate |
Reads the input index recorded for step from the bit-packed buffer.
Definition at line 75 of file inputHistoryRaw.hpp.
|
inlinevirtualinherited |
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.
|
inlineoverridevirtual |
Records one applied input at path position stepCount (the runner's current step counter).
Implements jaffarPlus::InputHistory.
Definition at line 38 of file inputHistoryRaw.hpp.
|
inlinevirtualinherited |
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.
|
inlineoverridevirtual |
Resets the cursor to the empty path.
Implements jaffarPlus::InputHistory.
Definition at line 36 of file inputHistoryRaw.hpp.
|
inlineoverridevirtual |
Writes the compact "cold" path representation (stored in each StateDb slot), excluding the count.
Implements jaffarPlus::InputHistory.
Definition at line 46 of file inputHistoryRaw.hpp.
|
inlineoverridevirtual |
Writes the self-contained "full" path representation (for standalone snapshot buffers), excluding the count.
Implements jaffarPlus::InputHistory.
Definition at line 48 of file inputHistoryRaw.hpp.
|
inlineprivate |
Writes the input index for step into the bit-packed buffer.
Definition at line 70 of file inputHistoryRaw.hpp.
|
inlineoverridevirtual |
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.
Implements jaffarPlus::InputHistory.
Definition at line 51 of file inputHistoryRaw.hpp.
|
private |
Bits used to encode one input index.
Definition at line 83 of file inputHistoryRaw.hpp.
|
private |
Bit-packed input sequence.
Definition at line 84 of file inputHistoryRaw.hpp.
|
private |
Maximum number of steps recorded.
Definition at line 82 of file inputHistoryRaw.hpp.
|
inlinestaticprivate |
Set once after the first over-Max-Size push.
Definition at line 85 of file inputHistoryRaw.hpp.