PineForge
unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
report_sequence.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstdint>
4
5
// CR-150 lane o1w-seq (R14--R18). The optional per-bar sequences -- the
6
// broker-state hashes, the runtime trace, the recorded output rows and their
7
// events -- are not part of a report's scalar facts. A full report keeps them
8
// where it always did (the owning arrays in ReportC, or the report sink
9
// stream). The summary retention mode keeps only a fixed ordered witness per
10
// sequence, so a trial's resident memory does not grow with the bar, trace or
11
// event population.
12
//
13
// ReportMode::LegacyArrays is the default and the byte-identical historical
14
// behaviour. ReportMode::SummaryOnly is the placeholder the lane brief names
15
// (the final summary/full flag is owned by lane o1w-contract); in it,
16
// set_optional_report_mode returns 0, the ReportC optional arrays stay null,
17
// the output readers answer empty, and optional_sequence_summary() returns the
18
// fixed witness. A report sink, when installed, still streams the complete
19
// sequence externally in either mode.
20
#define PINEFORGE_HAS_OPTIONAL_REPORT_SEQUENCES_V1 1
21
22
namespace
pineforge
{
23
inline
namespace
engine_script_run_v19 {
24
namespace
report_sequence
{
25
26
enum class
ReportMode
: std::uint8_t {
27
LegacyArrays
= 0,
28
SummaryOnly
= 1,
29
};
30
31
// One sequence's ordered witness: how many records were consumed and a digest
32
// folded over every semantic field in record order. Both are O(1) state. The
33
// witness is maintained by SummaryOnly runs and by every run whose report sink
34
// streams the sequence; a pure LegacyArrays run without a sink keeps the
35
// owning ReportC arrays instead and does not promise a complete witness.
36
struct
SequenceWitness
{
37
std::uint64_t
count
= 0;
38
std::uint64_t
digest
= 0;
39
};
40
41
struct
OptionalSequenceSummary
{
42
SequenceWitness
hashes
;
43
SequenceWitness
traces
;
44
SequenceWitness
rows
;
45
SequenceWitness
events
;
46
};
47
48
}
// namespace report_sequence
49
}
// inline namespace engine_script_run_v19
50
}
// namespace pineforge
pineforge::engine_script_run_v19::report_sequence
Definition
report_sequence.hpp:24
pineforge::engine_script_run_v19::report_sequence::ReportMode
ReportMode
Definition
report_sequence.hpp:26
pineforge::engine_script_run_v19::report_sequence::ReportMode::LegacyArrays
@ LegacyArrays
Definition
report_sequence.hpp:27
pineforge::engine_script_run_v19::report_sequence::ReportMode::SummaryOnly
@ SummaryOnly
Definition
report_sequence.hpp:28
pineforge
Definition
array.hpp:42
pineforge::engine_script_run_v19::report_sequence::OptionalSequenceSummary
Definition
report_sequence.hpp:41
pineforge::engine_script_run_v19::report_sequence::OptionalSequenceSummary::hashes
SequenceWitness hashes
Definition
report_sequence.hpp:42
pineforge::engine_script_run_v19::report_sequence::OptionalSequenceSummary::traces
SequenceWitness traces
Definition
report_sequence.hpp:43
pineforge::engine_script_run_v19::report_sequence::OptionalSequenceSummary::rows
SequenceWitness rows
Definition
report_sequence.hpp:44
pineforge::engine_script_run_v19::report_sequence::OptionalSequenceSummary::events
SequenceWitness events
Definition
report_sequence.hpp:45
pineforge::engine_script_run_v19::report_sequence::SequenceWitness
Definition
report_sequence.hpp:36
pineforge::engine_script_run_v19::report_sequence::SequenceWitness::count
std::uint64_t count
Definition
report_sequence.hpp:37
pineforge::engine_script_run_v19::report_sequence::SequenceWitness::digest
std::uint64_t digest
Definition
report_sequence.hpp:38
include
pineforge
report_sequence.hpp
PineForge unreleased — Apache-2.0 —
github.com/pineforge-4pass/pineforge-engine
—
pineforge.dev