PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pineforge::detail Namespace Reference

Namespaces

namespace  journal_codec
 
namespace  o1
 
namespace  scratch_impl
 
namespace  scratch_layout_detail
 
namespace  script_array
 

Data Structures

class  AuxiliaryScratchIoError
 
struct  BoundDrawingState
 
class  BrokerStateByteFold
 
class  CommandScratchStore
 
class  DiskIdTable
 
class  DiskResidentIdTable
 
struct  drawing_record_traits
 
struct  drawing_record_traits< BoxRec >
 
struct  drawing_record_traits< LabelRec >
 
struct  drawing_record_traits< LinefillRec >
 
struct  drawing_record_traits< LineRec >
 
struct  DrawingBuiltinAccess
 
class  DrawingRecordStore
 
struct  DrawingStaleSink
 
struct  DrawingStaleSink< Rec, true >
 
class  FeedProjection
 
class  FeedProjectionBuilder
 
struct  FeedProjectionStats
 
class  FixedMemoryScratchBacking
 
class  IdPairFoldFile
 
class  IdPairOrderedFold
 
class  IdPairScratchFile
 
class  IdPairSlabFold
 
class  IdPairStore
 
class  IdPairStoreError
 
class  IdTableReadCache
 
struct  Layout
 
struct  MapBarContext
 
class  MapBarContextScope
 
struct  MapExternalCodec
 
struct  MapExternalCodec< ScriptString >
 
struct  MapHeader
 
struct  MapImage
 
struct  MapLinks
 
class  MapPairLimitScope
 
struct  MapReadCache
 
class  MapSequence
 
struct  MapStoreHolder
 
class  MapStoreScope
 
struct  MapStringRep
 
struct  OwnedAllocation
 
struct  OwnedAllocationLedger
 
class  PayloadBytes
 A logical slice, stable across cache eviction and nested reads. More...
 
class  PayloadChunkBytes
 Paged text emitted from a same-store source. More...
 
struct  PayloadField
 
class  PayloadReadback
 All reads borrow store/version; no owning row or text reconstruction. More...
 
struct  PineMapKeyEqual
 
struct  PineMapKeyEqual< Key, true >
 
struct  PineMapKeyHash
 
struct  PineMapKeyHash< Key, true >
 
struct  QuotaAmounts
 
struct  QuotaMessage
 
struct  QuotaObject
 
struct  QuotaSnapshot
 
class  QuotaTicket
 
class  ReadThroughCache
 
struct  ReadThroughCacheAllocator
 
struct  ReadThroughCacheBacking
 
struct  ReadThroughCacheIoResult
 
struct  ReadThroughCacheKey
 
struct  ReadThroughCachePolicy
 
struct  ReadThroughCacheStats
 
struct  ReadThroughCacheTransactionOrder
 
struct  Region
 
struct  RegionLayout
 
class  ReportScratchIoError
 
class  ResidentFeedReader
 
class  RunQuota
 
class  ScratchArena
 
struct  ScratchArenaStats
 
class  ScratchBacking
 
struct  ScratchBuffer
 
struct  ScratchBytes
 
class  ScratchByteSource
 
class  ScratchCapacityError
 
struct  ScratchChunkView
 
class  ScratchFeedReader
 
class  ScratchFile
 
class  ScratchFileQuota
 
struct  ScratchIoCharge
 
struct  ScratchIoObserver
 
struct  ScratchKeyOrder
 
struct  ScratchManifest
 
class  ScratchReadback
 
struct  ScratchRecordInfo
 
struct  ScratchRecordView
 
class  ScratchSequence
 
class  ScratchSlab
 
class  ScratchSpanSource
 
struct  ScratchStoreConfig
 
struct  ScratchStoreStats
 
struct  ScratchTableConfig
 
struct  SessionClockSwitches
 
class  WindowValues
 

Typedefs

using QuotaWire = std::array<unsigned char, kRunQuotaWireSize>
 
using ScratchPageId = std::uint64_t
 
using ScratchIoError = ReportScratchIoError
 
using ScratchHandle = std::uint64_t
 
using ScratchRecordVisitor = bool (*)(void*, const ScratchRecordView&) noexcept
 
using ScratchChunkVisitor = bool (*)(void*, const ScratchChunkView&) noexcept
 
template<typename T>
using PineMapBare = std::remove_cv_t<std::remove_reference_t<T>>
 
template<typename T>
using MapRepOf
 

Enumerations

enum class  ReadThroughCacheReplacement : std::uint32_t {
  direct_mapped ,
  clock ,
  lru
}
 
enum class  ReadThroughCacheWritePolicy : std::uint32_t {
  write_through ,
  write_back
}
 
enum class  QuotaMode {
  unmanaged ,
  managed
}
 
enum class  QuotaOpcode : std::uint16_t {
  hello = 1 ,
  reserve ,
  commit ,
  cancel ,
  release ,
  snapshot ,
  finish
}
 
enum class  QuotaStage : std::uint64_t {
  admission = 1 ,
  transpile ,
  compile ,
  execution ,
  assembly ,
  finalizer ,
  converter ,
  publication
}
 
enum class  QuotaArtifact : std::uint64_t {
  workdir = 1 ,
  compiler ,
  table ,
  ledger ,
  arena ,
  curve ,
  sink ,
  spool ,
  column_index ,
  column_data ,
  json ,
  stdout_stream ,
  conversion ,
  diagnostic
}
 
enum class  QuotaRole : std::uint64_t {
  host = 1 ,
  compiler ,
  worker ,
  finalizer ,
  converter ,
  reaper
}
 
enum class  QuotaResource : std::uint64_t {
  scratch_bytes = 1 ,
  scratch_files ,
  output_bytes ,
  descriptors
}
 
enum class  QuotaSetting : std::uint64_t {
  scratch_bytes = 1 ,
  scratch_files ,
  output_bytes ,
  descriptors ,
  compiler ,
  facts ,
  workdir ,
  channel ,
  profile ,
  protocol
}
 
enum class  QuotaStatus : std::uint64_t {
  ok = 0 ,
  resource_exceeded ,
  descriptors_exceeded ,
  missing_limit ,
  malformed_limit ,
  counter_overflow ,
  protocol ,
  containment_unavailable ,
  unmanaged_path ,
  unknown_bound ,
  unsupported_route
}
 
enum class  QuotaSlot : std::size_t {
  nonce_hi ,
  nonce_lo ,
  object ,
  generation ,
  ticket ,
  stage ,
  artifact ,
  role ,
  resource ,
  old_extent ,
  new_extent ,
  delta_disk ,
  delta_files ,
  delta_output ,
  delta_fds ,
  status ,
  used ,
  requested ,
  limit ,
  peak ,
  committed ,
  reserved ,
  soft_nofile ,
  pid ,
  tid ,
  device ,
  inode ,
  zero0 ,
  zero1 ,
  zero2
}
 
enum class  ScratchStore : std::uint8_t {
  unknown ,
  curve ,
  position_tail ,
  cohort ,
  exit_rank ,
  sequence_index ,
  sequence_index_idx ,
  erased_minima ,
  erased_minima_idx ,
  partial_cycles ,
  partial_cycles_idx ,
  successor_roots ,
  command
}
 
enum class  ScratchArenaBackend : std::uint8_t {
  sealed_memfd ,
  regular_file
}
 
enum class  ScratchStatus : std::uint32_t {
  ok = 0 ,
  end ,
  cancelled ,
  not_found ,
  programming_error ,
  io_error ,
  corrupt
}
 
enum class  ScratchBackingKind : std::uint32_t {
  disk ,
  memfd ,
  tmpfs ,
  test_memory
}
 
enum class  ScratchDurability : std::uint32_t {
  buffered ,
  data ,
  full
}
 
enum class  ScratchIoOperation : std::uint32_t {
  read_page ,
  write_page ,
  sync
}
 
enum class  ScratchResource : std::uint32_t {
  layout = 0 ,
  sequence_data ,
  sequence_index ,
  erased_data ,
  erased_index ,
  consumed_data ,
  consumed_index ,
  cohort ,
  exit_rank ,
  successor_roots ,
  cohort_ids_total ,
  cohort_orders_live
}
 
enum class  ScratchField : std::uint32_t {
  key ,
  value
}
 
enum class  ScratchOpenMode : std::uint32_t {
  create_empty ,
  reopen
}
 
enum class  ScratchTableBackend : std::uint32_t {
  disk_scratch = 0 ,
  bounded_memory = 1
}
 
enum class  PayloadType : std::uint64_t {
  unsigned_integer ,
  signed_integer ,
  real ,
  boolean ,
  text ,
  object_begin ,
  object_end
}
 
enum class  PayloadSchema : std::uint64_t {
  request = 1 ,
  placement = 2 ,
  pending = 3
}
 

Functions

template<class Container>
void release_empty_exposure_capacity (Container &container)
 
template<class Container>
void clear_exposure_storage (Container &container)
 
bool operator== (ReadThroughCacheKey a, ReadThroughCacheKey b) noexcept
 
bool operator!= (ReadThroughCacheKey a, ReadThroughCacheKey b) noexcept
 
QuotaMode mode () noexcept
 
const char * quota_line () noexcept
 
const char * last_admission_diagnostic () noexcept
 
QuotaWire encode_quota_message (const QuotaMessage &)
 
QuotaMessage decode_quota_message (const unsigned char *, std::size_t)
 
RunFailureValue run_quota_failure () noexcept
 
std::uint64_t quota_rounded_extent (std::uint64_t extent, std::uint64_t block_size)
 
const ReportScratchIoError & scratch_out_of_memory_failure () noexcept
 
void rethrow_carried_scratch_failure (const ReportScratchIoError *failure)
 
ScratchManifest default_scratch_manifest (std::uint64_t bars)
 
ScratchManifest default_scratch_manifest ()
 
const char * scratch_memory_filesystem_name (std::uint64_t type) noexcept
 
bool scratch_filesystem_is_memory (std::uint64_t type) noexcept
 
std::string scratch_create_message (const char *operation, const std::string &directory, const std::string &selection_note)
 
std::string scratch_failure_detail (const char *what, int errno_value)
 
std::string scratch_with_detail (const char *prefix, const char *what, int errno_value)
 
int scratch_directory_filesystem_type (const char *path, std::uint64_t &type) noexcept
 
template<class Probe>
std::string resolve_scratch_directory (const std::string &configured, std::string &refusal, int &error, bool &proven_memory, Probe probe)
 
std::string resolve_scratch_directory (const std::string &configured, std::string &refusal, int &error, bool &proven_memory)
 
std::string resolve_scratch_directory (const std::string &configured, std::string &refusal, int &error)
 
const char * scratch_resource_name (ScratchResource resource) noexcept
 
std::string scratch_limit_number (std::uint64_t limit)
 
std::string scratch_limit_message (const char *prefix, std::uint64_t limit, const char *suffix)
 
std::string scratch_count_limit_message (ScratchResource resource, std::uint64_t limit)
 
std::string scratch_byte_limit_message (ScratchResource resource, std::uint64_t limit)
 
std::string scratch_resident_cohort_limit_message (std::uint64_t limit)
 
std::string scratch_object_limit_message (std::uint64_t limit, std::uint64_t live, std::uint64_t cap)
 
void raise_scratch_io_error (int error, const char *operation)
 
Layout compute_layout (const ScratchManifest &manifest)
 
std::unique_ptr< ScratchBacking > make_script_scratch_backing ()
 
template<class Rec>
constexpr DrawingKind drawing_kind_of () noexcept
 
template<class Rec>
Rec drawing_missing_value () noexcept
 
template<class Rec>
const Rec & drawing_missing_record () noexcept
 
template<class Rec>
constexpr const char * drawing_object_name () noexcept
 
void drawing_na_error (const char *object, const char *what)
 
void drawing_argument_error (const char *function, const char *argument, const char *rule, const char *what)
 
template<class Rec>
constexpr const char * drawing_count_field () noexcept
 
void drawing_id_exhausted_error (const char *object)
 
template<class Rec>
DrawingBoundConfig drawing_bound_from_declared_count (std::int32_t declared_count=50, std::uint32_t pending_creation_slots=1)
 
DrawingBoundConfig drawing_bound_from_linefill_sample (std::int32_t sampled_bound=kDrawingLinefillObservedBound, std::uint32_t pending_creation_slots=1)
 
template<class Handle, class Rec>
Handle drawing_builtin_allocate (DrawingArena< Rec > &arena, Rec &&record)
 
template<class Base>
void matrix_call_error (const char *function, const char *reason, const char *what)
 
template<class Base>
void matrix_limit_error (const char *what)
 
void matrix_na_error (const char *what)
 
void matrix_snapshot_error (const char *what)
 
template<typename Row>
void erase_row (std::vector< Row > &data, int idx)
 
template<typename Row>
void erase_col (std::vector< Row > &data, int idx)
 
template<typename Row>
void swap_rows_impl (std::vector< Row > &data, int i, int j)
 
template<typename Row>
void swap_cols_impl (std::vector< Row > &data, int i, int j)
 
template<typename Row>
std::vector< Row > copy_submatrix (const std::vector< Row > &data, int from_row, int to_row, int from_col, int to_col)
 
template<typename Row>
std::vector< Row > transpose_impl (const std::vector< Row > &data, int r, int c, const typename Row::value_type &zero)
 
template<typename Row>
void concat_impl (std::vector< Row > &m, const std::vector< Row > &other, bool horizontal)
 
template<typename Row>
void reshape_impl (std::vector< Row > &data, int new_rows, int new_cols, const typename Row::value_type &zero)
 
template<typename Row>
int elements_count_impl (const std::vector< Row > &data)
 
template<typename Row>
void sort_impl (std::vector< Row > &data, int column, bool ascending)
 
void map_na_error (const char *what)
 
template<class Base>
void map_invariant_error (const char *what)
 
std::shared_ptr< MapStoreHolder > & map_store_slot ()
 
std::shared_ptr< MapStoreHolder > map_current_store ()
 
MapStringRep map_string_encode (o1::Store &store, const std::string &text)
 
std::string map_string_decode (const o1::Store &store, const MapStringRep &rep)
 
bool map_string_equals (const o1::Store &store, const MapStringRep &rep, const std::string &text)
 
template<typename T>
MapRepOf< T > map_encode (o1::Store &store, const T &value)
 
template<typename T>
T map_decode (o1::Store &store, const MapRepOf< T > &rep, const std::shared_ptr< MapStoreHolder > &owner={})
 
template<typename T>
void map_retain (o1::Store &store, const MapRepOf< T > &rep)
 
template<typename T>
void map_release (o1::Store &store, const MapRepOf< T > &rep)
 
std::uint64_t map_pair_limit () noexcept
 
std::uint64_t exchange_map_pair_limit (std::uint64_t maximum) noexcept
 
int set_map_pair_limit_checked (const std::int64_t *maximum, char *error, std::size_t capacity) noexcept
 
void map_capacity_error (std::uint64_t maximum, std::uint64_t current)
 
MapBarContext push_map_bar_context (const int *native_bar) noexcept
 
void restore_map_bar_context (MapBarContext previous) noexcept
 
void payload_encode (std::uint64_t value, std::byte *bytes) noexcept
 
std::uint64_t payload_decode (const std::byte *bytes) noexcept
 
SessionClockSwitches & session_clock_switches () noexcept
 
int64_t symbol_session_time_close (int64_t bar_ms, const std::string &tf, const std::string &session, const std::string &tz, const std::string &chart_tf)
 
void bind_tree_scratch_tables (source::PineExecutionAdapter &, const std::shared_ptr< ScratchSlab > &)
 
void bind_id_pair_scratch_tables (source::PineExecutionAdapter &, const std::shared_ptr< ScratchSlab > &)
 

Variables

constexpr std::size_t kFeedProjectionCacheBytes = 256 * 1024
 
constexpr std::uint64_t kRunQuotaMax = (std::uint64_t{1} << 53) - 1
 
constexpr std::size_t kRunQuotaWireSize = 256
 
constexpr std::uint16_t kRunQuotaVersion = 1
 
constexpr std::uint16_t kRunQuotaReply = 0x8000
 
constexpr char kRunQuotaModeEnv [] = "PF_RUN_QUOTA_MODE"
 
constexpr char kRunQuotaNativeFdEnv [] = "PF_RUN_QUOTA_NATIVE_FD"
 
constexpr char kRunQuotaPythonFdEnv [] = "PF_RUN_QUOTA_PYTHON_FD"
 
constexpr char kRunQuotaEnforcement [] = "cooperative"
 
constexpr char kRunQuotaManagedLine [] = "quota=managed enforcement=cooperative"
 
constexpr char kRunQuotaUnmanagedLine [] = "quota=unmanaged"
 
constexpr ScratchPageId scratch_no_page
 
constexpr std::size_t kMaxResidentCohorts = 4096
 
constexpr ScratchHandle scratch_no_handle = 0
 
constexpr std::size_t kScratchRegionCount = 9
 
constexpr std::uint64_t kScratchPageSize = 4096
 
constexpr std::size_t scratch_min_page_count = 2
 
constexpr std::size_t scratch_min_page_size = 512
 
template<class Rec>
constexpr bool is_builtin_drawing_record_v = drawing_record_traits<Rec>::builtin
 
constexpr std::int64_t kDrawingIdExclusive
 
constexpr std::int32_t kDrawingObservedSlack = 5
 
constexpr std::int32_t kDrawingLinefillObservedBound = 10
 
template<typename T>
constexpr bool is_pine_map_key_v
 
template<typename T>
constexpr bool is_pine_map_snapshot_value_v
 
constexpr const char * kMapStoreTransferError = "map store transfer is short"
 
constexpr const char * kMapSequenceRangeError = "map sequence index out of range"
 
constexpr std::size_t kMapInlineBytes = 24
 
template<typename T>
constexpr bool is_map_string_v = std::is_same_v<PineMapBare<T>, std::string>
 
template<typename T>
constexpr bool is_map_inline_v
 
constexpr std::size_t kMapReadCacheSlots = 8
 
constexpr std::uint64_t kMapNoBucket = ~std::uint64_t{0}
 
constexpr std::uint64_t payload_root_kind = 0x4f31533200000001ULL
 
constexpr std::uint64_t payload_field_kind = 0x4f31533200000002ULL
 

Typedef Documentation

◆ QuotaWire

using pineforge::detail::QuotaWire = std::array<unsigned char, kRunQuotaWireSize>

Definition at line 83 of file run_quota.hpp.

◆ ScratchPageId

using pineforge::detail::ScratchPageId = std::uint64_t

Definition at line 30 of file scratch_backing.hpp.

◆ ScratchIoError

◆ ScratchHandle

using pineforge::detail::ScratchHandle = std::uint64_t

Definition at line 7 of file scratch_readback.hpp.

◆ ScratchRecordVisitor

using pineforge::detail::ScratchRecordVisitor = bool (*)(void*, const ScratchRecordView&) noexcept

Definition at line 67 of file scratch_readback.hpp.

◆ ScratchChunkVisitor

using pineforge::detail::ScratchChunkVisitor = bool (*)(void*, const ScratchChunkView&) noexcept

Definition at line 68 of file scratch_readback.hpp.

◆ PineMapBare

template<typename T>
using pineforge::detail::PineMapBare = std::remove_cv_t<std::remove_reference_t<T>>

Definition at line 33 of file map.hpp.

◆ MapRepOf

template<typename T>
using pineforge::detail::MapRepOf
Initial value:
std::conditional_t<
std::conditional_t<MapExternalCodec<PineMapBare<T>>::enabled,
std::conditional_t<is_map_inline_v<T>, PineMapBare<T>, char>>>
constexpr bool is_map_string_v
Definition map.hpp:229
std::remove_cv_t< std::remove_reference_t< T > > PineMapBare
Definition map.hpp:33

Definition at line 240 of file map.hpp.

Enumeration Type Documentation

◆ ReadThroughCacheReplacement

enum class pineforge::detail::ReadThroughCacheReplacement : std::uint32_t
strong
Enumerator
direct_mapped 
clock 
lru 

Definition at line 23 of file read_through_cache.hpp.

◆ ReadThroughCacheWritePolicy

enum class pineforge::detail::ReadThroughCacheWritePolicy : std::uint32_t
strong
Enumerator
write_through 
write_back 

Definition at line 24 of file read_through_cache.hpp.

◆ QuotaMode

enum class pineforge::detail::QuotaMode
strong
Enumerator
unmanaged 
managed 

Definition at line 26 of file run_quota.hpp.

◆ QuotaOpcode

enum class pineforge::detail::QuotaOpcode : std::uint16_t
strong
Enumerator
hello 
reserve 
commit 
cancel 
release 
snapshot 
finish 

Definition at line 39 of file run_quota.hpp.

◆ QuotaStage

enum class pineforge::detail::QuotaStage : std::uint64_t
strong
Enumerator
admission 
transpile 
compile 
execution 
assembly 
finalizer 
converter 
publication 

Definition at line 42 of file run_quota.hpp.

◆ QuotaArtifact

enum class pineforge::detail::QuotaArtifact : std::uint64_t
strong
Enumerator
workdir 
compiler 
table 
ledger 
arena 
curve 
sink 
spool 
column_index 
column_data 
json 
stdout_stream 
conversion 
diagnostic 

Definition at line 45 of file run_quota.hpp.

◆ QuotaRole

enum class pineforge::detail::QuotaRole : std::uint64_t
strong
Enumerator
host 
compiler 
worker 
finalizer 
converter 
reaper 

Definition at line 49 of file run_quota.hpp.

◆ QuotaResource

enum class pineforge::detail::QuotaResource : std::uint64_t
strong
Enumerator
scratch_bytes 
scratch_files 
output_bytes 
descriptors 

Definition at line 50 of file run_quota.hpp.

◆ QuotaSetting

enum class pineforge::detail::QuotaSetting : std::uint64_t
strong
Enumerator
scratch_bytes 
scratch_files 
output_bytes 
descriptors 
compiler 
facts 
workdir 
channel 
profile 
protocol 

Definition at line 52 of file run_quota.hpp.

◆ QuotaStatus

enum class pineforge::detail::QuotaStatus : std::uint64_t
strong
Enumerator
ok 
resource_exceeded 
descriptors_exceeded 
missing_limit 
malformed_limit 
counter_overflow 
protocol 
containment_unavailable 
unmanaged_path 
unknown_bound 
unsupported_route 

Definition at line 56 of file run_quota.hpp.

◆ QuotaSlot

enum class pineforge::detail::QuotaSlot : std::size_t
strong
Enumerator
nonce_hi 
nonce_lo 
object 
generation 
ticket 
stage 
artifact 
role 
resource 
old_extent 
new_extent 
delta_disk 
delta_files 
delta_output 
delta_fds 
status 
used 
requested 
limit 
peak 
committed 
reserved 
soft_nofile 
pid 
tid 
device 
inode 
zero0 
zero1 
zero2 

Definition at line 61 of file run_quota.hpp.

◆ ScratchStore

enum class pineforge::detail::ScratchStore : std::uint8_t
strong
Enumerator
unknown 
curve 
position_tail 
cohort 
exit_rank 
sequence_index 
sequence_index_idx 
erased_minima 
erased_minima_idx 
partial_cycles 
partial_cycles_idx 
successor_roots 
command 

Definition at line 43 of file scratch_arena.hpp.

◆ ScratchArenaBackend

enum class pineforge::detail::ScratchArenaBackend : std::uint8_t
strong
Enumerator
sealed_memfd 
regular_file 

Definition at line 59 of file scratch_arena.hpp.

◆ ScratchStatus

enum class pineforge::detail::ScratchStatus : std::uint32_t
strong
Enumerator
ok 
end 
cancelled 
not_found 
programming_error 
io_error 
corrupt 

Definition at line 20 of file scratch_backing.hpp.

◆ ScratchBackingKind

enum class pineforge::detail::ScratchBackingKind : std::uint32_t
strong
Enumerator
disk 
memfd 
tmpfs 
test_memory 

Definition at line 46 of file scratch_backing.hpp.

◆ ScratchDurability

enum class pineforge::detail::ScratchDurability : std::uint32_t
strong
Enumerator
buffered 
data 
full 

Definition at line 53 of file scratch_backing.hpp.

◆ ScratchIoOperation

enum class pineforge::detail::ScratchIoOperation : std::uint32_t
strong
Enumerator
read_page 
write_page 
sync 

Definition at line 59 of file scratch_backing.hpp.

◆ ScratchResource

enum class pineforge::detail::ScratchResource : std::uint32_t
strong
Enumerator
layout 
sequence_data 
sequence_index 
erased_data 
erased_index 
consumed_data 
consumed_index 
cohort 
exit_rank 
successor_roots 
cohort_ids_total 
cohort_orders_live 

Definition at line 13 of file scratch_errors.hpp.

◆ ScratchField

enum class pineforge::detail::ScratchField : std::uint32_t
strong
Enumerator
key 
value 

Definition at line 49 of file scratch_readback.hpp.

◆ ScratchOpenMode

enum class pineforge::detail::ScratchOpenMode : std::uint32_t
strong
Enumerator
create_empty 
reopen 

Definition at line 32 of file scratch_store.hpp.

◆ ScratchTableBackend

enum class pineforge::detail::ScratchTableBackend : std::uint32_t
strong
Enumerator
disk_scratch 
bounded_memory 

Definition at line 8 of file scratch_tables.hpp.

◆ PayloadType

enum class pineforge::detail::PayloadType : std::uint64_t
strong
Enumerator
unsigned_integer 
signed_integer 
real 
boolean 
text 
object_begin 
object_end 

Definition at line 17 of file payload_readback.hpp.

◆ PayloadSchema

enum class pineforge::detail::PayloadSchema : std::uint64_t
strong
Enumerator
request 
placement 
pending 

Definition at line 20 of file payload_readback.hpp.

Function Documentation

◆ release_empty_exposure_capacity()

template<class Container>
void pineforge::detail::release_empty_exposure_capacity ( Container & container)
inline

Definition at line 10 of file adapter_exposure_storage.hpp.

◆ clear_exposure_storage()

◆ operator==()

bool pineforge::detail::operator== ( ReadThroughCacheKey a,
ReadThroughCacheKey b )
inlinenoexcept

Definition at line 17 of file read_through_cache.hpp.

◆ operator!=()

bool pineforge::detail::operator!= ( ReadThroughCacheKey a,
ReadThroughCacheKey b )
inlinenoexcept

Definition at line 21 of file read_through_cache.hpp.

◆ mode()

◆ quota_line()

const char * pineforge::detail::quota_line ( )
noexcept

References quota_line().

Referenced by quota_line().

◆ last_admission_diagnostic()

const char * pineforge::detail::last_admission_diagnostic ( )
noexcept

◆ encode_quota_message()

QuotaWire pineforge::detail::encode_quota_message ( const QuotaMessage & )

◆ decode_quota_message()

QuotaMessage pineforge::detail::decode_quota_message ( const unsigned char * ,
std::size_t  )

◆ run_quota_failure()

RunFailureValue pineforge::detail::run_quota_failure ( )
noexcept

◆ quota_rounded_extent()

std::uint64_t pineforge::detail::quota_rounded_extent ( std::uint64_t extent,
std::uint64_t block_size )

◆ scratch_out_of_memory_failure()

const ReportScratchIoError & pineforge::detail::scratch_out_of_memory_failure ( )
noexcept

◆ rethrow_carried_scratch_failure()

◆ default_scratch_manifest() [1/2]

ScratchManifest pineforge::detail::default_scratch_manifest ( std::uint64_t bars)
inline

Definition at line 22 of file scratch_defaults.hpp.

References layout.

◆ default_scratch_manifest() [2/2]

ScratchManifest pineforge::detail::default_scratch_manifest ( )
inline

Definition at line 38 of file scratch_defaults.hpp.

References default_scratch_manifest().

Referenced by default_scratch_manifest().

◆ scratch_memory_filesystem_name()

const char * pineforge::detail::scratch_memory_filesystem_name ( std::uint64_t type)
inlinenoexcept

◆ scratch_filesystem_is_memory()

bool pineforge::detail::scratch_filesystem_is_memory ( std::uint64_t type)
inlinenoexcept

◆ scratch_create_message()

std::string pineforge::detail::scratch_create_message ( const char * operation,
const std::string & directory,
const std::string & selection_note )
inline

Definition at line 34 of file scratch_directory.hpp.

Referenced by pineforge::detail::ScratchFile::open().

◆ scratch_failure_detail()

std::string pineforge::detail::scratch_failure_detail ( const char * what,
int errno_value )
inline

Definition at line 43 of file scratch_directory.hpp.

Referenced by scratch_with_detail().

◆ scratch_with_detail()

std::string pineforge::detail::scratch_with_detail ( const char * prefix,
const char * what,
int errno_value )
inline

Definition at line 59 of file scratch_directory.hpp.

References scratch_failure_detail().

◆ scratch_directory_filesystem_type()

int pineforge::detail::scratch_directory_filesystem_type ( const char * path,
std::uint64_t & type )
inlinenoexcept

Definition at line 65 of file scratch_directory.hpp.

References status.

Referenced by resolve_scratch_directory().

◆ resolve_scratch_directory() [1/3]

template<class Probe>
std::string pineforge::detail::resolve_scratch_directory ( const std::string & configured,
std::string & refusal,
int & error,
bool & proven_memory,
Probe probe )
inline

◆ resolve_scratch_directory() [2/3]

std::string pineforge::detail::resolve_scratch_directory ( const std::string & configured,
std::string & refusal,
int & error,
bool & proven_memory )
inline

◆ resolve_scratch_directory() [3/3]

std::string pineforge::detail::resolve_scratch_directory ( const std::string & configured,
std::string & refusal,
int & error )
inline

Definition at line 195 of file scratch_directory.hpp.

References resolve_scratch_directory().

◆ scratch_resource_name()

◆ scratch_limit_number()

std::string pineforge::detail::scratch_limit_number ( std::uint64_t limit)
inline

Definition at line 47 of file scratch_errors.hpp.

References end, and limit.

Referenced by scratch_limit_message(), and scratch_object_limit_message().

◆ scratch_limit_message()

std::string pineforge::detail::scratch_limit_message ( const char * prefix,
std::uint64_t limit,
const char * suffix )
inline

◆ scratch_count_limit_message()

std::string pineforge::detail::scratch_count_limit_message ( ScratchResource resource,
std::uint64_t limit )
inline

◆ scratch_byte_limit_message()

std::string pineforge::detail::scratch_byte_limit_message ( ScratchResource resource,
std::uint64_t limit )
inline

◆ scratch_resident_cohort_limit_message()

std::string pineforge::detail::scratch_resident_cohort_limit_message ( std::uint64_t limit)
inline

Definition at line 112 of file scratch_errors.hpp.

References limit, and scratch_limit_message().

◆ scratch_object_limit_message()

std::string pineforge::detail::scratch_object_limit_message ( std::uint64_t limit,
std::uint64_t live,
std::uint64_t cap )
inline

Definition at line 118 of file scratch_errors.hpp.

References limit, scratch_limit_message(), and scratch_limit_number().

◆ raise_scratch_io_error()

void pineforge::detail::raise_scratch_io_error ( int error,
const char * operation )
inline

Definition at line 156 of file scratch_errors.hpp.

◆ compute_layout()

◆ make_script_scratch_backing()

std::unique_ptr< ScratchBacking > pineforge::detail::make_script_scratch_backing ( )

◆ drawing_kind_of()

template<class Rec>
DrawingKind pineforge::detail::drawing_kind_of ( )
constexprnoexcept

Definition at line 155 of file drawing.hpp.

References is_builtin_drawing_record_v.

Referenced by pineforge::DrawingArena< Rec >::try_alloc().

◆ drawing_missing_value()

◆ drawing_missing_record()

template<class Rec>
const Rec & pineforge::detail::drawing_missing_record ( )
inlinenoexcept

Definition at line 181 of file drawing.hpp.

References drawing_missing_value().

Referenced by pineforge::detail::DrawingBuiltinAccess::read().

◆ drawing_object_name()

◆ drawing_na_error()

void pineforge::detail::drawing_na_error ( const char * object,
const char * what )
inline

◆ drawing_argument_error()

void pineforge::detail::drawing_argument_error ( const char * function,
const char * argument,
const char * rule,
const char * what )
inline

Definition at line 206 of file drawing.hpp.

References pineforge::pine_invalid_argument.

Referenced by pineforge::pf_line_get_price().

◆ drawing_count_field()

template<class Rec>
const char * pineforge::detail::drawing_count_field ( )
constexprnoexcept

Definition at line 221 of file drawing.hpp.

Referenced by drawing_bound_from_declared_count().

◆ drawing_id_exhausted_error()

void pineforge::detail::drawing_id_exhausted_error ( const char * object)
inline

◆ drawing_bound_from_declared_count()

template<class Rec>
DrawingBoundConfig pineforge::detail::drawing_bound_from_declared_count ( std::int32_t declared_count = 50,
std::uint32_t pending_creation_slots = 1 )
inline

◆ drawing_bound_from_linefill_sample()

DrawingBoundConfig pineforge::detail::drawing_bound_from_linefill_sample ( std::int32_t sampled_bound = kDrawingLinefillObservedBound,
std::uint32_t pending_creation_slots = 1 )
inline

◆ drawing_builtin_allocate()

◆ matrix_call_error()

◆ matrix_limit_error()

template<class Base>
void pineforge::detail::matrix_limit_error ( const char * what)

Definition at line 30 of file generic_matrix.hpp.

References pineforge::pine_runtime_limit.

Referenced by elements_count_impl(), and reshape_impl().

◆ matrix_na_error()

void pineforge::detail::matrix_na_error ( const char * what)
inline

Definition at line 37 of file generic_matrix.hpp.

References pineforge::pine_na_reference.

◆ matrix_snapshot_error()

void pineforge::detail::matrix_snapshot_error ( const char * what)
inline

◆ erase_row()

template<typename Row>
void pineforge::detail::erase_row ( std::vector< Row > & data,
int idx )
inline

◆ erase_col()

template<typename Row>
void pineforge::detail::erase_col ( std::vector< Row > & data,
int idx )
inline

◆ swap_rows_impl()

template<typename Row>
void pineforge::detail::swap_rows_impl ( std::vector< Row > & data,
int i,
int j )
inline

◆ swap_cols_impl()

template<typename Row>
void pineforge::detail::swap_cols_impl ( std::vector< Row > & data,
int i,
int j )
inline

◆ copy_submatrix()

template<typename Row>
std::vector< Row > pineforge::detail::copy_submatrix ( const std::vector< Row > & data,
int from_row,
int to_row,
int from_col,
int to_col )
inline

◆ transpose_impl()

template<typename Row>
std::vector< Row > pineforge::detail::transpose_impl ( const std::vector< Row > & data,
int r,
int c,
const typename Row::value_type & zero )
inline

◆ concat_impl()

template<typename Row>
void pineforge::detail::concat_impl ( std::vector< Row > & m,
const std::vector< Row > & other,
bool horizontal )
inline

◆ reshape_impl()

template<typename Row>
void pineforge::detail::reshape_impl ( std::vector< Row > & data,
int new_rows,
int new_cols,
const typename Row::value_type & zero )
inline

◆ elements_count_impl()

template<typename Row>
int pineforge::detail::elements_count_impl ( const std::vector< Row > & data)
inline

◆ sort_impl()

template<typename Row>
void pineforge::detail::sort_impl ( std::vector< Row > & data,
int column,
bool ascending )
inline

Definition at line 154 of file generic_matrix.hpp.

References data.

Referenced by pineforge::GenericMatrix< T >::sort().

◆ map_na_error()

void pineforge::detail::map_na_error ( const char * what)
inline

Definition at line 38 of file map.hpp.

References pineforge::pine_na_reference.

◆ map_invariant_error()

template<class Base>
void pineforge::detail::map_invariant_error ( const char * what)

◆ map_store_slot()

std::shared_ptr< MapStoreHolder > & pineforge::detail::map_store_slot ( )
inline

◆ map_current_store()

std::shared_ptr< MapStoreHolder > pineforge::detail::map_current_store ( )
inline

Definition at line 155 of file map.hpp.

References map_store_slot().

Referenced by pineforge::PineMap< Key, Value >::new_().

◆ map_string_encode()

MapStringRep pineforge::detail::map_string_encode ( o1::Store & store,
const std::string & text )
inlinenodiscard

◆ map_string_decode()

◆ map_string_equals()

bool pineforge::detail::map_string_equals ( const o1::Store & store,
const MapStringRep & rep,
const std::string & text )
inlinenodiscard

◆ map_encode()

template<typename T>
MapRepOf< T > pineforge::detail::map_encode ( o1::Store & store,
const T & value )
nodiscard

Definition at line 344 of file map.hpp.

References is_map_inline_v, is_map_string_v, map_string_encode(), and value.

◆ map_decode()

template<typename T>
T pineforge::detail::map_decode ( o1::Store & store,
const MapRepOf< T > & rep,
const std::shared_ptr< MapStoreHolder > & owner = {} )
nodiscard

◆ map_retain()

template<typename T>
void pineforge::detail::map_retain ( o1::Store & store,
const MapRepOf< T > & rep )

◆ map_release()

◆ map_pair_limit()

std::uint64_t pineforge::detail::map_pair_limit ( )
noexcept

◆ exchange_map_pair_limit()

std::uint64_t pineforge::detail::exchange_map_pair_limit ( std::uint64_t maximum)
noexcept

◆ set_map_pair_limit_checked()

int pineforge::detail::set_map_pair_limit_checked ( const std::int64_t * maximum,
char * error,
std::size_t capacity )
noexcept

◆ map_capacity_error()

void pineforge::detail::map_capacity_error ( std::uint64_t maximum,
std::uint64_t current )

◆ push_map_bar_context()

MapBarContext pineforge::detail::push_map_bar_context ( const int * native_bar)
noexcept

◆ restore_map_bar_context()

void pineforge::detail::restore_map_bar_context ( MapBarContext previous)
noexcept

◆ payload_encode()

void pineforge::detail::payload_encode ( std::uint64_t value,
std::byte * bytes )
inlinenoexcept

Definition at line 24 of file payload_readback.hpp.

References value.

◆ payload_decode()

std::uint64_t pineforge::detail::payload_decode ( const std::byte * bytes)
inlinenoexcept

Definition at line 27 of file payload_readback.hpp.

References value.

◆ session_clock_switches()

SessionClockSwitches & pineforge::detail::session_clock_switches ( )
noexcept

◆ symbol_session_time_close()

int64_t pineforge::detail::symbol_session_time_close ( int64_t bar_ms,
const std::string & tf,
const std::string & session,
const std::string & tz,
const std::string & chart_tf )

◆ bind_tree_scratch_tables()

◆ bind_id_pair_scratch_tables()

Variable Documentation

◆ kFeedProjectionCacheBytes

std::size_t pineforge::detail::kFeedProjectionCacheBytes = 256 * 1024
inlineconstexpr

◆ kRunQuotaMax

std::uint64_t pineforge::detail::kRunQuotaMax = (std::uint64_t{1} << 53) - 1
inlineconstexpr

Definition at line 14 of file run_quota.hpp.

◆ kRunQuotaWireSize

std::size_t pineforge::detail::kRunQuotaWireSize = 256
inlineconstexpr

Definition at line 15 of file run_quota.hpp.

◆ kRunQuotaVersion

std::uint16_t pineforge::detail::kRunQuotaVersion = 1
inlineconstexpr

Definition at line 16 of file run_quota.hpp.

◆ kRunQuotaReply

std::uint16_t pineforge::detail::kRunQuotaReply = 0x8000
inlineconstexpr

Definition at line 17 of file run_quota.hpp.

◆ kRunQuotaModeEnv

char pineforge::detail::kRunQuotaModeEnv[] = "PF_RUN_QUOTA_MODE"
inlineconstexpr

Definition at line 19 of file run_quota.hpp.

◆ kRunQuotaNativeFdEnv

char pineforge::detail::kRunQuotaNativeFdEnv[] = "PF_RUN_QUOTA_NATIVE_FD"
inlineconstexpr

Definition at line 20 of file run_quota.hpp.

◆ kRunQuotaPythonFdEnv

char pineforge::detail::kRunQuotaPythonFdEnv[] = "PF_RUN_QUOTA_PYTHON_FD"
inlineconstexpr

Definition at line 21 of file run_quota.hpp.

◆ kRunQuotaEnforcement

char pineforge::detail::kRunQuotaEnforcement[] = "cooperative"
inlineconstexpr

Definition at line 22 of file run_quota.hpp.

◆ kRunQuotaManagedLine

char pineforge::detail::kRunQuotaManagedLine[] = "quota=managed enforcement=cooperative"
inlineconstexpr

Definition at line 23 of file run_quota.hpp.

◆ kRunQuotaUnmanagedLine

char pineforge::detail::kRunQuotaUnmanagedLine[] = "quota=unmanaged"
inlineconstexpr

Definition at line 24 of file run_quota.hpp.

◆ scratch_no_page

ScratchPageId pineforge::detail::scratch_no_page
inlineconstexpr
Initial value:
=
std::numeric_limits<ScratchPageId>::max()

Definition at line 31 of file scratch_backing.hpp.

Referenced by pineforge::detail::ScratchBacking::do_sync(), and pineforge::detail::ScratchBacking::sync().

◆ kMaxResidentCohorts

std::size_t pineforge::detail::kMaxResidentCohorts = 4096
inlineconstexpr

◆ scratch_no_handle

◆ kScratchRegionCount

std::size_t pineforge::detail::kScratchRegionCount = 9
inlineconstexpr

Definition at line 18 of file scratch_slab.hpp.

Referenced by pineforge::detail::ScratchSlab::can_extend().

◆ kScratchPageSize

std::uint64_t pineforge::detail::kScratchPageSize = 4096
inlineconstexpr

◆ scratch_min_page_count

std::size_t pineforge::detail::scratch_min_page_count = 2
inlineconstexpr

◆ scratch_min_page_size

std::size_t pineforge::detail::scratch_min_page_size = 512
inlineconstexpr

◆ is_builtin_drawing_record_v

◆ kDrawingIdExclusive

std::int64_t pineforge::detail::kDrawingIdExclusive
inlineconstexpr
Initial value:
=
static_cast<std::int64_t>(std::numeric_limits<std::int32_t>::max())

Definition at line 214 of file drawing.hpp.

Referenced by drawing_id_exhausted_error().

◆ kDrawingObservedSlack

std::int32_t pineforge::detail::kDrawingObservedSlack = 5
inlineconstexpr

Definition at line 571 of file drawing.hpp.

Referenced by drawing_bound_from_declared_count().

◆ kDrawingLinefillObservedBound

std::int32_t pineforge::detail::kDrawingLinefillObservedBound = 10
inlineconstexpr

◆ is_pine_map_key_v

template<typename T>
bool pineforge::detail::is_pine_map_key_v
inlineconstexpr
Initial value:
=
std::is_integral_v<PineMapBare<T>> ||
std::is_floating_point_v<PineMapBare<T>> ||
std::is_enum_v<PineMapBare<T>> ||
std::is_same_v<PineMapBare<T>, std::string> ||
std::is_same_v<PineMapBare<T>, ScriptString>

Definition at line 51 of file map.hpp.

◆ is_pine_map_snapshot_value_v

template<typename T>
bool pineforge::detail::is_pine_map_snapshot_value_v
inlineconstexpr
Initial value:
=
!std::is_reference_v<T> &&
(std::is_arithmetic_v<PineMapBare<T>> ||
std::is_enum_v<PineMapBare<T>> ||
std::is_same_v<PineMapBare<T>, std::string> ||
std::is_same_v<PineMapBare<T>, ScriptString>)

Definition at line 59 of file map.hpp.

◆ kMapStoreTransferError

const char* pineforge::detail::kMapStoreTransferError = "map store transfer is short"
inlineconstexpr

◆ kMapSequenceRangeError

const char* pineforge::detail::kMapSequenceRangeError = "map sequence index out of range"
inlineconstexpr

Definition at line 124 of file map.hpp.

Referenced by pineforge::detail::MapSequence< Elem >::at().

◆ kMapInlineBytes

std::size_t pineforge::detail::kMapInlineBytes = 24
inlineconstexpr

◆ is_map_string_v

template<typename T>
bool pineforge::detail::is_map_string_v = std::is_same_v<PineMapBare<T>, std::string>
inlineconstexpr

Definition at line 229 of file map.hpp.

Referenced by map_encode(), map_release(), and map_retain().

◆ is_map_inline_v

template<typename T>
bool pineforge::detail::is_map_inline_v
inlineconstexpr
Initial value:
=
std::is_trivially_copyable_v<PineMapBare<T>> &&
std::is_default_constructible_v<PineMapBare<T>>

Definition at line 232 of file map.hpp.

Referenced by map_encode().

◆ kMapReadCacheSlots

std::size_t pineforge::detail::kMapReadCacheSlots = 8
inlineconstexpr

Definition at line 250 of file map.hpp.

◆ kMapNoBucket

std::uint64_t pineforge::detail::kMapNoBucket = ~std::uint64_t{0}
inlineconstexpr

Definition at line 422 of file map.hpp.

Referenced by pineforge::PineMap< Key, Value >::remove().

◆ payload_root_kind

std::uint64_t pineforge::detail::payload_root_kind = 0x4f31533200000001ULL
inlineconstexpr

Definition at line 21 of file payload_readback.hpp.

◆ payload_field_kind

std::uint64_t pineforge::detail::payload_field_kind = 0x4f31533200000002ULL
inlineconstexpr

Definition at line 22 of file payload_readback.hpp.