| Title: | Typed Experimental R Transformation Core |
|---|---|
| Description: | A hard-reset experimental compiler core for a declared subset of R. The package now starts from typed schemas, classed diagnostics, explicit compiler contracts, shape-aware intermediate representations, and generic backend planning. Initial source printers consume a backend-neutral lowered program rather than owning compiler semantics. |
| Authors: | Sounkou Mahamane Toure [aut, cre] |
| Maintainer: | Sounkou Mahamane Toure <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.0.0.9000 |
| Built: | 2026-10-11 16:04:40 UTC |
| Source: | https://github.com/sounkou-bioinfo/tccquickr |
Construct a domain access mapping
tccq_access( value_id, domain, kind = "identity", index_map = list(), consumer_shape = NULL )tccq_access( value_id, domain, kind = "identity", index_map = list(), consumer_shape = NULL )
value_id |
Referenced value id. |
domain |
Access domain. |
kind |
Access kind. |
index_map |
Structured index-map payload. |
consumer_shape |
Logical consumer shape for recycling, or |
This is intentionally narrow. It parses declare(type(...)) declarations,
records a program schema, reports calls without implementations as classed
diagnostics, and runs the first backend-neutral expression lowering pass when
frontend facts are clean.
tccq_analyze( fn, strict = FALSE, registry = tccq_default_op_registry(), context = tccq_op_context() )tccq_analyze( fn, strict = FALSE, registry = tccq_default_op_registry(), context = tccq_op_context() )
fn |
Function to analyze. |
strict |
If |
registry |
Operation registry used to decide whether calls are supported. |
context |
Operation support context. |
Construct argument-selection reduction metadata
tccq_arg_reduction_spec( name, signature, direction = "max", missing = "ignore", ties = "first", attrs = list() )tccq_arg_reduction_spec( name, signature, direction = "max", missing = "ignore", ties = "first", attrs = list() )
name |
Human-readable reduction name. |
signature |
Shared operation signature. |
direction |
Value-selection direction. |
missing |
Missing-value policy. |
ties |
Tie-selection policy. |
attrs |
Structured reduction metadata. |
Construct an operation arity contract
tccq_arity(counts = integer(), minimum = NULL, maximum = NULL)tccq_arity(counts = integer(), minimum = NULL, maximum = NULL)
counts |
Exact accepted argument counts. |
minimum |
Inclusive lower argument-count bound, or |
maximum |
Inclusive upper argument-count bound, or |
Test an operation arity contract
tccq_arity_accepts(arity, count)tccq_arity_accepts(arity, count)
arity |
A TccqArity contract. |
count |
Observed argument count. |
One logical value.
Construct a neutral assignment
tccq_assignment(id, target, value)tccq_assignment(id, target, value)
id |
Stable statement id. |
target |
Typed destination. |
value |
Backend-neutral value expression. |
Construct a backend allocation binding
tccq_backend_allocation_binding(source_name, allocation, slots)tccq_backend_allocation_binding(source_name, allocation, slots)
source_name |
Generated source identifier. |
allocation |
Physical allocation represented by the identifier. |
slots |
Materialized temporary slots sharing the allocation. |
Construct a backend artifact
tccq_backend_artifact( id, kind, source_language = "", path = "", attrs = list() )tccq_backend_artifact( id, kind, source_language = "", path = "", attrs = list() )
id |
Stable artifact id. |
kind |
Artifact kind. |
source_language |
Source language used to produce the artifact, or empty. |
path |
Filesystem path for file-backed artifacts, or empty. |
attrs |
Structured artifact metadata. |
Construct a backend planning context
tccq_backend_context( mode = "source", target = "any", allow_boundary = FALSE, required_capabilities = character(), attrs = list() )tccq_backend_context( mode = "source", target = "any", allow_boundary = FALSE, required_capabilities = character(), attrs = list() )
mode |
Requested backend mode. |
target |
Requested target language or runtime, or |
allow_boundary |
Whether explicit R call-evaluation boundary plans are allowed. |
required_capabilities |
Capabilities that candidate backends must expose. |
attrs |
Structured backend-context attributes. |
Construct a backend callable error channel
tccq_backend_error_channel(source_name, diagnostics)tccq_backend_error_channel(source_name, diagnostics)
source_name |
Generated status-output parameter name. |
diagnostics |
Ordered runtime diagnostics addressable by status code. |
Construct a backend extent binding
tccq_backend_extent_binding(source_name, symbol)tccq_backend_extent_binding(source_name, symbol)
source_name |
Generated extent parameter name. |
symbol |
Declared dimension symbol. |
Construct a backend function interface
tccq_backend_function_interface( symbol, source_language, kind, abi = "", parameters = list(), locals = list(), allocations = list(), result_value_id, result_type, result_placement = "return", result_name = "", domain = NULL, extents = list(), index_names = character(), result_dims = list(), result_count_name = "", error_channel = NULL )tccq_backend_function_interface( symbol, source_language, kind, abi = "", parameters = list(), locals = list(), allocations = list(), result_value_id, result_type, result_placement = "return", result_name = "", domain = NULL, extents = list(), index_names = character(), result_dims = list(), result_count_name = "", error_channel = NULL )
symbol |
Generated function symbol. |
source_language |
Source language consumed by the printer. |
kind |
Function shape: |
abi |
Callable ABI. |
parameters |
Ordered ABI parameter bindings. |
locals |
Ordered scalar-local bindings. |
allocations |
Ordered physical-allocation bindings. |
result_value_id |
Lowered result value id. |
result_type |
Declared semantic result type. |
result_placement |
Whether the result is returned or passed by output argument. |
result_name |
Generated result/output variable name, or empty string. |
domain |
Loop-nest iteration domain, or |
extents |
Ordered symbolic-extent bindings carried by the ABI. |
index_names |
Generated data-parallel and structured loop index names. |
result_dims |
Typed result dimensions. |
result_count_name |
Generated result element-count parameter name, or empty string for scalar results. |
error_channel |
Optional generated callable error channel. |
Construct a backend plan
tccq_backend_plan( id, backend_id, family, mode, target, capabilities = character(), regions = list(), bridges = list(), diagnostics = list(), products = NULL, attrs = list() )tccq_backend_plan( id, backend_id, family, mode, target, capabilities = character(), regions = list(), bridges = list(), diagnostics = list(), products = NULL, attrs = list() )
id |
Stable plan id. |
backend_id |
Backend spec id. |
family |
Backend family. |
mode |
Backend mode. |
target |
Target language or runtime. |
capabilities |
Backend capabilities visible to this plan. |
regions |
Regions assigned to the backend plan. |
bridges |
Representation-transition plans. |
diagnostics |
Diagnostics attached to this plan. |
products |
Typed backend products. |
attrs |
Structured plan attributes. |
Construct a backend plan set
tccq_backend_plan_set( program_name, plans = list(), diagnostics = list(), attrs = list() )tccq_backend_plan_set( program_name, plans = list(), diagnostics = list(), attrs = list() )
program_name |
Program name. |
plans |
Backend plans. |
diagnostics |
Diagnostics collected while planning. |
attrs |
Structured plan-set attributes. |
Prepare a backend plan
tccq_backend_prepare(backend, program, context)tccq_backend_prepare(backend, program, context)
backend |
Backend implementation. |
program |
Program to plan. |
context |
Backend planning context. |
Construct backend products
tccq_backend_products( function_interface = NULL, body = NULL, loop_nest = NULL, loop_nests = list(), storage_plan = NULL, artifacts = list(), attrs = list() )tccq_backend_products( function_interface = NULL, body = NULL, loop_nest = NULL, loop_nests = list(), storage_plan = NULL, artifacts = list(), attrs = list() )
function_interface |
Source-level callable interface, if source exists. |
body |
Expression tree or statement block consumed by the backend, if source exists. |
loop_nest |
Result loop nest consumed by the backend, if source exists. |
loop_nests |
Ordered loop nests, intermediates first, result nest last. |
storage_plan |
Storage plan consumed by the backend, if available. |
artifacts |
Named backend artifacts. |
attrs |
Structured product metadata. |
Construct a backend implementation descriptor
tccq_backend_spec( id, family, target, driver, modes, region_kinds, memory_spaces, capabilities, uses_rapi, attrs = list(), prepare = NULL )tccq_backend_spec( id, family, target, driver, modes, region_kinds, memory_spaces, capabilities, uses_rapi, attrs = list(), prepare = NULL )
id |
Stable backend id. |
family |
Backend family. |
target |
Target language or runtime. |
driver |
Concrete driver name. |
modes |
Supported backend modes. |
region_kinds |
Supported region kinds. |
memory_spaces |
Supported memory spaces. |
capabilities |
Capabilities exposed by this backend. |
uses_rapi |
Whether this backend may touch the R C API. |
attrs |
Structured backend attributes. |
prepare |
Planning implementation. |
Construct a backend value binding
tccq_backend_value_binding(source_name, value_id, source_type, role)tccq_backend_value_binding(source_name, value_id, source_type, role)
source_name |
Generated source identifier. |
value_id |
Neutral value id. |
source_type |
Type represented by the generated identifier. |
role |
Whether the identifier is an ABI parameter or scalar local. |
Construct a program binding
tccq_binding(name, type, mutable = FALSE)tccq_binding(name, type, mutable = FALSE)
name |
Binding name. |
type |
Binding type. |
mutable |
Whether the binding may be mutated. |
Construct a local binding reference
tccq_binding_reference(id, binding)tccq_binding_reference(id, binding)
id |
Stable reference value id. |
binding |
Local binding being read. |
Construct a lazy conditional IR value
tccq_branch( id, condition, consequent, alternative, type, semantics, effect = tccq_effect(may_error = TRUE), attrs = list() )tccq_branch( id, condition, consequent, alternative, type, semantics, effect = tccq_effect(may_error = TRUE), attrs = list() )
id |
Stable value id. |
condition |
Scalar logical condition value id. |
consequent |
Value id selected when the condition is true. |
alternative |
Value id selected when the condition is false. |
type |
Joined branch result type. |
semantics |
Evaluator facts for the originating |
effect |
Conservative effect summary across the condition and both arms. |
attrs |
Structured branch metadata. |
Construct a backend bridge plan
tccq_bridge_plan( id, kind, from_space, to_space, from_type = NULL, to_type = NULL, effect = tccq_effect(reads = TRUE), attrs = list() )tccq_bridge_plan( id, kind, from_space, to_space, from_type = NULL, to_type = NULL, effect = tccq_effect(reads = TRUE), attrs = list() )
id |
Stable bridge id. |
kind |
Bridge kind. |
from_space |
Source memory space. |
to_space |
Destination memory space. |
from_type |
Optional source type. |
to_type |
Optional destination type. |
effect |
Bridge effect summary. |
attrs |
Structured bridge attributes. |
Generic C backend descriptor
tccq_c_backend()tccq_c_backend()
Construct an observed call
tccq_call( name, expr = NULL, origin = "ast", id = "", kind = NULL, arity = NULL, argument_names = NULL, attrs = list() )tccq_call( name, expr = NULL, origin = "ast", id = "", kind = NULL, arity = NULL, argument_names = NULL, attrs = list() )
name |
Call name. |
expr |
Original R call expression. |
origin |
Source of the call observation. |
id |
Stable call id. |
kind |
Structural call kind. |
arity |
Number of supplied arguments, or |
argument_names |
Supplied argument tags. |
attrs |
Structured call attributes. |
Construct a typed call index
tccq_call_index(calls, semantics = NULL, env = baseenv(), attrs = list())tccq_call_index(calls, semantics = NULL, env = baseenv(), attrs = list())
calls |
List of observed calls. |
semantics |
Optional list of call evaluator facts. If omitted, inferred. |
env |
Environment used when inferring missing semantics. |
attrs |
Structured index attributes. |
Return the name of an R call
tccq_call_name(call)tccq_call_name(call)
call |
R call. |
Construct call evaluator facts
tccq_call_semantics( call, env = baseenv(), evaluator_kind = NULL, forcing_policy = NULL, dispatch_kind = NULL, lexical_scope = NULL, replacement = NULL, control = NULL, attrs = list() )tccq_call_semantics( call, env = baseenv(), evaluator_kind = NULL, forcing_policy = NULL, dispatch_kind = NULL, lexical_scope = NULL, replacement = NULL, control = NULL, attrs = list() )
call |
Observed call. |
env |
Environment used to resolve ordinary function names. |
evaluator_kind |
Optional evaluator kind override. |
forcing_policy |
Optional forcing-policy override. |
dispatch_kind |
Optional dispatch-kind override. |
lexical_scope |
Optional lexical-scope override. |
replacement |
Optional replacement flag override. |
control |
Optional control flag override. |
attrs |
Structured semantic attributes. |
Construct a mutable lexical cell
tccq_cell(name, value_id, type, storage_type = tccq_type(type@base))tccq_cell(name, value_id, type, storage_type = tccq_type(type@base))
name |
Binding name. |
value_id |
Stable storage identity. |
type |
Binding type. |
storage_type |
Scalar storage type. |
Construct a lowered mutable-cell read
tccq_cell_reference(id, cell)tccq_cell_reference(id, cell)
id |
Stable value id for this read. |
cell |
Mutable cell being read. |
Collect a typed call index from an R expression
tccq_collect_call_index( expr, global_calls = character(), env = baseenv(), attrs = list() )tccq_collect_call_index( expr, global_calls = character(), env = baseenv(), attrs = list() )
expr |
R expression to inspect. |
global_calls |
Additional function names found by |
env |
Environment used to resolve ordinary function names. |
attrs |
Structured index attributes. |
Collect evaluator facts for calls
tccq_collect_call_semantics(calls, env = baseenv())tccq_collect_call_semantics(calls, env = baseenv())
calls |
List of |
env |
Environment used to resolve ordinary function names. |
Collect calls from an R expression
tccq_collect_calls(expr, global_calls = character())tccq_collect_calls(expr, global_calls = character())
expr |
R expression to inspect. |
global_calls |
Additional function names found by |
Compilation applies one explicit typed optimization, then asks the core backend suite to account for the same verified program. Generic C, Rtinycc/TinyCC, and quickr-style Fortran report constraints through one contract instead of letting one concrete backend shape the IR. The result succeeds when at least one backend produces a working plan; backends that cannot lower the program report feasibility diagnostics in their plans without vetoing the suite.
tccq_compile( fn, backends = tccq_core_backends(), context = tccq_backend_context(), optimization = TccqDeadStoreOptimization(), strict = TRUE )tccq_compile( fn, backends = tccq_core_backends(), context = tccq_backend_context(), optimization = TccqDeadStoreOptimization(), strict = TRUE )
fn |
Function to compile. |
backends |
Backend implementation descriptors. |
context |
Backend planning context. |
optimization |
Program optimization applied before backend planning. |
strict |
If |
Completion summarizes only paths reachable in evaluation order. Nested
loops consume their own break and next transfers, while a block retains
transfers that target its nearest enclosing loop.
tccq_completion(control)tccq_completion(control)
control |
Typed statement or statement block. |
A TccqControlCompletion value.
Extract a diagnostic from a compiler condition
tccq_condition_diagnostic(condition)tccq_condition_diagnostic(condition)
condition |
A compiler condition. |
Construct a value-producing neutral conditional
tccq_conditional(id, condition, consequent, alternative, branch)tccq_conditional(id, condition, consequent, alternative, branch)
id |
Stable statement id. |
condition |
Scalar logical condition expression. |
consequent |
Block evaluated when the condition is true. |
alternative |
Block evaluated when the condition is false. |
branch |
Source branch payload retaining R special-form semantics. |
Construct contraction implementation metadata
tccq_contraction_spec( name, signature, reducer, combine_op = "*", attrs = list() )tccq_contraction_spec( name, signature, reducer, combine_op = "*", attrs = list() )
name |
Human-readable contraction name. |
signature |
Shared operation signature. |
reducer |
Reduction metadata used for the contracted axes. |
combine_op |
Elementwise operation name combining aligned elements. |
attrs |
Structured contraction metadata. |
Every descriptor in the core suite prints from the shared loop nest and function interface. A backend family enters this suite together with its first real lowering; capability strings describe implemented behavior only.
tccq_core_backends(include_rtinycc = TRUE)tccq_core_backends(include_rtinycc = TRUE)
include_rtinycc |
Whether to include the |
The default registry names the R language call forms that the frontend recognizes structurally. It is not a source-syntax whitelist and it is not a backend lowering promise. The registry is immutable, so it is built once per session and shared.
tccq_default_op_registry()tccq_default_op_registry()
Create a compiler diagnostic
tccq_diagnostic(code, message, phase = "schema", path = "", data = list())tccq_diagnostic(code, message, phase = "schema", path = "", data = list())
code |
Stable diagnostic code. |
message |
Human-facing message. |
phase |
Compiler phase that produced the diagnostic. |
path |
Optional path into the program or schema. |
data |
Structured diagnostic payload. |
An affine dimension is a symbolic extent plus a signed integer offset, such
as the n - 2 extent of an interior stencil domain. It keeps shape
arithmetic a typed dimension fact instead of a backend string.
tccq_dim_affine(name, offset)tccq_dim_affine(name, offset)
name |
Symbolic dimension name. |
offset |
Signed integer offset added to the symbolic extent. |
Construct a constant dimension
tccq_dim_constant(value)tccq_dim_constant(value)
value |
Non-negative integer dimension. |
Constant dimensions compare by value, symbolic and affine dimensions by symbol and offset. Unknown dimensions never compare equal.
tccq_dim_equal(left, right)tccq_dim_equal(left, right)
left, right
|
|
Construct a symbolic dimension
tccq_dim_symbol(name)tccq_dim_symbol(name)
name |
Dimension symbol. |
Construct an unknown dimension
tccq_dim_unknown()tccq_dim_unknown()
Construct a typed declared-dimension reference
tccq_dimension_reference(source_value_id, dimension)tccq_dimension_reference(source_value_id, dimension)
source_value_id |
Logical value id supplying the referenced storage. |
dimension |
Declared symbolic dimension supplied by the reference. |
Construct an iteration domain
tccq_domain(id, shape, axes = NULL, attrs = list())tccq_domain(id, shape, axes = NULL, attrs = list())
id |
Stable domain id. |
shape |
Domain shape. |
axes |
Optional axis names. Defaults to |
attrs |
Structured domain attributes. |
Construct operation domain policy metadata
tccq_domain_policy(name, result_shape, attrs = list())tccq_domain_policy(name, result_shape, attrs = list())
name |
Human-readable domain policy name. |
result_shape |
Function from input |
attrs |
Structured domain-policy metadata. |
Return an operation domain-policy result shape
tccq_domain_policy_result_shape(policy, input_types)tccq_domain_policy_result_shape(policy, input_types)
policy |
Domain policy. |
input_types |
List of input |
Construct an effect summary
tccq_effect( reads = FALSE, writes = FALSE, allocates = FALSE, boundary = FALSE, may_error = FALSE, may_warn = FALSE )tccq_effect( reads = FALSE, writes = FALSE, allocates = FALSE, boundary = FALSE, may_error = FALSE, may_warn = FALSE )
reads |
Whether the operation reads program state. |
writes |
Whether the operation writes program state. |
allocates |
Whether the operation allocates storage. |
boundary |
Whether the operation crosses an unsupported boundary. |
may_error |
Whether the operation may signal at runtime. |
may_warn |
Whether the operation may warn at runtime. |
Effect summaries are conservative may-properties. Combining two summaries retains every effect reported by either input.
tccq_effect_union(effect, other)tccq_effect_union(effect, other)
effect |
Effect summary. |
other |
Effect summary to combine with |
The standard elementwise policy returns the shared non-scalar input shape and accepts scalar broadcasting. Following R's recycling rule, a shorter non-scalar operand is also accepted when its dimension multiset divides the longest operand's dimension multiset (so its total length provably divides the iteration size); the result takes the longest shape, and accesses to the shorter operand recycle over the iteration order. Shapes whose divisibility cannot be proven from declared dimensions are rejected.
tccq_elementwise_domain_policy()tccq_elementwise_domain_policy()
This transformation resolves one operation through the supplied registry, applies its signature to typed input expressions, and returns the ordinary neutral expression consumed by every source backend.
tccq_elementwise_expression(registry, op, inputs, id)tccq_elementwise_expression(registry, op, inputs, id)
registry |
Operation registry used for resolution. |
op |
Operation name. |
inputs |
Ordered scalar or array input expressions. |
id |
Stable expression id. |
A TccqResult containing a TccqExpression.
Return an elementwise operation result type
tccq_elementwise_result_type(spec, input_types)tccq_elementwise_result_type(spec, input_types)
spec |
Elementwise metadata. |
input_types |
List of input |
Construct elementwise implementation metadata
tccq_elementwise_spec( name, arity, result_type, attrs = list(), domain_policy = NULL )tccq_elementwise_spec( name, arity, result_type, attrs = list(), domain_policy = NULL )
name |
Human-readable elementwise operation name. |
arity |
Accepted argument counts. |
result_type |
Function from input |
attrs |
Structured elementwise metadata. |
domain_policy |
Optional result-shape policy. |
Construct a scheduled R evaluation
tccq_evaluation_step( value_id, statement_index, effect, binding = NULL, uses = list() )tccq_evaluation_step( value_id, statement_index, effect, binding = NULL, uses = list() )
value_id |
Lowered value evaluated by this step. |
statement_index |
One-based executable statement position. |
effect |
Effect of evaluating the complete step. |
binding |
Optional local binding defined by the evaluation. |
uses |
Local bindings read by the evaluation. |
Construct a backend-neutral expression
tccq_expression( id, kind, type, value_id = id, op = kind, inputs = list(), effect = tccq_effect(), literal = NULL, operation = NULL, branch = NULL, reference = NULL, index_proofs = list() )tccq_expression( id, kind, type, value_id = id, op = kind, inputs = list(), effect = tccq_effect(), literal = NULL, operation = NULL, branch = NULL, reference = NULL, index_proofs = list() )
id |
Stable expression id. |
kind |
Expression kind. |
type |
Result type. |
value_id |
Lowered value id represented by this expression. |
op |
Operation name. |
inputs |
Child expressions. |
effect |
Effect of evaluating the expression. |
literal |
Literal payload for literal expressions. |
operation |
Typed lowered-operation payload for operation expressions. |
branch |
Typed conditional payload for branch expressions. |
reference |
Typed source payload for reference expressions. |
index_proofs |
Per-axis bounds proofs for indexed expressions. |
Construct a typed expression reference
tccq_expression_reference( source_value_id, symbol = "", binding = NULL, slice_offsets = integer(), access = NULL )tccq_expression_reference( source_value_id, symbol = "", binding = NULL, slice_offsets = integer(), access = NULL )
source_value_id |
Logical value id supplying the referenced storage. |
symbol |
Optional source symbol, or an empty string when not applicable. |
binding |
Optional lexical binding represented by the reference. |
slice_offsets |
Zero-based slice offsets, or an empty integer vector. |
access |
Optional typed domain access attached by loop-nest planning. |
Build a backend-neutral expression tree from a lowered value graph
tccq_expression_tree(graph, value_id = NULL)tccq_expression_tree(graph, value_id = NULL)
graph |
Lowered value graph. |
value_id |
Result value id to root the expression tree at. |
Construct a neutral for statement
tccq_for(id, iterator, iteration, body, semantics)tccq_for(id, iterator, iteration, body, semantics)
id |
Stable statement id. |
iterator |
Mutable scalar destination receiving each element. |
iteration |
Backend-neutral iteration plan. |
body |
Procedural loop body. |
semantics |
Evaluator facts for the originating R loop special form. |
This descriptor captures the pressure from quickr's Fortran path: subroutine lowering, C/R bridges, R CMD SHLIB, BLAS/LAPACK linkage, and optional OpenMP.
tccq_fortran_backend()tccq_fortran_backend()
Construct a fusion operation contract
tccq_fusion_contract( fusion_kind, result_value, operations = list(), storage_strategy = NULL, attrs = list() )tccq_fusion_contract( fusion_kind, result_value, operations = list(), storage_strategy = NULL, attrs = list() )
fusion_kind |
Fusion kind owned by the contract. |
result_value |
Typed value produced by the fusion group. |
operations |
Named lowered operations by value id. Control-only groups may use an empty list. |
storage_strategy |
Optional storage strategy. Defaults from
|
attrs |
Structured metadata. |
Construct a fusion group
tccq_fusion_group( id, kind, domain, values = list(), outputs = character(), accesses = list(), region_kind = "kernel", target = "any", effect = tccq_effect(), contract = NULL, attrs = list() )tccq_fusion_group( id, kind, domain, values = list(), outputs = character(), accesses = list(), region_kind = "kernel", target = "any", effect = tccq_effect(), contract = NULL, attrs = list() )
id |
Stable fusion-group id. |
kind |
Fusion kind. |
domain |
Shared iteration domain. |
values |
List of IR values in the group. |
outputs |
Output value ids. |
accesses |
List of access mappings. |
region_kind |
Candidate execution region kind, or |
target |
Candidate implementation target, or |
effect |
Effect summary for the fused group. |
contract |
Typed fusion operation/storage contract. |
attrs |
Structured fusion attributes. |
Construct a neutral procedural if
tccq_if(id, condition, consequent, alternative, semantics)tccq_if(id, condition, consequent, alternative, semantics)
id |
Stable statement id. |
condition |
Scalar logical condition expression. |
consequent |
Block evaluated when the condition is true. |
alternative |
Block evaluated when the condition is false. |
semantics |
Evaluator facts for the originating |
Construct an affine index expression
tccq_index_expr(axis = "", offset = 0L)tccq_index_expr(axis = "", offset = 0L)
axis |
Iteration-axis name, or empty for a constant index. |
offset |
Signed integer offset (zero-based). |
Construct a proven affine scalar index
tccq_index_proof( iterator, selector, iteration, source_extent, index, operation = NULL, semantics = NULL )tccq_index_proof( iterator, selector, iteration, source_extent, index, operation = NULL, semantics = NULL )
iterator |
Iterator target populated by the enclosing virtual loop. |
selector |
Direct reference to the iterator cell. |
iteration |
Virtual iteration establishing the selector range. |
source_extent |
Extent of the indexed source axis. |
index |
Zero-based affine storage index. |
operation |
Lowered selector operation for a shifted index, or |
semantics |
Evaluator facts for the shifted selector call, or |
Construct a proven scalar indexed read
tccq_indexed_value( id, source_id, source_type, index_proofs, access, operation, semantics )tccq_indexed_value( id, source_id, source_type, index_proofs, access, operation, semantics )
id |
Stable value id. |
source_id |
Stable value id of the source storage. |
source_type |
Type of the source storage. |
index_proofs |
Per-axis affine selector and bounds proofs. |
access |
Zero-based source access corresponding to the proofs. |
operation |
Lowered subscript implementation payload. |
semantics |
Evaluator facts for the originating |
Construct a backend-neutral iteration plan
tccq_iteration_plan( source, domain, element, element_type, resolved_op = NULL, semantics = NULL )tccq_iteration_plan( source, domain, element, element_type, resolved_op = NULL, semantics = NULL )
source |
Expression evaluated once to establish iteration. |
domain |
One-dimensional iteration domain. |
element |
Current element expression or affine induction value. |
element_type |
Scalar type assigned to the iteration cell. |
resolved_op |
Resolved operation for virtual iteration, or |
semantics |
Evaluator facts for the virtual iteration call, or |
Construct iteration implementation metadata
tccq_iteration_spec(name, signature, extent_arg = 1L, start = 1L)tccq_iteration_spec(name, signature, extent_arg = 1L, start = 1L)
name |
Human-readable iteration operation name. |
signature |
Shared operation signature. |
extent_arg |
One-based argument position supplying the domain extent. |
start |
First integer value produced by the iteration. |
Construct a scalar literal
tccq_literal(kind, type, value = NULL)tccq_literal(kind, type, value = NULL)
kind |
Literal kind: finite, na, nan, pos_inf, or neg_inf. |
type |
Scalar type. |
value |
Literal payload for finite values. |
Construct a finite scalar literal
tccq_literal_finite(value, type = NULL)tccq_literal_finite(value, type = NULL)
value |
Finite scalar value. |
type |
Optional scalar type. If omitted, it is inferred from |
Construct an infinite double literal
tccq_literal_inf(sign = 1L)tccq_literal_inf(sign = 1L)
sign |
Positive or negative sign. |
Construct a typed NA literal
tccq_literal_na(base)tccq_literal_na(base)
base |
Base type for the missing value. |
Construct a NaN literal
tccq_literal_nan()tccq_literal_nan()
Construct a local value binding
tccq_local_binding(name, value_id, type, statement_index, mutable = FALSE)tccq_local_binding(name, value_id, type, statement_index, mutable = FALSE)
name |
Binding name. |
value_id |
Lowered value bound to the local name. |
type |
Binding type. |
statement_index |
One-based executable statement position defining the binding. |
mutable |
Whether the binding may be mutated. |
Construct a loop-nest iteration axis
tccq_loop_axis(name, extent, role = "map")tccq_loop_axis(name, extent, role = "map")
name |
Iteration-axis name. |
extent |
Typed axis extent. |
role |
Axis role, |
Construct a selected-arm loop guard
tccq_loop_guard(condition, branch, selected)tccq_loop_guard(condition, branch, selected)
condition |
Scalar logical condition expression. |
branch |
Source branch payload retaining R special-form semantics. |
selected |
Whether the consequent ( |
Construct a loop nest
tccq_loop_nest( id, axes, body, storage, output = NULL, reduction = NULL, domain = NULL, guards = list() )tccq_loop_nest( id, axes, body, storage, output = NULL, reduction = NULL, domain = NULL, guards = list() )
id |
Stable loop-nest id. |
axes |
Ordered |
body |
Body expression or typed statement block with access-carrying references. |
storage |
Typed storage slot receiving the nest result. |
output |
Output access over map axes, or |
reduction |
Closed neutral reduction plan for reduce axes, or |
domain |
Optional iteration domain. Defaults to one built from |
guards |
Ordered |
Construct a neutral loop transfer
tccq_loop_transfer(id, action, semantics)tccq_loop_transfer(id, action, semantics)
id |
Stable statement id. |
action |
Loop action, either |
semantics |
Evaluator facts for the originating R control special form. |
The lowerer produces TccqValue, TccqRegion, TccqFusionGroup, and
TccqStoragePlan objects. It is a middle-end pass result, not a C, Fortran,
or TinyCC lowering.
tccq_lower_function( fn, bindings, registry = tccq_default_op_registry(), context = tccq_op_context(), call_index = NULL )tccq_lower_function( fn, bindings, registry = tccq_default_op_registry(), context = tccq_op_context(), call_index = NULL )
fn |
Function to lower. |
bindings |
Declared formal bindings. |
registry |
Operation registry used for operation availability. |
context |
Operation support context. |
call_index |
Typed call facts for |
Construct a lowered operation payload
tccq_lowered_operation( family, resolved_op, signature = NULL, elementwise = NULL, reduction = NULL, contraction = NULL, subscript = NULL, attrs = list() )tccq_lowered_operation( family, resolved_op, signature = NULL, elementwise = NULL, reduction = NULL, contraction = NULL, subscript = NULL, attrs = list() )
family |
Lowered operation family. |
resolved_op |
Selected operation implementation. |
signature |
Optional operation signature. Defaults to the family spec. |
elementwise |
Optional elementwise metadata. |
reduction |
Optional reduction metadata. |
contraction |
Optional contraction metadata. |
subscript |
Optional subscript metadata. |
attrs |
Structured metadata. |
fn supplies only ordered parameter names and one implementation expression;
parameter types come from the operation signature at each expansion site.
Exact call tags bind first and remaining arguments bind positionally. Partial
tags, defaults, and ... are excluded because their complete R argument and
promise semantics are not represented by this expression-body contract.
tccq_op_body(fn)tccq_op_body(fn)
fn |
Function with simple formals and one implementation expression. |
Construct an operation support context
tccq_op_context( phase = "frontend", target = "any", region_kind = "any", memory_space = "any", allow_rapi = TRUE, allow_boundary = FALSE )tccq_op_context( phase = "frontend", target = "any", region_kind = "any", memory_space = "any", allow_rapi = TRUE, allow_boundary = FALSE )
phase |
Compiler phase issuing the query. |
target |
Requested implementation target, or |
region_kind |
Requested execution region kind, or |
memory_space |
Requested memory space, or |
allow_rapi |
Whether implementations touching the R C API are allowed. |
allow_boundary |
Whether explicit boundary implementations are allowed. |
Construct an operation implementation
tccq_op_impl( op, target, region_kind = "any", memory_space = "any", uses_rapi = FALSE, boundary = FALSE, pure = TRUE, effect = NULL, supports = function(call, context) TRUE, render = NULL, body = NULL, elementwise = NULL, reduction = NULL, contraction = NULL, iteration = NULL, subscript = NULL )tccq_op_impl( op, target, region_kind = "any", memory_space = "any", uses_rapi = FALSE, boundary = FALSE, pure = TRUE, effect = NULL, supports = function(call, context) TRUE, render = NULL, body = NULL, elementwise = NULL, reduction = NULL, contraction = NULL, iteration = NULL, subscript = NULL )
op |
Operation or function name. |
target |
Implementation target. |
region_kind |
Region kind the implementation can run in, or |
memory_space |
Memory space the implementation expects, or |
uses_rapi |
Whether the implementation touches the R C API. |
boundary |
Whether the implementation crosses a boundary. |
pure |
Whether the implementation is semantically pure. |
effect |
Effect summary for calls handled by this implementation. |
supports |
Predicate receiving a |
render |
Optional source renderer receiving operand strings and a
|
body |
Optional backend-neutral operation body. |
elementwise |
Optional elementwise metadata. |
reduction |
Optional reduction metadata. |
contraction |
Optional contraction metadata. |
iteration |
Optional iteration metadata. |
subscript |
Optional subscript metadata. |
Construct an operation registry
tccq_op_registry(implementations = list())tccq_op_registry(implementations = list())
implementations |
List of operation implementations. |
Add operation implementations to a registry
tccq_op_registry_add(registry, implementations)tccq_op_registry_add(registry, implementations)
registry |
Operation registry. |
implementations |
Operation implementation or list of implementations. |
Render an operation implementation for source output
tccq_op_render(impl, operands, context)tccq_op_render(impl, operands, context)
impl |
Operation implementation. |
operands |
Rendered operand strings. |
context |
Rendering context. |
Construct an operation source-rendering context
tccq_op_render_context(language, backend_id, attrs = list())tccq_op_render_context(language, backend_id, attrs = list())
language |
Target source language. |
backend_id |
Backend requesting rendering. |
attrs |
Structured rendering metadata. |
Construct operation signature metadata
tccq_op_signature( name, arity, result_type, attrs = list(), domain_policy = NULL )tccq_op_signature( name, arity, result_type, attrs = list(), domain_policy = NULL )
name |
Human-readable operation signature name. |
arity |
Accepted argument counts or a TccqArity contract. |
result_type |
Function from input |
attrs |
Structured signature metadata. |
domain_policy |
Optional result-shape policy. |
Return an operation signature result type
tccq_op_signature_result_type(signature, input_types)tccq_op_signature_result_type(signature, input_types)
signature |
Operation signature. |
input_types |
List of input |
Query operation implementation support
tccq_op_supports(impl, call, context)tccq_op_supports(impl, call, context)
impl |
Operation implementation. |
call |
Observed R call. |
context |
Operation query context. |
In R, every call is an operation candidate. This descriptor represents calls whose concrete implementation, purity, and effects have not been refined yet. It is not R call evaluation; that is only one possible backend implementation family.
tccq_opaque_op_impl()tccq_opaque_op_impl()
Optimize a typed program
tccq_optimize(optimization, program)tccq_optimize(optimization, program)
optimization |
Optimization implementation. |
program |
Typed program to transform. |
A TccqResult containing the transformed TccqProgram.
Plan a backend for a typed program
tccq_plan_backend( program, backend = tccq_c_backend(), context = tccq_backend_context() )tccq_plan_backend( program, backend = tccq_c_backend(), context = tccq_backend_context() )
program |
Program to plan. |
backend |
Backend implementation. |
context |
Backend planning context. |
Every backend accounts for the program and reports constraints through its own plan. The plan set succeeds when at least one backend produces a working plan; backends that cannot lower the program contribute feasibility diagnostics without vetoing the suite.
tccq_plan_backends( program, backends = tccq_core_backends(), context = tccq_backend_context() )tccq_plan_backends( program, backends = tccq_core_backends(), context = tccq_backend_context() )
program |
Program to plan. |
backends |
Backend implementation descriptors. |
context |
Backend planning context. |
Construct a program schema
tccq_program( name, formals, schedule = NULL, values = list(), regions = list(), result = NULL, diagnostics = list(), call_index = NULL, storage_plan = NULL, attrs = list() )tccq_program( name, formals, schedule = NULL, values = list(), regions = list(), result = NULL, diagnostics = list(), call_index = NULL, storage_plan = NULL, attrs = list() )
name |
Program name. |
formals |
Named list of formal bindings. |
schedule |
Optional ordered program evaluation schedule. |
values |
List of IR values. |
regions |
List of executable code regions. |
result |
Result value id or object. |
diagnostics |
List of diagnostics attached to the program. |
call_index |
Typed frontend call handoff. |
storage_plan |
Optional middle-end storage plan. |
attrs |
Structured program attributes. |
Thin wrapper over tccq_program_loop_nests() for programs that plan to
exactly one nest. Multi-nest programs return a structured diagnostic
pointing at the plural planner.
tccq_program_loop_nest(program)tccq_program_loop_nest(program)
program |
Lowered program. |
This is the pass that turns a lowered value graph into the ordered sequence of loop nests consumed by source printers. Every non-root scalar reduction becomes its own all-reduce nest whose result is a named scalar intermediate, and the program result becomes the final nest, whose body references those intermediates through scalar accesses. Elementwise maps become all-map nests, full reductions become all-reduce nests, per-axis reductions and contractions become mixed nests, and slice values disappear into affine accesses. Programs the planner cannot express honestly return structured diagnostics.
tccq_program_loop_nests(program)tccq_program_loop_nests(program)
program |
Lowered program. |
values is the lowered value graph used to verify references, binding
types, dominance, complete step effects, and structured-body cell ownership.
It is checked at this boundary but is not duplicated inside the schedule.
tccq_program_schedule(steps, result, values, body = NULL)tccq_program_schedule(steps, result, values, body = NULL)
steps |
Ordered |
result |
Result value id produced by the final step. |
values |
Lowered values referenced by the schedule. |
body |
Optional structured value-producing body. |
Return a reducer identity literal
tccq_reduction_identity(spec, type)tccq_reduction_identity(spec, type)
spec |
Reduction metadata. |
type |
Result type for the reduction. |
Build a neutral reduction plan
tccq_reduction_plan(spec, value, axes, result_type, id, registry)tccq_reduction_plan(spec, value, axes, result_type, id, registry)
spec |
Reduction metadata. |
value |
Scalar input-element expression. |
axes |
Ordered reduce axes. |
result_type |
Scalar result type. |
id |
Stable loop-nest id. |
registry |
Operation registry used to build transition expressions. |
Construct reduction implementation metadata
tccq_reduction_spec( name, identity, combine_op, finalize_op = "", associative = TRUE, commutative = TRUE, attrs = list(), signature = NULL )tccq_reduction_spec( name, identity, combine_op, finalize_op = "", associative = TRUE, commutative = TRUE, attrs = list(), signature = NULL )
name |
Human-readable reduction name. |
identity |
Function from result |
combine_op |
Registered operation combining the accumulator and current value. |
finalize_op |
Optional registered operation applied to the completed accumulator and reduced element count. |
associative |
Whether the reducer is associative. |
commutative |
Whether the reducer is commutative. |
attrs |
Structured reduction metadata. |
signature |
Shared operation signature. By default, reductions accept one input and return a scalar of the input base type. |
Construct a reduction-state component
tccq_reduction_state_component(name, target, identity)tccq_reduction_state_component(name, target, identity)
name |
Semantic component name. |
target |
Neutral local target that stores the component. |
identity |
Initial scalar literal. |
Construct an executable code region
tccq_region( id, kind, values = list(), fusion_groups = list(), effect = tccq_effect(), memory_space = "host", touches_rapi = FALSE, attrs = list() )tccq_region( id, kind, values = list(), fusion_groups = list(), effect = tccq_effect(), memory_space = "host", touches_rapi = FALSE, attrs = list() )
id |
Stable region id. |
kind |
Region kind: host, kernel, parallel, or device. |
values |
List of IR values in the region. |
fusion_groups |
List of fusion groups in the region. |
effect |
Region effect summary. |
memory_space |
Dominant memory space: r, host, device, or opaque. |
touches_rapi |
Whether the region may call into the R C API. |
attrs |
Structured region attributes. |
Query whether any registry implementation supports a call
tccq_registry_supports(registry, call, context = tccq_op_context())tccq_registry_supports(registry, call, context = tccq_op_context())
registry |
Operation registry. |
call |
Observed R call. |
context |
Operation query context. |
Construct a neutral repeat statement
tccq_repeat(id, body, semantics)tccq_repeat(id, body, semantics)
id |
Stable statement id. |
body |
Procedural loop body. |
semantics |
Evaluator facts for the originating R loop special form. |
Resolve a call to one operation implementation
tccq_resolve_call(registry, call, context = tccq_op_context())tccq_resolve_call(registry, call, context = tccq_op_context())
registry |
Operation registry. |
call |
Observed R call. |
context |
Operation query context. |
Construct a resolved operation
tccq_resolved_op(call, implementation, attrs = list())tccq_resolved_op(call, implementation, attrs = list())
call |
Observed R call. |
implementation |
Selected operation implementation. |
attrs |
Structured resolution metadata. |
Create a compiler result
tccq_result(success, value = NULL, diagnostics = list())tccq_result(success, value = NULL, diagnostics = list())
success |
Whether the phase completed without diagnostics. |
value |
Result value for the phase. |
diagnostics |
List of |
This descriptor models the available TinyCC-backed C path without making it
the compiler architecture. It consumes the same typed function interface,
neutral body or loop nests, storage plan, and C source artifact as the
generic C path, then produces a JIT callable through Rtinycc.
tccq_rtinycc_backend()tccq_rtinycc_backend()
Construct a shape
tccq_shape(dims = list())tccq_shape(dims = list())
dims |
A list, character vector, integer vector, or single dimension. |
Construct a physical storage allocation
tccq_storage_allocation(id, type, memory_space = "host")tccq_storage_allocation(id, type, memory_space = "host")
id |
Stable allocation id. |
type |
Semantic storage type shared by every assigned slot. |
memory_space |
Memory space in which the allocation exists. |
Construct a storage lifetime interval
tccq_storage_lifetime(value_id, defined_at, last_used_at)tccq_storage_lifetime(value_id, defined_at, last_used_at)
value_id |
Value whose lifetime is described. |
defined_at |
Linear definition position in schedule-derived value order. |
last_used_at |
Last position where the value must remain live. |
Construct a storage plan
tccq_storage_plan(slots = list())tccq_storage_plan(slots = list())
slots |
List of storage slots. |
Construct a storage slot
tccq_storage_slot( id, value_id, type, role, materialized, lifetime = NULL, allocation = NULL )tccq_storage_slot( id, value_id, type, role, materialized, lifetime = NULL, allocation = NULL )
id |
Stable storage-slot id. |
value_id |
Value owned by this slot. |
type |
Slot value type. |
role |
Storage role. |
materialized |
Whether storage exists at runtime. |
lifetime |
Optional typed liveness interval for storage reuse. |
allocation |
Physical allocation for a materialized temporary. |
Construct subscript implementation metadata
tccq_subscript_spec(name, signature)tccq_subscript_spec(name, signature)
name |
Human-readable subscript operation name. |
signature |
Shared operation signature. |
Construct a neutral positional switch
tccq_switch(id, selector, selector_target, alternatives, semantics)tccq_switch(id, selector, selector_target, alternatives, semantics)
id |
Stable statement id. |
selector |
Scalar integer selector expression. |
selector_target |
Typed local target for the evaluate-once selector. |
alternatives |
Ordered positional alternative blocks. |
semantics |
Evaluator facts for the originating |
Construct a compiler type
tccq_type(base, shape = tccq_shape())tccq_type(base, shape = tccq_shape())
base |
Scalar or storage base type. |
shape |
Shape value. |
Find calls without an implementation for a registry and context
tccq_unimplemented_calls( calls, registry = tccq_default_op_registry(), context = tccq_op_context() )tccq_unimplemented_calls( calls, registry = tccq_default_op_registry(), context = tccq_op_context() )
calls |
List of |
registry |
Operation registry. |
context |
Operation query context. |
Construct an IR value
tccq_value( id, op, inputs = list(), type, effect = tccq_effect(), attrs = list() )tccq_value( id, op, inputs = list(), type, effect = tccq_effect(), attrs = list() )
id |
Stable value id. |
op |
Operation name. |
inputs |
Input value ids or references. |
type |
Result type. |
effect |
Effect summary. |
attrs |
Structured operation attributes. |
Construct a value-producing neutral statement block
tccq_value_block(id, result, locals = list(), statements = list())tccq_value_block(id, result, locals = list(), statements = list())
id |
Stable block id. |
result |
Typed target produced on every terminal path through the block. |
locals |
Ordered local write targets declared by the block. |
statements |
Ordered |
Verify an optimized program
tccq_verify_optimization(optimization, before, after)tccq_verify_optimization(optimization, before, after)
optimization |
Optimization implementation. |
before |
Program before transformation. |
after |
Program after transformation. |
A TccqResult containing after when its pass invariants hold.
Construct a neutral while statement
tccq_while(id, condition, body, semantics)tccq_while(id, condition, body, semantics)
id |
Stable statement id. |
condition |
Scalar logical condition expression. |
body |
Procedural loop body. |
semantics |
Evaluator facts for the originating R loop special form. |
Construct a neutral write target
tccq_write_target( value_id, type, storage_type = tccq_type(type@base), kind = "local", binding = NULL )tccq_write_target( value_id, type, storage_type = tccq_type(type@base), kind = "local", binding = NULL )
value_id |
Stable value id written by the target. |
type |
Semantic value type. |
storage_type |
Scalar storage type written at the target. |
kind |
Target kind: |
binding |
Optional binding owned by the target. |
Access describes how a value is read or written over a domain. It is the schema-level place for identity indexing, scalar broadcast, slicing, transpose, and later richer affine/custom maps.
TccqAccess( value_id = character(0), domain = TccqDomain(), kind = character(0), index_map = list(), consumer_shape = NULL )TccqAccess( value_id = character(0), domain = TccqDomain(), kind = character(0), index_map = list(), consumer_shape = NULL )
value_id |
Referenced value id. |
domain |
Access domain. |
kind |
Access kind. |
index_map |
Structured index-map payload. |
consumer_shape |
Logical consumer shape for recycling, or |
An argument reduction tracks whether a value was seen, the selected value, and its one-based index. The first concrete form supports R-compatible maximum selection while ignoring missing double values.
TccqArgReductionSpec( name = character(0), signature = TccqOpSignature(), associative = logical(0), commutative = logical(0), empty_policy = character(0), attrs = list(), direction = character(0), missing = character(0), ties = character(0) )TccqArgReductionSpec( name = character(0), signature = TccqOpSignature(), associative = logical(0), commutative = logical(0), empty_policy = character(0), attrs = list(), direction = character(0), missing = character(0), ties = character(0) )
name |
Human-readable reduction name. |
signature |
Shared operation signature. |
associative |
Whether the reducer is associative under its declared semantics. |
commutative |
Whether the reducer is commutative under its declared semantics. |
empty_policy |
Behavior when no value contributes to the reduction. |
attrs |
Structured reduction metadata. |
direction |
Value-selection direction. |
missing |
Missing-value policy. |
ties |
Tie-selection policy. |
Arity is a typed operation fact rather than an expanded vector of convenient
argument counts. Exact contracts enumerate accepted counts; interval
contracts own inclusive lower and optional upper bounds. This lets
rank-polymorphic operations such as [ remain independent of an arbitrary
maximum array rank.
TccqArity(counts = integer(0), minimum = NULL, maximum = NULL)TccqArity(counts = integer(0), minimum = NULL, maximum = NULL)
counts |
Exact accepted argument counts. |
minimum |
Inclusive lower argument-count bound, or |
maximum |
Inclusive upper argument-count bound, or |
Neutral assignment statement
TccqAssignment( id = character(0), effect = TccqEffect(), target = TccqWriteTarget(), value = TccqExpression() )TccqAssignment( id = character(0), effect = TccqEffect(), target = TccqWriteTarget(), value = TccqExpression() )
id |
Stable statement id. |
effect |
Effect summary of evaluating the statement. |
target |
Typed destination. |
value |
Backend-neutral value expression. |
Backend implementations must opt into this trait before compiler code uses them for planning.
TccqBackendTccqBackend
An allocation binding assigns one generated source identifier to one typed physical allocation. Every materialized slot sharing that allocation is carried by the same binding.
TccqBackendAllocationBinding( source_name = character(0), allocation = TccqStorageAllocation(), slots = list() )TccqBackendAllocationBinding( source_name = character(0), allocation = TccqStorageAllocation(), slots = list() )
source_name |
Generated source identifier. |
allocation |
Physical allocation represented by the identifier. |
slots |
Materialized temporary slots sharing the allocation. |
Backend artifacts are concrete products of a backend plan: generated source, a compiled shared library, or a JIT callable. They are explicit plan values so source, shared-library, and JIT modes cannot silently collapse into the same loose string attribute.
TccqBackendArtifact( id = character(0), kind = character(0), source_language = character(0), path = character(0), attrs = list() )TccqBackendArtifact( id = character(0), kind = character(0), source_language = character(0), path = character(0), attrs = list() )
id |
Stable artifact id. |
kind |
Artifact kind. |
source_language |
Source language used to produce the artifact, or empty. |
path |
Filesystem path for file-backed artifacts, or empty. |
attrs |
Structured artifact metadata. |
Backend planning context
TccqBackendContext( mode = character(0), target = character(0), allow_boundary = logical(0), required_capabilities = character(0), attrs = list() )TccqBackendContext( mode = character(0), target = character(0), allow_boundary = logical(0), required_capabilities = character(0), attrs = list() )
mode |
Requested backend mode. |
target |
Requested target language or runtime, or |
allow_boundary |
Whether explicit R call-evaluation boundary plans are allowed. |
required_capabilities |
Capabilities that candidate backends must expose. |
attrs |
Structured backend-context attributes. |
Generated code writes zero on success or the one-based position of a diagnostic on failure. Wrappers turn the status back into the corresponding classed runtime diagnostic.
TccqBackendErrorChannel(source_name = character(0), diagnostics = list())TccqBackendErrorChannel(source_name = character(0), diagnostics = list())
source_name |
Generated status-output parameter name. |
diagnostics |
Ordered runtime diagnostics addressable by status code. |
An extent binding assigns one generated ABI parameter to one declared dimension symbol.
TccqBackendExtentBinding(source_name = character(0), symbol = character(0))TccqBackendExtentBinding(source_name = character(0), symbol = character(0))
source_name |
Generated extent parameter name. |
symbol |
Declared dimension symbol. |
A backend function interface is the source-level callable boundary consumed by C, Rtinycc, Fortran, and later source printers. Generated parameters, scalar locals, physical allocations, and extents are closed typed bindings; positional arrays are not an interface protocol.
TccqBackendFunctionInterface( symbol = character(0), source_language = character(0), kind = character(0), abi = character(0), parameters = list(), locals = list(), allocations = list(), result_value_id = character(0), result_type = TccqType(), result_placement = character(0), result_name = character(0), domain = NULL, extents = list(), index_names = character(0), result_dims = list(), result_count_name = character(0), error_channel = NULL )TccqBackendFunctionInterface( symbol = character(0), source_language = character(0), kind = character(0), abi = character(0), parameters = list(), locals = list(), allocations = list(), result_value_id = character(0), result_type = TccqType(), result_placement = character(0), result_name = character(0), domain = NULL, extents = list(), index_names = character(0), result_dims = list(), result_count_name = character(0), error_channel = NULL )
symbol |
Generated function symbol. |
source_language |
Source language consumed by the printer. |
kind |
Function shape: |
abi |
Callable ABI. |
parameters |
Ordered ABI parameter bindings. |
locals |
Ordered scalar-local bindings. |
allocations |
Ordered physical-allocation bindings. |
result_value_id |
Lowered result value id. |
result_type |
Declared semantic result type. |
result_placement |
Whether the result is returned or passed by output argument. |
result_name |
Generated result/output variable name, or empty string. |
domain |
Loop-nest iteration domain, or |
extents |
Ordered symbolic-extent bindings carried by the ABI. |
index_names |
Generated data-parallel and structured loop index names. |
result_dims |
Typed result dimensions. |
result_count_name |
Generated result element-count parameter name, or empty string for scalar results. |
error_channel |
Optional generated callable error channel. |
Backend plan
TccqBackendPlan( id = character(0), backend_id = character(0), family = character(0), mode = character(0), target = character(0), capabilities = character(0), regions = list(), bridges = list(), diagnostics = list(), products = NULL, attrs = list() )TccqBackendPlan( id = character(0), backend_id = character(0), family = character(0), mode = character(0), target = character(0), capabilities = character(0), regions = list(), bridges = list(), diagnostics = list(), products = NULL, attrs = list() )
id |
Stable plan id. |
backend_id |
Backend spec id. |
family |
Backend family. |
mode |
Backend mode. |
target |
Target language or runtime. |
capabilities |
Backend capabilities visible to this plan. |
regions |
Regions assigned to the backend plan. |
bridges |
Representation-transition plans. |
diagnostics |
Diagnostics attached to this plan. |
products |
Typed backend products. |
attrs |
Structured plan attributes. |
A plan set is the neutral result of asking several backend families to account for the same typed program. It exists to keep the core honest: C, Fortran, and future graph, device, or R call-evaluation implementations must report their constraints through the same contract.
TccqBackendPlanSet( program_name = character(0), plans = list(), diagnostics = list(), attrs = list() )TccqBackendPlanSet( program_name = character(0), plans = list(), diagnostics = list(), attrs = list() )
program_name |
Program name. |
plans |
Backend plans. |
diagnostics |
Diagnostics collected while planning. |
attrs |
Structured plan-set attributes. |
Backend products are the typed outputs owned by a backend plan: the callable
interface, loop nest, expression or statement block consumed by the source
printer, storage plan, and concrete artifacts. Runtime handles such as loaded
libraries and compiled callables stay in attrs, but under this typed
products value rather than directly on the backend plan.
TccqBackendProducts( function_interface = NULL, body = NULL, loop_nest = NULL, loop_nests = list(), storage_plan = NULL, artifacts = list(), attrs = list() )TccqBackendProducts( function_interface = NULL, body = NULL, loop_nest = NULL, loop_nests = list(), storage_plan = NULL, artifacts = list(), attrs = list() )
function_interface |
Source-level callable interface, if source exists. |
body |
Expression tree or statement block consumed by the backend, if source exists. |
loop_nest |
Result loop nest consumed by the backend, if source exists. |
loop_nests |
Ordered loop nests, intermediates first, result nest last. |
storage_plan |
Storage plan consumed by the backend, if available. |
artifacts |
Named backend artifacts. |
attrs |
Structured product metadata. |
Backend implementation descriptor
TccqBackendSpec( id = character(0), family = character(0), target = character(0), driver = character(0), modes = character(0), region_kinds = character(0), memory_spaces = character(0), capabilities = character(0), uses_rapi = logical(0), attrs = list(), prepare = function() NULL )TccqBackendSpec( id = character(0), family = character(0), target = character(0), driver = character(0), modes = character(0), region_kinds = character(0), memory_spaces = character(0), capabilities = character(0), uses_rapi = logical(0), attrs = list(), prepare = function() NULL )
id |
Stable backend id. |
family |
Backend family. |
target |
Target language or runtime. |
driver |
Concrete driver name. |
modes |
Supported backend modes. |
region_kinds |
Supported region kinds. |
memory_spaces |
Supported memory spaces. |
capabilities |
Capabilities exposed by this backend. |
uses_rapi |
Whether this backend may touch the R C API. |
attrs |
Structured backend attributes. |
prepare |
Planning implementation. |
A value binding assigns one generated source identifier and source type to a neutral value. Parameters and scalar locals share this representation so their names, identities, and types cannot drift in parallel arrays.
TccqBackendValueBinding( source_name = character(0), value_id = character(0), source_type = TccqType(), role = character(0) )TccqBackendValueBinding( source_name = character(0), value_id = character(0), source_type = TccqType(), role = character(0) )
source_name |
Generated source identifier. |
value_id |
Neutral value id. |
source_type |
Type represented by the generated identifier. |
role |
Whether the identifier is an ABI parameter or scalar local. |
Program binding
TccqBinding(name = character(0), type = TccqType(), mutable = logical(0))TccqBinding(name = character(0), type = TccqType(), mutable = logical(0))
name |
Binding name. |
type |
Binding type. |
mutable |
Whether the binding may be mutated. |
A binding reference is a lexical read of an already evaluated local. It retains the exact binding identity while pointing at the binding's storage value. Expression and effect traversal stop at this node; reading a local must not re-evaluate the graph that defined it.
TccqBindingReference( id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), attrs = list(), binding = TccqLocalBinding() )TccqBindingReference( id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), attrs = list(), binding = TccqLocalBinding() )
id |
Stable value id. |
op |
Operation name. |
inputs |
Input value ids or references. |
type |
Result type. |
effect |
Effect summary. |
attrs |
Structured operation attributes. |
binding |
Local binding being read. |
A block owns lexical local declarations and ordered typed statements. Its nesting is semantic: locals and statements inside one branch arm are not evaluated from another arm. A plain block does not imply that evaluation yields a value; TccqValueBlock adds that stronger completion contract.
TccqBlock( id = character(0), locals = list(), statements = list(), effect = TccqEffect() )TccqBlock( id = character(0), locals = list(), statements = list(), effect = TccqEffect() )
id |
Stable block id. |
locals |
Ordered local write targets declared by the block. |
statements |
Ordered |
effect |
Exact effect summary of evaluating the statements. |
TccqBranch is the value-level representation of R's if special form.
Its three incoming value ids are analyzed eagerly by the compiler, but the
recorded special-form semantics require generated code to evaluate exactly
one result arm at runtime.
TccqBranch( id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), attrs = list(), condition = character(0), consequent = character(0), alternative = character(0), semantics = TccqCallSemantics() )TccqBranch( id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), attrs = list(), condition = character(0), consequent = character(0), alternative = character(0), semantics = TccqCallSemantics() )
id |
Stable value id. |
op |
Operation name. |
inputs |
Input value ids or references. |
type |
Result type. |
effect |
Effect summary. |
attrs |
Structured operation attributes. |
condition |
Scalar logical condition value id. |
consequent |
Value id produced when the condition is true. |
alternative |
Value id produced when the condition is false. |
semantics |
Evaluator facts for the originating |
Bridges model representation transitions such as SEXP -> host buffer,
host -> device, layout conversion, tile materialization, or R
call-evaluation boundaries. They are explicit backend-plan values, not
emitter branches.
TccqBridgePlan( id = character(0), kind = character(0), from_space = character(0), to_space = character(0), from_type = NULL, to_type = NULL, effect = TccqEffect(), attrs = list() )TccqBridgePlan( id = character(0), kind = character(0), from_space = character(0), to_space = character(0), from_type = NULL, to_type = NULL, effect = TccqEffect(), attrs = list() )
id |
Stable bridge id. |
kind |
Bridge kind. |
from_space |
Source memory space. |
to_space |
Destination memory space. |
from_type |
Optional source type. |
to_type |
Optional destination type. |
effect |
Bridge effect summary. |
attrs |
Structured bridge attributes. |
R call observed by the frontend
TccqCall( id = character(0), name = character(0), expr = NULL, origin = character(0), kind = character(0), arity = integer(0), argument_names = character(0), attrs = list() )TccqCall( id = character(0), name = character(0), expr = NULL, origin = character(0), kind = character(0), arity = integer(0), argument_names = character(0), attrs = list() )
id |
Stable call id. |
name |
Call name. |
expr |
Original R call expression. |
origin |
Source of the call observation. |
kind |
Structural call kind. |
arity |
Number of supplied arguments, or |
argument_names |
Supplied argument tags. |
attrs |
Structured call attributes. |
TccqCallIndex is the typed handoff from frontend analysis to later lowering
passes. It keeps observed calls and evaluator facts aligned by stable call id.
TccqCallIndex(calls = list(), semantics = list(), attrs = list())TccqCallIndex(calls = list(), semantics = list(), attrs = list())
calls |
List of observed calls. |
semantics |
List of call evaluator facts. |
attrs |
Structured index attributes. |
TccqCallSemantics records evaluator-level facts about an observed call. It
is not a lowering decision: special forms, builtins, closures, replacement
calls, group generics, and unknown calls still need later operation and
backend implementations.
TccqCallSemantics( call = TccqCall(), evaluator_kind = character(0), forcing_policy = character(0), dispatch_kind = character(0), lexical_scope = logical(0), replacement = logical(0), control = logical(0), attrs = list() )TccqCallSemantics( call = TccqCall(), evaluator_kind = character(0), forcing_policy = character(0), dispatch_kind = character(0), lexical_scope = logical(0), replacement = logical(0), control = logical(0), attrs = list() )
call |
Observed call. |
evaluator_kind |
Evaluator kind. |
forcing_policy |
Promise-forcing policy. |
dispatch_kind |
Dispatch family. |
lexical_scope |
Whether lexical closure environment matters. |
replacement |
Whether this is a replacement-function call. |
control |
Whether this is a control-form call. |
attrs |
Structured semantic attributes. |
A cell is storage for loop-carried scalar state. It is deliberately distinct from TccqLocalBinding, whose identity remains one immutable SSA definition. Source names are assigned later by the backend interface.
TccqCell( name = character(0), type = TccqType(), mutable = logical(0), value_id = character(0), storage_type = TccqType() )TccqCell( name = character(0), type = TccqType(), mutable = logical(0), value_id = character(0), storage_type = TccqType() )
name |
Binding name. |
type |
Binding type. |
mutable |
Whether the binding may be mutated. |
value_id |
Stable storage identity. |
storage_type |
Scalar storage type. |
Lowered mutable-cell read
TccqCellReference( id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), attrs = list(), cell = TccqCell() )TccqCellReference( id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), attrs = list(), cell = TccqCell() )
id |
Stable value id. |
op |
Operation name. |
inputs |
Input value ids or references. |
type |
Result type. |
effect |
Effect summary. |
attrs |
Structured operation attributes. |
cell |
Mutable cell being read. |
This is the stricter value-producing form of TccqIf. Both arms must be
value blocks writing the same target, and the retained TccqBranch must
agree with the procedural control facts. The branch retains the effect of
the source value; the statement effect covers only work left in its
normalized arms after reductions or contractions have been extracted.
TccqConditional( id = character(0), effect = TccqEffect(), condition = TccqExpression(), consequent = TccqBlock(), alternative = TccqBlock(), semantics = TccqCallSemantics(), branch = TccqBranch() )TccqConditional( id = character(0), effect = TccqEffect(), condition = TccqExpression(), consequent = TccqBlock(), alternative = TccqBlock(), semantics = TccqCallSemantics(), branch = TccqBranch() )
id |
Stable statement id. |
effect |
Effect summary of evaluating the statement. |
condition |
Scalar logical condition expression. |
consequent |
Block evaluated when the condition is true. |
alternative |
Block evaluated when the condition is false. |
semantics |
Evaluator facts for the originating |
branch |
Source branch payload retaining R special-form semantics. |
A contraction spec is attached to an operation implementation when calls to
that implementation lower to a loop nest that multiplies (or otherwise
combines) aligned elements along shared reduce axes and folds them with a
reducer, such as %*%. It carries the shared operation signature, the
reducer used for the fold, and the elementwise combine operation applied
before folding.
TccqContractionSpec( name = character(0), signature = TccqOpSignature(), reducer = TccqFoldReductionSpec(), combine_op = character(0), attrs = list() )TccqContractionSpec( name = character(0), signature = TccqOpSignature(), reducer = TccqFoldReductionSpec(), combine_op = character(0), attrs = list() )
name |
Human-readable contraction name. |
signature |
Shared operation signature. |
reducer |
Reduction metadata used for the contracted axes. |
combine_op |
Elementwise operation name combining aligned elements. |
attrs |
Structured contraction metadata. |
Completion is distinct from TccqEffect. It records whether structured
control may reach the next statement or transfer to the nearest enclosing
loop. These facts let dominance and later transformations reason about
normal paths without treating break or next as fabricated side effects.
TccqControlCompletion( falls_through = logical(0), breaks = logical(0), continues = logical(0) )TccqControlCompletion( falls_through = logical(0), breaks = logical(0), continues = logical(0) )
falls_through |
Whether evaluation may reach the next statement. |
breaks |
Whether evaluation may break from the nearest enclosing loop. |
continues |
Whether evaluation may continue the nearest enclosing loop. |
This optimization removes assignments to compiler-owned local or cell storage when the target is never read and evaluating the assigned expression cannot write, allocate, cross a boundary, signal an error, or warn. It is deliberately limited to structured neutral program bodies; graph-level dead value elimination must also rewrite schedules, regions, fusion contracts, storage lifetimes, and allocations and therefore requires a separate pass.
TccqDeadStoreOptimization()TccqDeadStoreOptimization()
Diagnostics are values first and condition payloads second. Compiler code should pass these objects around instead of branching on condition strings.
TccqDiagnostic( code = character(0), message = character(0), phase = character(0), path = character(0), data = list() )TccqDiagnostic( code = character(0), message = character(0), phase = character(0), path = character(0), data = list() )
code |
Stable diagnostic code. |
message |
Human-facing message. |
phase |
Compiler phase that produced the diagnostic. |
path |
Optional path into the program or schema. |
data |
Structured diagnostic payload. |
Shape dimension
TccqDim(kind = character(0), label = character(0), value = integer(0))TccqDim(kind = character(0), label = character(0), value = integer(0))
kind |
Dimension kind. |
label |
Symbolic dimension label. |
value |
Constant dimension value. |
A dimension reference identifies the scalar ABI extent corresponding to one declared symbolic dimension. It is distinct from an ordinary scalar binding with the same source spelling.
TccqDimensionReference( source_value_id = character(0), symbol = character(0), binding = NULL, slice_offsets = integer(0), access = NULL, dimension = TccqDim() )TccqDimensionReference( source_value_id = character(0), symbol = character(0), binding = NULL, slice_offsets = integer(0), access = NULL, dimension = TccqDim() )
source_value_id |
Logical value id supplying the referenced storage. |
symbol |
Optional source symbol, or an empty string when not applicable. |
binding |
Optional lexical binding represented by the reference. |
slice_offsets |
Zero-based slice offsets, or an empty integer vector. |
access |
Optional typed domain access attached by loop-nest planning. |
dimension |
Declared symbolic dimension supplied by the reference. |
A domain is the semantic iteration space for elementwise, reduction, stencil, or tiled work. It is separate from shape so transformed programs can name and reuse iteration spaces directly.
TccqDomain( id = character(0), shape = TccqShape(), axes = character(0), attrs = list() )TccqDomain( id = character(0), shape = TccqShape(), axes = character(0), attrs = list() )
id |
Stable domain id. |
shape |
Domain shape. |
axes |
Axis names. |
attrs |
Structured domain attributes. |
A domain policy describes how input shapes determine an operation result shape before target source generation. It is the typed home for rules such as scalar broadcast, common elementwise domains, and scalar reducer results.
TccqDomainPolicy( name = character(0), result_shape = function() NULL, attrs = list() )TccqDomainPolicy( name = character(0), result_shape = function() NULL, attrs = list() )
name |
Human-readable domain policy name. |
result_shape |
Function from input |
attrs |
Structured domain-policy metadata. |
Compiler effect summary
TccqEffect( reads = logical(0), writes = logical(0), allocates = logical(0), boundary = logical(0), may_error = logical(0), may_warn = logical(0) )TccqEffect( reads = logical(0), writes = logical(0), allocates = logical(0), boundary = logical(0), may_error = logical(0), may_warn = logical(0) )
reads |
Whether the operation reads program state. |
writes |
Whether the operation writes program state. |
allocates |
Whether the operation allocates storage. |
boundary |
Whether the operation crosses an unsupported boundary. |
may_error |
Whether the operation may signal at runtime. |
may_warn |
Whether the operation may warn at runtime. |
An elementwise spec is attached to an operation implementation when calls to that implementation can lower to elementwise values over the compiler domain model. It carries an operation signature so lowering does not recognize elementwise operations by spelling.
TccqElementwiseSpec( name = character(0), signature = TccqOpSignature(), attrs = list() )TccqElementwiseSpec( name = character(0), signature = TccqOpSignature(), attrs = list() )
name |
Human-readable elementwise operation name. |
signature |
Shared operation signature. |
attrs |
Structured elementwise metadata. |
One step records one executable top-level form after declarations have been removed. Assignment steps carry the local binding they define; expression statements carry no binding. The effect summarizes the complete value graph evaluated by the step.
TccqEvaluationStep( value_id = character(0), statement_index = integer(0), binding = NULL, uses = list(), effect = TccqEffect() )TccqEvaluationStep( value_id = character(0), statement_index = integer(0), binding = NULL, uses = list(), effect = TccqEffect() )
value_id |
Lowered value evaluated by this step. |
statement_index |
One-based executable statement position. |
binding |
Optional local binding defined by the evaluation. |
uses |
Local bindings read by the evaluation. |
effect |
Effect of evaluating the complete step. |
TccqExpression is the small tree form consumed by source printers. It is
built from typed lowered values and resolved operations, so C, Fortran,
TinyCC, and later printers do not rediscover expression semantics from raw
operation strings.
TccqExpression( id = character(0), kind = character(0), value_id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), literal = NULL, operation = NULL, branch = NULL, reference = NULL, index_proofs = list() )TccqExpression( id = character(0), kind = character(0), value_id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), literal = NULL, operation = NULL, branch = NULL, reference = NULL, index_proofs = list() )
id |
Stable expression id. |
kind |
Expression kind. |
value_id |
Lowered value id represented by this expression. |
op |
Operation name, or |
inputs |
Child expressions. |
type |
Result type. |
effect |
Effect of evaluating the expression. |
literal |
Literal payload for literal expressions. |
operation |
Typed lowered-operation payload for operation expressions. |
branch |
Typed conditional payload for branch expressions. |
reference |
Typed source payload for reference expressions. |
index_proofs |
Per-axis bounds proofs for indexed expressions. |
A reference names the logical source value read by a neutral expression. It keeps lexical binding, source symbol, slice, and affine access facts out of open-ended expression metadata. Physical allocation remains a separate storage-plan concern.
TccqExpressionReference( source_value_id = character(0), symbol = character(0), binding = NULL, slice_offsets = integer(0), access = NULL )TccqExpressionReference( source_value_id = character(0), symbol = character(0), binding = NULL, slice_offsets = integer(0), access = NULL )
source_value_id |
Logical value id supplying the referenced storage. |
symbol |
Optional source symbol, or an empty string when not applicable. |
binding |
Optional lexical binding represented by the reference. |
slice_offsets |
Zero-based slice offsets, or an empty integer vector. |
access |
Optional typed domain access attached by loop-nest planning. |
A fold reduction has one accumulator identity, one combine operation, and an optional finalizer. Its neutral loop state has exactly one component.
TccqFoldReductionSpec( name = character(0), signature = TccqOpSignature(), associative = logical(0), commutative = logical(0), empty_policy = character(0), attrs = list(), identity = function() NULL, combine_op = character(0), finalize_op = character(0) )TccqFoldReductionSpec( name = character(0), signature = TccqOpSignature(), associative = logical(0), commutative = logical(0), empty_policy = character(0), attrs = list(), identity = function() NULL, combine_op = character(0), finalize_op = character(0) )
name |
Human-readable reduction name. |
signature |
Shared operation signature. |
associative |
Whether the reducer is associative under its declared semantics. |
commutative |
Whether the reducer is commutative under its declared semantics. |
empty_policy |
Behavior when no value contributes to the reduction. |
attrs |
Structured reduction metadata. |
identity |
Function from result |
combine_op |
Registered elementwise operation combining the accumulator and current value. |
finalize_op |
Optional registered elementwise operation combining the completed accumulator and reduced element count. |
A for loop evaluates one typed iteration plan and assigns each selected element to its iteration cell before evaluating the body. Source evaluation, element selection, and iteration domain are explicit so source backends do not reconstruct traversal from R syntax.
TccqFor( id = character(0), effect = TccqEffect(), body = TccqBlock(), semantics = TccqCallSemantics(), iterator = TccqWriteTarget(), iteration = TccqIterationPlan() )TccqFor( id = character(0), effect = TccqEffect(), body = TccqBlock(), semantics = TccqCallSemantics(), iterator = TccqWriteTarget(), iteration = TccqIterationPlan() )
id |
Stable statement id. |
effect |
Effect summary of evaluating the statement. |
body |
Procedural loop body. |
semantics |
Evaluator facts for the originating R loop special form. |
iterator |
Mutable scalar destination receiving each element. |
iteration |
Backend-neutral iteration plan. |
TccqFusionContract is the typed payload attached to a fusion group after
region planning. It keeps the lowered operation payloads, signatures, domain
policies, typed result value, optional result operation, and storage strategy
together so fusion legality and later optimization passes do not inspect
loose group attributes. Control values such as TccqBranch are valid fusion
results even when the group contains no lowered operations.
TccqFusionContract( fusion_kind = character(0), storage_strategy = character(0), operations = list(), result_value = TccqValue(), result_operation = NULL, operation_signatures = list(), domain_policies = list(), attrs = list() )TccqFusionContract( fusion_kind = character(0), storage_strategy = character(0), operations = list(), result_value = TccqValue(), result_operation = NULL, operation_signatures = list(), domain_policies = list(), attrs = list() )
fusion_kind |
Fusion kind owned by the contract. |
storage_strategy |
Storage strategy requested by the fusion plan. |
operations |
Named lowered operations by value id. |
result_value |
Typed value produced by the fusion group. |
result_operation |
Optional lowered operation carried by |
operation_signatures |
Named operation signatures by value id. |
domain_policies |
Named domain policies by value id. |
attrs |
Structured metadata. |
A fusion group is a typed plan candidate, not emitted code. It groups values that may share one domain and region when operation implementations, effects, access maps, layout, and backend constraints allow it.
TccqFusionGroup( id = character(0), kind = character(0), domain = TccqDomain(), values = list(), outputs = character(0), accesses = list(), region_kind = character(0), target = character(0), effect = TccqEffect(), contract = NULL, attrs = list() )TccqFusionGroup( id = character(0), kind = character(0), domain = TccqDomain(), values = list(), outputs = character(0), accesses = list(), region_kind = character(0), target = character(0), effect = TccqEffect(), contract = NULL, attrs = list() )
id |
Stable fusion-group id. |
kind |
Fusion kind. |
domain |
Shared iteration domain. |
values |
List of IR values in the group. |
outputs |
Output value ids. |
accesses |
List of access mappings. |
region_kind |
Candidate execution region kind, or |
target |
Candidate implementation target, or |
effect |
Effect summary for the fused group. |
contract |
Typed fusion operation/storage contract. |
attrs |
Structured fusion attributes. |
Neutral procedural if statement
TccqIf( id = character(0), effect = TccqEffect(), condition = TccqExpression(), consequent = TccqBlock(), alternative = TccqBlock(), semantics = TccqCallSemantics() )TccqIf( id = character(0), effect = TccqEffect(), condition = TccqExpression(), consequent = TccqBlock(), alternative = TccqBlock(), semantics = TccqCallSemantics() )
id |
Stable statement id. |
effect |
Effect summary of evaluating the statement. |
condition |
Scalar logical condition expression. |
consequent |
Block evaluated when the condition is true. |
alternative |
Block evaluated when the condition is false. |
semantics |
Evaluator facts for the originating |
This value represents one scalar extraction only when every source axis has a TccqIndexProof. Proofs may share an iteration, as in a diagonal read. The stored access is zero-based; iterator cells retain R's one-based values. No general R subscript semantics are implied by this class.
TccqIndexedValue( id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), attrs = list(), source_type = TccqType(), index_proofs = list(), access = TccqAccess(), operation = TccqLoweredOperation(), semantics = TccqCallSemantics() )TccqIndexedValue( id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), attrs = list(), source_type = TccqType(), index_proofs = list(), access = TccqAccess(), operation = TccqLoweredOperation(), semantics = TccqCallSemantics() )
id |
Stable value id. |
op |
Operation name. |
inputs |
Input value ids or references. |
type |
Result type. |
effect |
Effect summary. |
attrs |
Structured operation attributes. |
source_type |
Type of the source storage. |
index_proofs |
Per-axis affine selector and bounds proofs. |
access |
Zero-based source access corresponding to the proofs. |
operation |
Lowered subscript implementation payload. |
semantics |
Evaluator facts for the originating |
An index expression maps one stored-tensor axis into the iteration space of
a loop nest as axis + offset, or to a constant position when axis is
empty. It is the typed unit of access maps, so stencil shifts, broadcasts,
and transposes are dimension facts rather than printed index strings.
TccqIndexExpr(axis = character(0), offset = integer(0))TccqIndexExpr(axis = character(0), offset = integer(0))
axis |
Iteration-axis name, or empty for a constant index. |
offset |
Signed integer offset (zero-based). |
An index proof ties one R iterator cell to one source axis. The iteration
establishes the cell range, index is the zero-based storage access, and
source_extent proves that the full affine access remains in bounds. A
non-zero offset additionally retains the resolved + call and its evaluator
facts; the range proof is what discharges integer overflow and subscript
warnings for that normalized selector.
TccqIndexProof( iterator = TccqWriteTarget(), selector = TccqCellReference(), iteration = TccqIterationPlan(), source_extent = TccqDim(), index = TccqIndexExpr(), operation = NULL, semantics = NULL )TccqIndexProof( iterator = TccqWriteTarget(), selector = TccqCellReference(), iteration = TccqIterationPlan(), source_extent = TccqDim(), index = TccqIndexExpr(), operation = NULL, semantics = NULL )
iterator |
Iterator target populated by the enclosing virtual loop. |
selector |
Direct reference to the iterator cell. |
iteration |
Virtual iteration establishing the selector range. |
source_extent |
Extent of the indexed source axis. |
index |
Zero-based affine storage index. |
operation |
Lowered selector operation for a shifted index, or |
semantics |
Evaluator facts for the shifted selector call, or |
An iteration plan separates one-time source evaluation from selection of the current element. Stored-vector iteration carries a typed element expression with an access map. Virtual unit sequences carry an affine index expression and the resolved operation implementation that defines the sequence.
TccqIterationPlan( source = TccqExpression(), domain = TccqDomain(), element = TccqExpression(), element_type = TccqType(), resolved_op = NULL, semantics = NULL, effect = TccqEffect() )TccqIterationPlan( source = TccqExpression(), domain = TccqDomain(), element = TccqExpression(), element_type = TccqType(), resolved_op = NULL, semantics = NULL, effect = TccqEffect() )
source |
Expression evaluated once to establish iteration. |
domain |
One-dimensional iteration domain. |
element |
Current element expression or affine induction value. |
element_type |
Scalar type assigned to the iteration cell. |
resolved_op |
Resolved operation for virtual iteration, or |
semantics |
Evaluator facts for the virtual iteration call, or |
effect |
Effect summary for source evaluation and element selection. |
An iteration spec describes an operation whose result can be consumed as a
virtual one-dimensional iteration space. The shared signature owns argument
and result typing; extent_arg selects the argument proving the domain
extent, while start defines the first affine induction value. The current
form deliberately represents unit-stride sequences only.
TccqIterationSpec( name = character(0), signature = TccqOpSignature(), extent_arg = integer(0), start = integer(0) )TccqIterationSpec( name = character(0), signature = TccqOpSignature(), extent_arg = integer(0), start = integer(0) )
name |
Human-readable iteration operation name. |
signature |
Shared operation signature. |
extent_arg |
One-based argument position supplying the domain extent. |
start |
First integer value produced by the iteration. |
Scalar literal value
TccqLiteral(kind = character(0), type = TccqType(), value = NULL)TccqLiteral(kind = character(0), type = TccqType(), value = NULL)
kind |
Literal kind. |
type |
Scalar type. |
value |
Literal payload. |
A local binding records the value produced by one top-level assignment in the declared subset. Its statement position is a semantic definition boundary used by scheduling; it is not source-printer metadata.
TccqLocalBinding( name = character(0), type = TccqType(), mutable = logical(0), value_id = character(0), statement_index = integer(0) )TccqLocalBinding( name = character(0), type = TccqType(), mutable = logical(0), value_id = character(0), statement_index = integer(0) )
name |
Binding name. |
type |
Binding type. |
mutable |
Whether the binding may be mutated. |
value_id |
Lowered value bound to the local name. |
statement_index |
One-based executable statement position defining the binding. |
Abstract parent for sequential loops whose body is a typed statement block. Concrete loop classes add their own entry and completion rules.
TccqLoop( id = character(0), effect = TccqEffect(), body = TccqBlock(), semantics = TccqCallSemantics() )TccqLoop( id = character(0), effect = TccqEffect(), body = TccqBlock(), semantics = TccqCallSemantics() )
id |
Stable statement id. |
effect |
Effect summary of evaluating the statement. |
body |
Procedural loop body. |
semantics |
Evaluator facts for the originating R loop special form. |
An axis is one dimension of a loop-nest iteration space: a stable name, a
typed extent, and a role. map axes produce output positions; reduce axes
fold into an accumulator.
TccqLoopAxis(name = character(0), extent = TccqDim(), role = character(0))TccqLoopAxis(name = character(0), extent = TccqDim(), role = character(0))
name |
Iteration-axis name. |
extent |
Typed axis extent. |
role |
Axis role, |
A loop guard records one branch decision that must select a loop nest. An
ordered list of guards is a control path from outermost to innermost branch;
source backends nest those guards around the same TccqLoopNest plan.
TccqLoopGuard( condition = TccqExpression(), branch = TccqBranch(), selected = logical(0) )TccqLoopGuard( condition = TccqExpression(), branch = TccqBranch(), selected = logical(0) )
condition |
Scalar logical condition expression. |
branch |
Source branch payload retaining R special-form semantics. |
selected |
Whether the consequent ( |
TccqLoopNest is the single backend-neutral iteration plan consumed by
source printers, in the spirit of the SAC with-loop. One loop nest carries
ordered typed axes (map axes produce output positions, reduce axes fold
into an accumulator), a value expression or typed statement block whose
references carry typed affine accesses, an optional closed reduction plan,
and an output access. Elementwise maps, full and per-axis
reductions, contractions, stencils, and control-valued results are all
instances of this one value; printers must not reintroduce per-family loop
shapes or backend-local control trees.
TccqLoopNest( id = character(0), domain = TccqDomain(), axes = list(), body = TccqExpression(), output = NULL, reduction = NULL, storage = TccqStorageSlot(), guards = list() )TccqLoopNest( id = character(0), domain = TccqDomain(), axes = list(), body = TccqExpression(), output = NULL, reduction = NULL, storage = TccqStorageSlot(), guards = list() )
id |
Stable loop-nest id. |
domain |
Iteration domain naming the axes. |
axes |
Ordered |
body |
Body expression or typed statement block with access-carrying references. |
output |
Output access over map axes, or |
reduction |
Closed neutral reduction plan for reduce axes, or |
storage |
Typed storage slot receiving the nest result. |
guards |
Ordered |
A transfer is structured control completion, not a read/write side effect. Its action always targets the nearest enclosing sequential loop.
TccqLoopTransfer( id = character(0), effect = TccqEffect(), action = character(0), semantics = TccqCallSemantics() )TccqLoopTransfer( id = character(0), effect = TccqEffect(), action = character(0), semantics = TccqCallSemantics() )
id |
Stable statement id. |
effect |
Effect summary of evaluating the statement. |
action |
Loop action, either |
semantics |
Evaluator facts for the originating R control special form. |
TccqLoweredOperation is the typed payload attached to operation values
after lowering. It keeps operation family, selected implementation,
signature, domain policy, and optional reducer facts together so later
passes do not branch on loose value attributes.
TccqLoweredOperation( family = character(0), resolved_op = TccqResolvedOp(), signature = TccqOpSignature(), domain_policy = NULL, elementwise = NULL, reduction = NULL, contraction = NULL, subscript = NULL, attrs = list() )TccqLoweredOperation( family = character(0), resolved_op = TccqResolvedOp(), signature = TccqOpSignature(), domain_policy = NULL, elementwise = NULL, reduction = NULL, contraction = NULL, subscript = NULL, attrs = list() )
family |
Lowered operation family. |
resolved_op |
Selected operation implementation. |
signature |
Shared operation signature. |
domain_policy |
Optional result-domain policy. |
elementwise |
Optional elementwise metadata. |
reduction |
Optional reduction metadata. |
contraction |
Optional contraction metadata. |
subscript |
Optional subscript metadata. |
attrs |
Structured metadata. |
A lowering plan is the typed result of lowering declared R language objects
into backend-neutral values, regions, and storage facts. Backend printers
consume this plan through TccqProgram; they do not re-discover compiler
semantics from source text.
TccqLoweringPlan( values = list(), result = NULL, schedule = NULL, regions = list(), storage_plan = NULL, diagnostics = list(), attrs = list() )TccqLoweringPlan( values = list(), result = NULL, schedule = NULL, regions = list(), storage_plan = NULL, diagnostics = list(), attrs = list() )
values |
List of lowered IR values. |
result |
Result value id, or |
schedule |
Optional ordered program evaluation schedule. |
regions |
List of executable code regions. |
storage_plan |
Optional middle-end storage plan. |
diagnostics |
List of diagnostics attached to lowering. |
attrs |
Structured lowering metadata. |
An operation body is one R expression whose symbols are bound by exact call
tags and then positionally through @parameters. Its call index preserves
the evaluator facts observed when the body was declared. Lowering expands
the body into ordinary typed values before fusion, loop-nest planning, or
backend rendering.
TccqOpBody( parameters = character(0), expression = quote(x), call_index = TccqCallIndex() )TccqOpBody( parameters = character(0), expression = quote(x), call_index = TccqCallIndex() )
parameters |
Ordered operation parameter names. |
expression |
Unevaluated R expression implementing the operation. |
call_index |
Typed calls and evaluator facts for |
Operation support query context
TccqOpContext( phase = character(0), target = character(0), region_kind = character(0), memory_space = character(0), allow_rapi = logical(0), allow_boundary = logical(0) )TccqOpContext( phase = character(0), target = character(0), region_kind = character(0), memory_space = character(0), allow_rapi = logical(0), allow_boundary = logical(0) )
phase |
Compiler phase issuing the query. |
target |
Requested implementation target, or |
region_kind |
Requested execution region kind, or |
memory_space |
Requested memory space, or |
allow_rapi |
Whether implementations touching the R C API are allowed. |
allow_boundary |
Whether explicit boundary implementations are allowed. |
Operation implementation descriptor
TccqOpImpl( op = character(0), target = character(0), region_kind = character(0), memory_space = character(0), uses_rapi = logical(0), boundary = logical(0), pure = logical(0), effect = TccqEffect(), supports = function() NULL, render = NULL, body = NULL, elementwise = NULL, reduction = NULL, contraction = NULL, iteration = NULL, subscript = NULL )TccqOpImpl( op = character(0), target = character(0), region_kind = character(0), memory_space = character(0), uses_rapi = logical(0), boundary = logical(0), pure = logical(0), effect = TccqEffect(), supports = function() NULL, render = NULL, body = NULL, elementwise = NULL, reduction = NULL, contraction = NULL, iteration = NULL, subscript = NULL )
op |
Operation or function name. |
target |
Implementation target, such as |
region_kind |
Region kind the implementation can run in, or |
memory_space |
Memory space the implementation expects, or |
uses_rapi |
Whether the implementation touches the R C API. |
boundary |
Whether the implementation crosses a boundary. |
pure |
Whether the implementation is semantically pure. |
effect |
Effect summary for calls handled by this implementation. |
supports |
Predicate receiving a |
render |
Optional source renderer receiving operand strings and a
|
body |
Optional backend-neutral operation body. |
elementwise |
Optional elementwise metadata. |
reduction |
Optional reduction metadata. |
contraction |
Optional contraction metadata. |
iteration |
Optional iteration metadata. |
subscript |
Optional subscript metadata. |
Implementations must explicitly opt into this trait before they can be used by an operation registry.
TccqOpImplementationTccqOpImplementation
Operation registry
TccqOpRegistry(implementations = list(), op_index = list())TccqOpRegistry(implementations = list(), op_index = list())
implementations |
List of operation implementations. |
op_index |
Named list from operation name to implementation positions,
used to resolve calls without scanning every implementation. Built by
|
Operation source-rendering context
TccqOpRenderContext( language = character(0), backend_id = character(0), attrs = list() )TccqOpRenderContext( language = character(0), backend_id = character(0), attrs = list() )
language |
Target source language. |
backend_id |
Backend requesting rendering. |
attrs |
Structured rendering metadata. |
A signature is the shared operation contract for argument count and result typing. It may also carry a domain policy for result shape. Elementwise, reduction, and future operation families should carry a signature instead of each inventing their own arity, shape, and type checks.
TccqOpSignature( name = character(0), arity = TccqArity(), result_type = function() NULL, domain_policy = NULL, attrs = list() )TccqOpSignature( name = character(0), arity = TccqArity(), result_type = function() NULL, domain_policy = NULL, attrs = list() )
name |
Human-readable operation signature name. |
arity |
A TccqArity contract. |
result_type |
Function from input |
domain_policy |
Optional result-shape policy. |
attrs |
Structured signature metadata. |
Program schema
TccqProgram( values = list(), result = NULL, name = character(0), formals = list(), schedule = NULL, regions = list(), diagnostics = list(), call_index = NULL, storage_plan = NULL, attrs = list() )TccqProgram( values = list(), result = NULL, name = character(0), formals = list(), schedule = NULL, regions = list(), diagnostics = list(), call_index = NULL, storage_plan = NULL, attrs = list() )
values |
List of IR values. |
result |
Result value id or object. |
name |
Program name. |
formals |
Named list of formal bindings. |
schedule |
Optional ordered program evaluation schedule. |
regions |
List of executable code regions. |
diagnostics |
List of diagnostics attached to the program. |
call_index |
Typed frontend call handoff. |
storage_plan |
Optional middle-end storage plan. |
attrs |
Structured program attributes. |
Marker parent for typed structured program bodies. Concrete bodies add lexical scope, statements, and value-completion contracts in the neutral expression layer.
TccqProgramBody()TccqProgramBody()
Optimizations explicitly opt into transformation and verification. The compiler invokes both through this contract before backend planning.
TccqProgramOptimizationTccqProgramOptimization
The schedule is the semantic owner of top-level R evaluation order. Its linear steps are contiguous after declarations are removed. A structured body is the mutually exclusive control-flow form. In either form, the schedule produces the declared program result. Lowering and backend planning consume this value rather than reconstructing statement order from value ids or source text.
TccqProgramSchedule(steps = list(), result = character(0), body = NULL)TccqProgramSchedule(steps = list(), result = character(0), body = NULL)
steps |
Ordered |
result |
Result value id produced by the final step. |
body |
Optional structured value-producing body. |
A reduction plan owns the reducer, its typed state, the optional condition guarding each transition, one typed assignment per state component, the completed-state projection, and an optional validity expression. No target source appears in this contract.
TccqReductionPlan( spec = TccqReductionSpec(), state = TccqReductionState(), condition = NULL, updates = list(), value = TccqExpression(), valid = NULL )TccqReductionPlan( spec = TccqReductionSpec(), state = TccqReductionState(), condition = NULL, updates = list(), value = TccqExpression(), valid = NULL )
spec |
Reduction implementation metadata. |
state |
Typed neutral state. |
condition |
Optional scalar logical transition condition. |
updates |
Ordered state-component assignments. |
value |
Scalar result projected from completed state. |
valid |
Optional scalar logical expression proving that |
A reduction spec is attached to an operation implementation when calls to that implementation can lower to a typed reduction state. Concrete subclasses define that state and its transition; the lowerer and source printers consume the shared protocol instead of recognizing reducer names.
TccqReductionSpec( name = character(0), signature = TccqOpSignature(), associative = logical(0), commutative = logical(0), empty_policy = character(0), attrs = list() )TccqReductionSpec( name = character(0), signature = TccqOpSignature(), associative = logical(0), commutative = logical(0), empty_policy = character(0), attrs = list() )
name |
Human-readable reduction name. |
signature |
Shared operation signature. |
associative |
Whether the reducer is associative under its declared semantics. |
commutative |
Whether the reducer is commutative under its declared semantics. |
empty_policy |
Behavior when no value contributes to the reduction. |
attrs |
Structured reduction metadata. |
Typed neutral reduction state
TccqReductionState(components = list())TccqReductionState(components = list())
components |
Named reduction-state components. |
A component is one typed scalar in a reducer's neutral state. Its semantic name is a portable identifier so backend interfaces can derive generated names without sanitizing arbitrary source text.
TccqReductionStateComponent( name = character(0), target = TccqWriteTarget(), identity = TccqLiteral() )TccqReductionStateComponent( name = character(0), target = TccqWriteTarget(), identity = TccqLiteral() )
name |
Semantic component name. |
target |
Neutral local target that stores the component. |
identity |
Initial scalar literal. |
Regions classify a group of IR values by where they may run and whether they
may touch the R C API. kernel, parallel, and device regions are
intended to be R-API-free.
TccqRegion( id = character(0), kind = character(0), values = list(), fusion_groups = list(), effect = TccqEffect(), memory_space = character(0), touches_rapi = logical(0), attrs = list() )TccqRegion( id = character(0), kind = character(0), values = list(), fusion_groups = list(), effect = TccqEffect(), memory_space = character(0), touches_rapi = logical(0), attrs = list() )
id |
Stable region id. |
kind |
Region kind. |
values |
List of IR values in the region. |
fusion_groups |
List of fusion groups in the region. |
effect |
Region effect summary. |
memory_space |
Dominant memory space for the region. |
touches_rapi |
Whether the region may call into the R C API. |
attrs |
Structured region attributes. |
A repeat loop enters its body unconditionally and relies on a typed loop transfer to terminate or begin another iteration.
TccqRepeat( id = character(0), effect = TccqEffect(), body = TccqBlock(), semantics = TccqCallSemantics() )TccqRepeat( id = character(0), effect = TccqEffect(), body = TccqBlock(), semantics = TccqCallSemantics() )
id |
Stable statement id. |
effect |
Effect summary of evaluating the statement. |
body |
Procedural loop body. |
semantics |
Evaluator facts for the originating R loop special form. |
A resolved operation records the implementation selected for one observed call in one operation context. Lowering and middle-end passes should carry this object rather than re-checking support from raw operation names.
TccqResolvedOp( call = TccqCall(), implementation = TccqOpImpl(), target = character(0), region_kind = character(0), memory_space = character(0), uses_rapi = logical(0), boundary = logical(0), pure = logical(0), effect = TccqEffect(), body = NULL, elementwise = NULL, reduction = NULL, contraction = NULL, iteration = NULL, subscript = NULL, attrs = list() )TccqResolvedOp( call = TccqCall(), implementation = TccqOpImpl(), target = character(0), region_kind = character(0), memory_space = character(0), uses_rapi = logical(0), boundary = logical(0), pure = logical(0), effect = TccqEffect(), body = NULL, elementwise = NULL, reduction = NULL, contraction = NULL, iteration = NULL, subscript = NULL, attrs = list() )
call |
Observed R call. |
implementation |
Selected operation implementation. |
target |
Selected implementation target. |
region_kind |
Region kind supplied by the implementation. |
memory_space |
Memory space supplied by the implementation. |
uses_rapi |
Whether the selected implementation touches the R C API. |
boundary |
Whether the selected implementation crosses a boundary. |
pure |
Whether the selected implementation is semantically pure. |
effect |
Effect summary supplied by the implementation. |
body |
Optional backend-neutral body supplied by the implementation. |
elementwise |
Optional elementwise metadata supplied by the implementation. |
reduction |
Optional reduction metadata supplied by the implementation. |
contraction |
Optional contraction metadata supplied by the implementation. |
iteration |
Optional iteration metadata supplied by the implementation. |
subscript |
Optional subscript metadata supplied by the implementation. |
attrs |
Structured resolution metadata. |
Compiler result value
TccqResult(success = logical(0), value = NULL, diagnostics = list())TccqResult(success = logical(0), value = NULL, diagnostics = list())
success |
Whether the phase completed without diagnostics. |
value |
Result value for the phase. |
diagnostics |
List of |
Shape value
TccqShape(rank = integer(0), dims = list())TccqShape(rank = integer(0), dims = list())
rank |
Number of dimensions. |
dims |
List of |
Base class for typed statements consumed by source backends. Concrete statement classes own their operands and control structure.
TccqStatement(id = character(0), effect = TccqEffect())TccqStatement(id = character(0), effect = TccqEffect())
id |
Stable statement id. |
effect |
Effect summary of evaluating the statement. |
A storage allocation is the physical storage identity assigned to one or more non-overlapping materialized temporary slots. Sharing an allocation is the representation of storage reuse; it is not inferred by source printers.
TccqStorageAllocation( id = character(0), type = TccqType(), memory_space = character(0) )TccqStorageAllocation( id = character(0), type = TccqType(), memory_space = character(0) )
id |
Stable allocation id. |
type |
Semantic storage type shared by every assigned slot. |
memory_space |
Memory space in which the allocation exists. |
A storage lifetime records the definition and last-use positions used by storage reuse planning. It is a typed optimization fact, not source-printer metadata.
TccqStorageLifetime( value_id = character(0), defined_at = integer(0), last_used_at = integer(0) )TccqStorageLifetime( value_id = character(0), defined_at = integer(0), last_used_at = integer(0) )
value_id |
Value whose lifetime is described. |
defined_at |
Linear definition position in schedule-derived value order. |
last_used_at |
Last position where the value must remain live. |
A storage plan belongs to the middle end. It is consumed by backends but does not depend on C, Fortran, TinyCC, or any concrete emitter.
TccqStoragePlan(slots = list())TccqStoragePlan(slots = list())
slots |
List of storage slots. |
A storage slot records whether a value is materialized, which typed lifetime it occupies, and which physical allocation owns a materialized temporary.
TccqStorageSlot( id = character(0), value_id = character(0), type = TccqType(), role = character(0), materialized = logical(0), lifetime = NULL, allocation = NULL )TccqStorageSlot( id = character(0), value_id = character(0), type = TccqType(), role = character(0), materialized = logical(0), lifetime = NULL, allocation = NULL )
id |
Stable storage-slot id. |
value_id |
Value owned by this slot. |
type |
Slot value type. |
role |
Storage role. |
materialized |
Whether storage exists at runtime. |
lifetime |
Optional typed liveness interval for storage reuse. |
allocation |
Physical allocation for a materialized temporary. |
A subscript spec describes one typed R indexing contract. The first slice is deliberately strict: one scalar integer selector per atomic source axis, with every enclosing iteration proving that its selector is one-based and in bounds. Other selector kinds require their own shape and bounds semantics.
TccqSubscriptSpec(name = character(0), signature = TccqOpSignature())TccqSubscriptSpec(name = character(0), signature = TccqOpSignature())
name |
Human-readable subscript operation name. |
signature |
Shared operation signature. |
A positional switch evaluates one scalar integer selector exactly once, then
evaluates at most one ordered alternative. An unmatched position evaluates
no alternative, matching numeric switch() returning NULL when its value
is used only for control. Character selection and value-producing switches
require separate representation work.
TccqSwitch( id = character(0), effect = TccqEffect(), selector = TccqExpression(), selector_target = TccqWriteTarget(), alternatives = list(), semantics = TccqCallSemantics() )TccqSwitch( id = character(0), effect = TccqEffect(), selector = TccqExpression(), selector_target = TccqWriteTarget(), alternatives = list(), semantics = TccqCallSemantics() )
id |
Stable statement id. |
effect |
Effect summary of evaluating the statement. |
selector |
Scalar integer selector expression. |
selector_target |
Typed local target for the evaluate-once selector. |
alternatives |
Ordered positional alternative blocks. |
semantics |
Evaluator facts for the originating |
Declared compiler type
TccqType(base = character(0), shape = TccqShape())TccqType(base = character(0), shape = TccqShape())
base |
Scalar or storage base type. |
shape |
Shape value. |
IR value
TccqValue( id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), attrs = list() )TccqValue( id = character(0), op = character(0), inputs = list(), type = TccqType(), effect = TccqEffect(), attrs = list() )
id |
Stable value id. |
op |
Operation name. |
inputs |
Input value ids or references. |
type |
Result type. |
effect |
Effect summary. |
attrs |
Structured operation attributes. |
A value block strengthens TccqBlock by requiring its terminal statement to write one typed result target on every path. Array loop nests and reducers consume this subtype; future procedural control can use the base block without fabricating a result value.
TccqValueBlock( id = character(0), locals = list(), statements = list(), effect = TccqEffect(), result = TccqWriteTarget() )TccqValueBlock( id = character(0), locals = list(), statements = list(), effect = TccqEffect(), result = TccqWriteTarget() )
id |
Stable block id. |
locals |
Ordered local write targets declared by the block. |
statements |
Ordered |
effect |
Exact effect summary of evaluating the statements. |
result |
Typed target produced on every terminal path through the block. |
This parent owns the value graph shared by lowering plans and programs. It gives expression construction one typed input contract without coupling the neutral expression layer to either pipeline container.
TccqValueGraph(values = list(), result = NULL)TccqValueGraph(values = list(), result = NULL)
values |
List of lowered IR values. |
result |
Result value id, or |
This is sequential recurrence, not a TccqLoopNest. The condition is re-evaluated before every iteration and the body may update explicitly declared mutable cells.
TccqWhile( id = character(0), effect = TccqEffect(), body = TccqBlock(), semantics = TccqCallSemantics(), condition = TccqExpression() )TccqWhile( id = character(0), effect = TccqEffect(), body = TccqBlock(), semantics = TccqCallSemantics(), condition = TccqExpression() )
id |
Stable statement id. |
effect |
Effect summary of evaluating the statement. |
body |
Procedural loop body. |
semantics |
Evaluator facts for the originating R loop special form. |
condition |
Scalar logical condition expression. |
A write target names a typed value destination without spelling it in C, Fortran, or another target language. Result targets are resolved through a loop nest's output plan; local targets are mapped to generated names by TccqBackendFunctionInterface. The semantic type retains the value domain, while the scalar storage type describes the element written at this target.
TccqWriteTarget( value_id = character(0), type = TccqType(), storage_type = TccqType(), kind = character(0), binding = NULL )TccqWriteTarget( value_id = character(0), type = TccqType(), storage_type = TccqType(), kind = character(0), binding = NULL )
value_id |
Stable value id written by the target. |
type |
Semantic value type. |
storage_type |
Scalar storage type written at the target. |
kind |
Target kind: |
binding |
Optional binding owned by the target. |