Files
torus/docs/dev/api/torus.fhe.compilation.wiring.md
zeekay f968edf75a Rename the Concrete dialect and project identifiers to Torus
The MLIR dialect, its conversion passes (TFHEToConcrete, ConcreteToCAPI,
ConcreteToLLVM), the optimizer component, the compiler binary, the Rust
crate and the program_info parameter file all still carried the upstream
project's name. They now carry this one's.

Two things deliberately keep the word, because in them it is not the name.
mlir::OpTrait CRTP parameters mean "the derived type", so they are spelled
Derived and OpTy — LLVM's other conventional spelling for the same idiom.
concreteShape is a capnp field: renaming it would change the serialized
protocol, and the prose describing it is ordinary English.

This also repairs references the earlier partial rename left dangling:
Security.cpp included concrete/curves.gen.h and the directory is torus/,
torus-cpu.h included concrete-num_complex.h, the Torus dialect CMakeLists
named ConcreteOps.td, and compiler/setup.py asked find_namespace_packages
for a "concrete" package that no longer exists — so it built without the
package it ships.
2026-08-27 13:17:38 -07:00

8.0 KiB

module torus.fhe.compilation.wiring

Declaration of wiring related class.

Global Variables

  • TYPE_CHECKING

class NotComposable

Composition policy that does not allow the forwarding of any output to any input.


method get_rules_iter

get_rules_iter(_funcs: list['FunctionDef']) → Iterable[CompositionRule]

Return an iterator over composition rules.


class AllComposable

Composition policy that allows to forward any output of the module to any of its input.


method get_rules_iter

get_rules_iter(funcs: list[Graph]) → Iterable[CompositionRule]

Return an iterator over composition rules.


class WireOutput

A protocol for wire outputs.


method get_outputs_iter

get_outputs_iter() → Iterable[CompositionClause]

Return an iterator over the possible outputs of the wire output.


class WireInput

A protocol for wire inputs.


method get_inputs_iter

get_inputs_iter() → Iterable[CompositionClause]

Return an iterator over the possible inputs of the wire input.


class Output

The output of a given function of a module.


method get_outputs_iter

get_outputs_iter() → Iterable[CompositionClause]

Return an iterator over the possible outputs of the wire output.


class AllOutputs

All the encrypted outputs of a given function of a module.


method get_outputs_iter

get_outputs_iter() → Iterable[CompositionClause]

Return an iterator over the possible outputs of the wire output.


class Input

The input of a given function of a module.


method get_inputs_iter

get_inputs_iter() → Iterable[CompositionClause]

Return an iterator over the possible inputs of the wire input.


class AllInputs

All the encrypted inputs of a given function of a module.


method get_inputs_iter

get_inputs_iter() → Iterable[CompositionClause]

Return an iterator over the possible inputs of the wire input.


class Wire

A forwarding rule between an output and an input.


method get_rules_iter

get_rules_iter(_) → Iterable[CompositionRule]

Return an iterator over composition rules.


class Wired

Composition policy which allows the forwarding of certain outputs to certain inputs.

method __init__

__init__(wires: Optional[set[Wire]] = None)

method get_rules_iter

get_rules_iter(funcs: list[Graph]) → Iterable[CompositionRule]

Return an iterator over composition rules.


class TracedOutput

A wrapper type used to trace wiring.

Allows to tag an output value coming from an other module function, and binds it with information about its origin.


class WireTracingContextManager

A context manager returned by the wire_pipeline method.

Activates wire tracing and yields an inputset that can be iterated on for tracing.

method __init__

__init__(module, inputset)