You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PTO candidate closure is blocked by PTO-ISA/pto-spec#166, which must reconcile the Local B.IOT SizeCode-12 contract/ASL/AVS contradiction.
Problem
The current range surface exposes raw encoding protocol in ordinary C++ templates:
Subview<Parent, SizeCode, Offset, RegSrc>
Assemble<Parent, ParentSizeCode, INIT, LAST, Offset, RegSrc>
This makes users supply values that LLVM can derive from semantic Tile def-use:
SrcSelect from the binder-local operand role;
RegSrc from normal GPR allocation;
uimm11 from affine offset decomposition;
SizeCode from the frozen parent/fragment descriptor;
INIT/MIDDLE/LAST/INIT_LAST from one assembly session and its commit boundary;
modifier adjacency and B.IOT.L from Blockify.
The current implementation is also not a general programming model: Subview is consumed only by TSTORE, Assemble only by TLOAD, and ordinary TileOPs such as TROWMAX/TEXP/TROWEXPAND*/TMATMUL do not accept range operands.
Proposal
C++17 source model
Ordinary users work with source view proxies and destination assembly sessions:
usingnamespacepto;usingnamespacepto::region;auto src = view(t2)[slice2d{
all,
span{4 * g, 4} // begin, extent
}];
auto out = make_local_assembly<ParentTile>(scope::all_pes);
TROWMAX(
out[slice2d{all, index{g}}],
src
);
auto whole = out.commit();
C++ cannot express Python [:, a:b] tokens inside operator[]; the public spelling uses:
There is no implicit equality between i, j, and k.
Local and Shared assembly
Local assembly may use an implicit session only when LLVM proves a unique non-escaping SSA lifetime. The explicit form is always available:
auto out = make_local_assembly<WholeTile>(scope::all_pes);
TADD(out[slice0], view(a)[slice1], view(b)[slice2]);
auto whole = out.commit();
Shared assembly is always explicit:
auto shared_out =
make_shared_assembly<WholeTile>(shared_parent, producer_scope);
TADD(shared_out[dst_region], lhs, rhs);
auto published = shared_out.commit();
auto consumer = view(published, consumer_scope)[src_region];
Shared object identity, producer mask, and consumer mask are distinct. Allocation freezes the descriptor but not a participant mask. commit() is a compiler marker that derives LAST; it is not a READY instruction. Shared reads still wait for whole_parent_ready && published.
Compiler-facing model
The frontend lowers source views to a non-storable region token and destination writes to a linear assembly session:
PACK128 is compiler semantic notation, not a proposed PTO instruction. If no assigned operation can prove the packing semantics, compilation fails closed.
Plain C surface
Plain C uses Clang-only opaque builtin types, not linkable C ABI symbols:
Parent, region-token, and assembly-session types are non-addressable and cannot be stored, copied through ABI, cast, placed in aggregates, or passed through varargs.
Raw compatibility layer
Raw Subview<..., SizeCode, Offset, RegSrc> and Assemble<..., INIT, LAST, ...> forms may remain temporarily under an explicit pto::raw_range or test-only namespace.
They are not the ordinary API and must never be selected as a silent fallback when semantic lowering fails.
Required compiler/API split
This RFC is not implementable as a cosmetic header wrapper over current inline asm. It requires:
exact PTO candidate release/SizeCode closure;
LLVM MC support for B.SUBVIEW/B.ASSEMBLE;
region/session target types and verifier;
generated operation-role/effect-class schema;
phase/coverage analysis;
MachineIR operands preserved through Tile SSA balance;
per-binder contiguous modifier emission in Blockify;
typed Clang builtins;
C++17 zero-semantics wrappers in this repository.
Validation requirements
every accepted Tile operation × operand role × generated effect class;
Local and Shared parent descriptor legality;
binder-local source role, including Shared operation ordinal != SrcSelect;
single/first/middle/last and multi-output atomic sessions;
Status
Proposed for RFC review. Not implemented and not compatible with the currently locked LinxISA/PTO 0.58.3 toolchain.
The architecture/compiler contract is under review in LinxISA/linx-isa#187. Staged implementation is tracked by LinxISA/linx-isa#188.
PTO candidate closure is blocked by PTO-ISA/pto-spec#166, which must reconcile the Local
B.IOTSizeCode-12 contract/ASL/AVS contradiction.Problem
The current range surface exposes raw encoding protocol in ordinary C++ templates:
This makes users supply values that LLVM can derive from semantic Tile def-use:
SrcSelectfrom the binder-local operand role;RegSrcfrom normal GPR allocation;uimm11from affine offset decomposition;INIT/MIDDLE/LAST/INIT_LASTfrom one assembly session and its commit boundary;B.IOT.Lfrom Blockify.The current implementation is also not a general programming model:
Subviewis consumed only by TSTORE,Assembleonly by TLOAD, and ordinary TileOPs such as TROWMAX/TEXP/TROWEXPAND*/TMATMUL do not accept range operands.Proposal
C++17 source model
Ordinary users work with source
viewproxies and destinationassemblysessions:C++ cannot express Python
[:, a:b]tokens insideoperator[]; the public spelling uses:Each operand has an independent region expression:
There is no implicit equality between
i,j, andk.Local and Shared assembly
Local assembly may use an implicit session only when LLVM proves a unique non-escaping SSA lifetime. The explicit form is always available:
Shared assembly is always explicit:
Shared object identity, producer mask, and consumer mask are distinct. Allocation freezes the descriptor but not a participant mask.
commit()is a compiler marker that derivesLAST; it is not a READY instruction. Shared reads still wait forwhole_parent_ready && published.Compiler-facing model
The frontend lowers source views to a non-storable region token and destination writes to a linear assembly session:
LLVM, not the API user, derives:
RegSrc/uimm11INIT/LASTAll session operations, Shared source views, and region-aware TileOP consumers are
convergent/noduplicateand carry one LLVM convergence domain.V1 restrictions
The first version intentionally stays narrow:
128-byte CELL rule
A logical result smaller than 128 B is not a direct
B.ASSEMBLEwriter.This must be rejected:
when successive
gvalues would overlap one architectural CELL.Legalization must first create one real, fully defined 128 B carrier, for example through an exact reviewed TINSERT/packing sequence:
PACK128is compiler semantic notation, not a proposed PTO instruction. If no assigned operation can prove the packing semantics, compilation fails closed.Plain C surface
Plain C uses Clang-only opaque builtin types, not linkable C ABI symbols:
Parent, region-token, and assembly-session types are non-addressable and cannot be stored, copied through ABI, cast, placed in aggregates, or passed through varargs.
Raw compatibility layer
Raw
Subview<..., SizeCode, Offset, RegSrc>andAssemble<..., INIT, LAST, ...>forms may remain temporarily under an explicitpto::raw_rangeor test-only namespace.They are not the ordinary API and must never be selected as a silent fallback when semantic lowering fails.
Required compiler/API split
This RFC is not implementable as a cosmetic header wrapper over current inline asm. It requires:
B.SUBVIEW/B.ASSEMBLE;Validation requirements
SrcSelect;B.IOT.Land modifier adjacency;Review questions
view(tile)[slice2d{...}]the preferred source spelling?make_local_assemblyeverywhere?pto::raw_range, or become tests-only immediately?level-oneSHA, if different from publicbisheng-linxcommit631961c3?Decision requested
Please review the programming model and answer the questions above. No implementation or TileOP merge should begin until: