17#ifndef A11_FLOW_RUNTIME_H_
18#define A11_FLOW_RUNTIME_H_
28#include <absl/base/nullability.h>
29#include <absl/status/status.h>
30#include <absl/status/statusor.h>
71 static absl::StatusOr<std::shared_ptr<CompiledProgram>>
Compile(
78 [[nodiscard]]
const std::string&
source()
const {
return source_; }
80 [[nodiscard]]
const std::string&
source_name()
const {
return source_name_; }
82 [[nodiscard]]
const std::vector<Diagnostic>&
diagnostics()
const {
87 [[nodiscard]]
const std::vector<ResolvedFlow>&
flows()
const {
88 return resolved_.
flows;
93 std::string_view flow)
const;
102 std::string_view
name)
const;
113 std::shared_ptr<const RuntimeLayouts> layouts_;
116 std::string linked_source_;
117 std::string source_name_;
119 std::vector<ModuleMember> members_;
122 bool single_item_slots_ =
false;
123 absl::flat_hash_map<std::string, SingleItemAnalysis> single_items_;
143struct ExecutionSnapshot;
216 std::shared_ptr<const CompiledProgram> program, std::string_view flow,
227 std::shared_ptr<const CompiledProgram> program, RunOptions
options = {});
A11's unit of work: the Action and its supporting types.
Schemas describing an action's typed interface and its settings.
One flow file, compiled: the plans, the graphs, and the tree they borrow.
Definition runtime.h:63
const std::string & source_name() const
Definition runtime.h:80
const Program & program() const
Definition runtime.h:76
std::vector< std::string > ExternalActions() const
Runtime identities of external actions called by this composition.
Definition runtime.cc:168
const std::vector< ResolvedFlow > & flows() const
The flows in the order they were declared.
Definition runtime.h:87
static absl::StatusOr< std::shared_ptr< CompiledProgram > > Compile(std::string source, std::string source_name={}, const ModuleSources &modules={}, ModuleResolver resolver={}, CompilationLimits limits={}, bool single_item_slots=true)
Compile source, or fail with the first error the way flow.loads does.
Definition runtime.cc:26
const ResolvedFlow *absl_nullable Entry() const
The file's entry point – flow { ... } – or nullptr.
Definition runtime.cc:215
friend struct RuntimeAccess
Definition runtime.h:110
const SingleItemAnalysis *absl_nullable SingleItems(std::string_view flow) const
Verified transport evidence for an enabled compilation, or nullptr.
Definition runtime.cc:145
const PreparedExpressions & prepared() const
Definition runtime.h:107
const ResolvedFlow *absl_nullable Flow(std::string_view name) const
The flow of this name, or nullptr. Never the entry flow.
Definition runtime.cc:192
const std::string & source() const
Definition runtime.h:78
nlohmann::json Optimizations() const
Explain this compilation's transport choices using the native envelope.
Definition runtime.cc:151
const std::vector< Diagnostic > & diagnostics() const
Definition runtime.h:82
bool single_item_slots
Definition main.cc:149
CompilationLimits limits
Definition main.cc:148
Definition catalogue.cc:29
constexpr size_t kQueueDepth
Maximum values a pipe may hold ahead of its reader.
Definition runtime.h:49
absl::StatusOr< actions::ActionHandler > MakeEntryHandler(std::shared_ptr< const CompiledProgram > program, RunOptions options)
The action handler that runs the program's entry flow.
Definition runtime.cc:248
ActionDeclaration DeclareAction(const actions::ActionSchema &schema)
Definition runtime_schema.cc:108
std::function< absl::StatusOr< ModuleSource >(std::string_view reference, std::string_view importer)> ModuleResolver
Definition module.h:39
absl::StatusOr< actions::ActionHandler > MakeHandler(std::shared_ptr< const CompiledProgram > program, std::string_view flow, RunOptions options)
The action handler that runs one flow of program.
Definition runtime.cc:224
absl::flat_hash_map< std::string, std::string > ModuleSources
Definition module.h:37
absl::StatusOr< actions::ActionSchema > FlowSchema(const FlowPlan &plan, const Program *absl_nullable shapes=nullptr)
The [actions::ActionSchema] a flow presents.
stores::ChunkStoreReaderOptions options
Definition runtime_streams.cc:31
The full typed interface of an action.
Definition schema.h:144
Import an action interface and representable object metadata for generation.
Definition runtime.h:134
std::vector< Diagnostic > diagnostics
Definition runtime.h:137
std::vector< DtoPlan > types
Definition runtime.h:136
FlowPlan interface
Definition runtime.h:135
Host-controlled bounds shared by parsing, linking and semantic analysis.
Definition limits.h:24
One compiled flow: what a caller sees, and what the runtime will do.
Definition plan.h:157
Execution-frame storage policy, independent of Flow semantics.
Definition runtime.h:178
std::shared_ptr< FrameStats > stats
Definition runtime.h:184
size_t max_reserved_bytes
Maximum frame capacity across an invocation and its program's local calls.
Definition runtime.h:183
size_t cache_limit_bytes
Maximum cached frame capacity per runner; zero disables caching.
Definition runtime.h:180
Requested frame capacity, including block headers and unused optional slots.
Definition runtime.h:163
std::atomic< size_t > reuses
Definition runtime.h:165
std::atomic< size_t > cached_bytes
Definition runtime.h:171
std::atomic< size_t > activations
Definition runtime.h:166
std::atomic< size_t > peak_cached_bytes
Definition runtime.h:172
std::atomic< size_t > reserved_bytes
Definition runtime.h:167
std::atomic< size_t > peak_reserved_bytes
Definition runtime.h:168
std::atomic< size_t > active_frames
Definition runtime.h:173
std::atomic< size_t > peak_active_frames
Definition runtime.h:174
std::atomic< size_t > peak_live_bytes
Definition runtime.h:170
std::atomic< size_t > allocations
Definition runtime.h:164
std::atomic< size_t > live_bytes
Definition runtime.h:169
The flows a file declares, and everything wrong with it.
Definition parser.h:34
Immutable, bounded literal preparation shared by execution activations.
Definition values.h:532
Every flow and shape one source file declares.
Definition plan.h:200
A whole file, resolved.
Definition resolve.h:178
Program program
Definition resolve.h:179
std::vector< ResolvedFlow > flows
Definition resolve.h:180
std::vector< Diagnostic > diagnostics
Definition resolve.h:181
One flow, resolved: its plan, its names, and what is wrong with it.
Definition resolve.h:155
std::shared_ptr< ExecutionSnapshot > snapshot
Execution-local pinned registry bindings, shared by transitive flows.
Definition runtime.h:191
std::shared_ptr< net::WireStream > dispatch_stream
For a flow a client runs over a session it already holds: the call steps that belong to the peer are ...
Definition runtime.h:205
FrameOptions frames
Definition runtime.h:207
std::shared_ptr< TransportStats > transport_stats
Definition runtime.h:188
std::shared_ptr< HostBridge > bridge
Who answers the questions only the host can: coercion into a registered type, and reading and writing...
Definition runtime.h:195
Definition single_item.h:41
Optional per-run counters; transport pumps count actual fiber entry.
Definition runtime.h:146
std::atomic< size_t > active_writer_groups
Definition runtime.h:156
std::atomic< size_t > literal_transfers
Definition runtime.h:155
std::atomic< size_t > slots
Definition runtime.h:152
std::atomic< size_t > transfer_tasks
Definition runtime.h:153
std::atomic< size_t > buffer_pumps
Definition runtime.h:149
std::atomic< size_t > inline_producers
Definition runtime.h:150
std::atomic< size_t > slot_pumps
Definition runtime.h:148
std::atomic< size_t > peak_writer_groups
Definition runtime.h:157
std::atomic< size_t > queue_readers
Definition runtime.h:151
std::atomic< size_t > bus_pumps
Definition runtime.h:147
std::atomic< size_t > virtual_groups
Definition runtime.h:154