A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
single_item.h
Go to the documentation of this file.
1// Copyright 2026 The A11 Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef A11_FLOW_SINGLE_ITEM_H_
16#define A11_FLOW_SINGLE_ITEM_H_
17
18#include <optional>
19#include <string>
20#include <vector>
21
22#include <nlohmann/json.hpp>
23
24#include "a11/flow/graph.h"
25#include "a11/flow/limits.h"
26
27namespace a11::flow {
30 std::optional<int> upper;
32 bool literal = false;
33 bool eligible = false;
34 bool pump_free = false;
35 bool direct_transfer = false;
36 std::vector<graph::StepId> writers;
37 std::string reason = "unknown-producer";
38 std::string pump_reason = "existing-producer-scheduling";
39};
40
42 std::vector<SingleItemFact> refs;
43 bool complete = true;
44};
45
48 CompilationBudget* budget = nullptr,
49 size_t max_work = 200000);
50
53
55nlohmann::json SingleItemsToJson(const graph::FlowGraph& flow,
56 const SingleItemAnalysis& analysis,
57 bool enabled);
58} // namespace a11::flow
59#endif // A11_FLOW_SINGLE_ITEM_H_
One cooperative deadline and work counter for a compilation request.
Definition limits.h:36
CompilationBudget budget
Definition lsp.cc:289
Definition catalogue.cc:29
bool CheckSingleItemStructure(const graph::FlowGraph &flow)
Validate graph structure independently of transport candidate discovery.
Definition single_item.cc:464
SingleItemAnalysis AnalyseSingleItems(const graph::FlowGraph &flow, CompilationBudget *budget, size_t max_work)
Infer and verify prefix emission bounds, with a bounded optional work quota.
Definition single_item.cc:602
nlohmann::json SingleItemsToJson(const graph::FlowGraph &flow, const SingleItemAnalysis &analysis, bool enabled)
Explain transport decisions without changing the public source plan.
Definition single_item.cc:608
Definition single_item.h:41
std::vector< SingleItemFact > refs
Definition single_item.h:42
bool complete
Definition single_item.h:43
Evidence for transport selection, independent of declared cardinality.
Definition single_item.h:29
bool direct_transfer
Definition single_item.h:35
std::optional< int > upper
Definition single_item.h:30
bool eligible
Definition single_item.h:33
bool pump_free
Definition single_item.h:34
bool literal
Definition single_item.h:32
bool exactly_one_on_success
Definition single_item.h:31
std::vector< graph::StepId > writers
Definition single_item.h:36
std::string reason
Definition single_item.h:37
std::string pump_reason
Definition single_item.h:38
The executable graph of one flow.
Definition graph.h:394