PineForge HPO 1.11.0
Native hyperparameter optimization for PineForge strategies
Loading...
Searching...
No Matches
pineforge_hpo.artifact.ArtifactBuilder Class Reference

Public Member Functions

None __init__ (self, *str|os.PathLike[str] engine_root, str|os.PathLike[str]|None cache_dir=None, str|os.PathLike[str]|None compiler=None, str|os.PathLike[str]|None eigen_include=None, Callable[[Path, int], Mapping[str, Any]]|None plugin_validator=None, Literal["build", "deferred"] plugin_load="build", float lock_timeout_seconds=120.0, float|None compile_timeout_seconds=None, bool wrapper_launched=False)
 
StrategyArtifact build (self, str pine_source, *str filename="<input>")
 
StrategyArtifact build_cpp (self, bytes generated_cpp, *str expected_sha256, Sequence[Mapping[str, Any]] inputs, int|None input_kind_schema, Mapping[str, Any] strategy_params, Mapping[str, Any]|None request_feed_inventory, Sequence[TranspileDiagnostic] diagnostics=(), str filename="<input>")
 
StrategyArtifact validate_built_plugin (self, StrategyArtifact artifact)
 
dict[str, Any] enrich_window_plan (self, StrategyArtifact artifact, *str|os.PathLike[str]|None explicit_path=None)
 

Public Attributes

 engine_root
 
 cache_dir
 
 compiler
 
 eigen_include
 
 plugin_validator
 
 plugin_load
 
 lock_timeout_seconds
 
 compile_timeout_seconds
 
 wrapper_launched
 

Detailed Description

Transpile and compile a Pine strategy once per compatible request identity.

Compilation has no time limit by default. Set ``compile_timeout_seconds`` to
a positive number to limit it; ``None`` means no limit. Artifact lock waits
default to 120 seconds; a lock that never frees is a deadlock to report.
``plugin_load="deferred"`` skips loading the compiled plugin during a build;
call ``validate_built_plugin`` later in the process chosen by the caller.
``wrapper_launched=True`` requires stable codegen >= 1.10.0 and refuses
source-build cache returns that skip transpilation or compilation.

Definition at line 383 of file artifact.py.

Constructor & Destructor Documentation

◆ __init__()

None pineforge_hpo.artifact.ArtifactBuilder.__init__ (   self,
*str | os.PathLike[str]  engine_root,
str | os.PathLike[str] | None   cache_dir = None,
str | os.PathLike[str] | None   compiler = None,
str | os.PathLike[str] | None   eigen_include = None,
Callable[[Path, int], Mapping[str, Any]] | None   plugin_validator = None,
Literal["build", "deferred"]   plugin_load = "build",
float   lock_timeout_seconds = 120.0,
float | None   compile_timeout_seconds = None,
bool   wrapper_launched = False 
)

Definition at line 395 of file artifact.py.

Member Function Documentation

◆ build()

StrategyArtifact pineforge_hpo.artifact.ArtifactBuilder.build (   self,
str  pine_source,
*str   filename = "<input>" 
)

◆ build_cpp()

StrategyArtifact pineforge_hpo.artifact.ArtifactBuilder.build_cpp (   self,
bytes  generated_cpp,
*str  expected_sha256,
Sequence[Mapping[str, Any]]  inputs,
int | None  input_kind_schema,
Mapping[str, Any]  strategy_params,
Mapping[str, Any] | None  request_feed_inventory,
Sequence[TranspileDiagnostic]   diagnostics = (),
str   filename = "<input>" 
)
Compile checked UTF-8 C++ bytes with the caller's emission metadata.

Verify the raw bytes before resolving a compiler or publishing anything.
This entry never transpiles and never returns before a real compile.
Supply metadata from the checked emission; no inventory is inferred.

Definition at line 560 of file artifact.py.

References pineforge_hpo.artifact.ArtifactBuilder.cache_dir, pineforge_hpo.artifact.ArtifactBuilder.lock_timeout_seconds, and pineforge_hpo.artifact.ArtifactBuilder.wrapper_launched.

◆ enrich_window_plan()

dict[str, Any] pineforge_hpo.artifact.ArtifactBuilder.enrich_window_plan (   self,
StrategyArtifact  artifact,
*str | os.PathLike[str] | None   explicit_path = None 
)
Admit a source-cache artifact for selected execution under its request lock.

Ordinary builds do not call this method. An existing block is re-resolved
and verified without changing its expected hash. An interrupted two-file
enrichment leaves selected admission refused until enrichment is re-run.
A retry repairs missing or stale metadata, including a stale request_identity,
from the validating side under the same lock. A validated old cache with a
matching local engine may acquire metadata, never new plugin bytes or keys.
An explicit path also supports the non-derivable third archive layout.
Arbitrary precompiled artifacts cannot acquire an identity here.

Definition at line 885 of file artifact.py.

References pineforge_hpo.artifact.ArtifactBuilder.cache_dir, pineforge_hpo.artifact.ArtifactBuilder.engine_root, and pineforge_hpo.artifact.ArtifactBuilder.lock_timeout_seconds.

◆ validate_built_plugin()

StrategyArtifact pineforge_hpo.artifact.ArtifactBuilder.validate_built_plugin (   self,
StrategyArtifact  artifact 
)
Load and validate a pending source-cache plugin in the calling process.

Call this in a fresh process to separate the first plugin load from
compilation. This method starts no process and needs neither codegen nor
a local engine/compiler installation. It checks the recorded engine ABI
and content hashes under the request lock before publishing success.
Already validated artifacts are checked without loading or rewriting.
The caller supplies process isolation; this method does not install a jail.

Definition at line 770 of file artifact.py.

References pineforge_hpo.artifact.ArtifactBuilder.cache_dir, and pineforge_hpo.artifact.ArtifactBuilder.lock_timeout_seconds.

Member Data Documentation

◆ cache_dir

◆ compile_timeout_seconds

pineforge_hpo.artifact.ArtifactBuilder.compile_timeout_seconds

Definition at line 423 of file artifact.py.

◆ compiler

pineforge_hpo.artifact.ArtifactBuilder.compiler

Definition at line 414 of file artifact.py.

◆ eigen_include

pineforge_hpo.artifact.ArtifactBuilder.eigen_include

Definition at line 415 of file artifact.py.

◆ engine_root

pineforge_hpo.artifact.ArtifactBuilder.engine_root

◆ lock_timeout_seconds

◆ plugin_load

pineforge_hpo.artifact.ArtifactBuilder.plugin_load

Definition at line 421 of file artifact.py.

Referenced by pineforge_hpo.artifact.ArtifactBuilder.build().

◆ plugin_validator

pineforge_hpo.artifact.ArtifactBuilder.plugin_validator

Definition at line 420 of file artifact.py.

◆ wrapper_launched

pineforge_hpo.artifact.ArtifactBuilder.wrapper_launched

The documentation for this class was generated from the following file: