PTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY
PTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARYASL pseudocode
The complete ASL owner is shown directly below.
// PTO-UNIT: {"id":"PTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY","surface":"tile","classification":["model","definedness","packed-boundary"],"depends_on":["PTO-TILE-MODEL-STATE-TYPES"]}// Large logical Tiles use the existing 32768 Word payload slots as complete// carriers. One carrier holds 16, 8, 4, 2, or 1 logical elements according to// element width. The companion definedness map is total, so every accepted// 256 KiB descriptor is representable without a 524288-Word TileInfo.pure func PackedTileDataTypeIsFourBit(data_type: TileDataType) => booleanbegin return data_type == TileDataType_E2M1X2 || data_type == TileDataType_E1M2X2 || data_type == TileDataType_HiF4X2 || data_type == TileDataType_S4X2 || data_type == TileDataType_U4X2;end;
pure func PackedTileElementBits(data_type: TileDataType) => integer {4,8,16,32,64}begin return TileElementBits(data_type);end;
pure func PackedTileElementsPerCarrier( data_type: TileDataType) => integer {1,2,4,8,16}begin return (64 DIVRM PackedTileElementBits(data_type)) as integer {1,2,4,8,16};end;
readonly func PackedTileLogicalCapacity(capacity_bytes: integer {0..262144}, data_type: TileDataType) => integer {1..524288}begin assert capacity_bytes > 0; return ((capacity_bytes * 8) DIVRM PackedTileElementBits(data_type)) as integer {1..524288};end;
readonly func TilePackedCarrierIndex(data_type: TileDataType, element: PackedTileElementIndex) => PackedTileCarrierIndexbegin var carrier: integer = 0; carrier = element DIVRM PackedTileElementsPerCarrier(data_type); assert carrier < PTO_MODEL_TILE_ELEMENTS; return carrier as PackedTileCarrierIndex;end;
readonly func TilePackedLaneIndex(data_type: TileDataType, element: PackedTileElementIndex) => PackedTileLaneIndexbegin var lane: integer = 0; lane = element MOD PackedTileElementsPerCarrier(data_type); assert lane <= 15; return lane as PackedTileLaneIndex;end;
pure func PackedTileNibbleFromWord(word: Word, nibble: PackedTileLaneIndex) => bits(4)begin case nibble of when 0 => return word[3:0]; when 1 => return word[7:4]; when 2 => return word[11:8]; when 3 => return word[15:12]; when 4 => return word[19:16]; when 5 => return word[23:20]; when 6 => return word[27:24]; when 7 => return word[31:28]; when 8 => return word[35:32]; when 9 => return word[39:36]; when 10 => return word[43:40]; when 11 => return word[47:44]; when 12 => return word[51:48]; when 13 => return word[55:52]; when 14 => return word[59:56]; when 15 => return word[63:60]; end;end;
pure func PackedTileWordWithNibble(word: Word, nibble: PackedTileLaneIndex, value: Word) => Wordbegin var result = word; case nibble of when 0 => result[3:0] = value[3:0]; when 1 => result[7:4] = value[3:0]; when 2 => result[11:8] = value[3:0]; when 3 => result[15:12] = value[3:0]; when 4 => result[19:16] = value[3:0]; when 5 => result[23:20] = value[3:0]; when 6 => result[27:24] = value[3:0]; when 7 => result[31:28] = value[3:0]; when 8 => result[35:32] = value[3:0]; when 9 => result[39:36] = value[3:0]; when 10 => result[43:40] = value[3:0]; when 11 => result[47:44] = value[3:0]; when 12 => result[51:48] = value[3:0]; when 13 => result[55:52] = value[3:0]; when 14 => result[59:56] = value[3:0]; when 15 => result[63:60] = value[3:0]; end; return result;end;
pure func PackedTileElementFromWord(word: Word, lane: PackedTileLaneIndex, data_type: TileDataType) => Wordbegin let element_bits = PackedTileElementBits(data_type); if element_bits == 4 then return ZeroExtend{PTO_XLEN}(PackedTileNibbleFromWord(word, lane)); elsif element_bits == 8 then assert lane <= 7; if lane == 0 then return ZeroExtend{PTO_XLEN}(word[7:0]); elsif lane == 1 then return ZeroExtend{PTO_XLEN}(word[15:8]); elsif lane == 2 then return ZeroExtend{PTO_XLEN}(word[23:16]); elsif lane == 3 then return ZeroExtend{PTO_XLEN}(word[31:24]); elsif lane == 4 then return ZeroExtend{PTO_XLEN}(word[39:32]); elsif lane == 5 then return ZeroExtend{PTO_XLEN}(word[47:40]); elsif lane == 6 then return ZeroExtend{PTO_XLEN}(word[55:48]); else return ZeroExtend{PTO_XLEN}(word[63:56]); end; elsif element_bits == 16 then assert lane <= 3; if lane == 0 then return ZeroExtend{PTO_XLEN}(word[15:0]); elsif lane == 1 then return ZeroExtend{PTO_XLEN}(word[31:16]); elsif lane == 2 then return ZeroExtend{PTO_XLEN}(word[47:32]); else return ZeroExtend{PTO_XLEN}(word[63:48]); end; elsif element_bits == 32 then assert lane <= 1; if lane == 0 then return ZeroExtend{PTO_XLEN}(word[31:0]); else return ZeroExtend{PTO_XLEN}(word[63:32]); end; end; assert element_bits == 64 && lane == 0; return word;end;
pure func PackedTileWordWithElement(word: Word, lane: PackedTileLaneIndex, data_type: TileDataType, value: Word) => Wordbegin let element_bits = PackedTileElementBits(data_type); if element_bits == 4 then return PackedTileWordWithNibble(word, lane, value); end; var result = word; if element_bits == 8 then assert lane <= 7; if lane == 0 then result[7:0] = value[7:0]; elsif lane == 1 then result[15:8] = value[7:0]; elsif lane == 2 then result[23:16] = value[7:0]; elsif lane == 3 then result[31:24] = value[7:0]; elsif lane == 4 then result[39:32] = value[7:0]; elsif lane == 5 then result[47:40] = value[7:0]; elsif lane == 6 then result[55:48] = value[7:0]; else result[63:56] = value[7:0]; end; elsif element_bits == 16 then assert lane <= 3; if lane == 0 then result[15:0] = value[15:0]; elsif lane == 1 then result[31:16] = value[15:0]; elsif lane == 2 then result[47:32] = value[15:0]; else result[63:48] = value[15:0]; end; elsif element_bits == 32 then assert lane <= 1; if lane == 0 then result[31:0] = value[31:0]; else result[63:32] = value[31:0]; end; else assert element_bits == 64 && lane == 0; result = value; end; return result;end;
readonly func ZeroPackedTileDefinedElements() => PackedTileDefinedElementsbegin return Zeros{524288};end;
readonly func TilePackedLinearIndex(tile: TileInfo, row: integer {0..65535}, column: integer {0..65535}) => PackedTileElementIndexbegin assert !TileLayoutIsCube(tile.layout); assert row < tile.rows && column < tile.columns; var index: integer = 0; if tile.layout == TileLayout_RowMajor then index = row * tile.columns + column; elsif tile.layout == TileLayout_ColumnMajor then index = column * tile.rows + row; else let inner_elements = (256 DIV PackedTileElementBits(tile.data_type)) as integer {4,8,16,32,64}; let block_rows: integer = tile.rows DIVRM 16; let block_columns: integer = tile.columns DIVRM inner_elements; let block_row: integer = row DIVRM 16; let block_column: integer = column DIVRM inner_elements; let inner_row: integer = row MOD 16; let inner_column: integer = column MOD inner_elements; let block_elements: integer = 16 * inner_elements; if tile.layout == TileLayout_ZN then index = (block_row * block_columns + block_column) * block_elements + inner_column * 16 + inner_row; else assert tile.layout == TileLayout_NZ; index = (block_column * block_rows + block_row) * block_elements + inner_row * inner_elements + inner_column; end; end; assert index < PackedTileLogicalCapacity(tile.capacity_bytes, tile.data_type); return index as PackedTileElementIndex;end;
readonly func TileUsesPackedCarrierRepresentation(tile: TileInfo) => booleanbegin return !TileLayoutIsCube(tile.layout) && (PackedTileDataTypeIsFourBit(tile.data_type) || tile.rows * tile.columns > PTO_MODEL_TILE_ELEMENTS);end;
readonly func TileLogicalElementDefined(tile: TileInfo, element: PackedTileElementIndex) => booleanbegin if TileUsesPackedCarrierRepresentation(tile) then return tile.packed_defined_elements[element] == '1'; end; return tile.defined_elements[element as ModelTileElementIndex] == '1';end;
readonly func TileReadLogicalElement(tile: TileInfo, element: PackedTileElementIndex) => Wordbegin if TileUsesPackedCarrierRepresentation(tile) then let carrier = TilePackedCarrierIndex(tile.data_type, element); let lane = TilePackedLaneIndex(tile.data_type, element); return PackedTileElementFromWord( tile.payload[[carrier]], lane, tile.data_type); end; return tile.payload[[element as ModelTileElementIndex]];end;
// A newly allocated decoded TLOAD destination may have a complete physical// packed shape while every selected GM byte is zero. This helper preserves// the ordinary TLOAD result (zero payload, full valid-region definedness) in// one carrier-state update; it is used only by the executable model's// zero-stride fast path, never as an architectural alternate representation.func TileWithPackedZeroValidRegionDefined(tile: TileInfo) => TileInfobegin assert PackedTileDataTypeIsFourBit(tile.data_type); assert tile.valid_rows == tile.rows && tile.valid_columns == tile.columns; assert tile.rows * tile.columns == PackedTileLogicalCapacity(tile.capacity_bytes, tile.data_type); var result = tile; result.packed_defined_elements = Ones{524288}; result.defined_valid_elements = (tile.valid_rows * tile.valid_columns) as integer {0..524288}; result.contents_defined = TRUE; return result;end;
func TileWithPackedZeroSelectedMaxRegionDefined(tile: TileInfo, pe_mask: bits(4)) => TileInfobegin assert PackedTileDataTypeIsFourBit(tile.data_type); assert tile.capacity_bytes == 262144; assert tile.valid_rows == tile.rows && tile.valid_columns == tile.columns; assert tile.rows * tile.columns == PackedTileLogicalCapacity(tile.capacity_bytes, tile.data_type); var result = tile; result.packed_defined_elements = Zeros{524288}; if pe_mask[PTOPEMaskBitOfPEIdentity(0)] == '1' then result.packed_defined_elements[0 +: 131072] = Ones{131072}; end; if pe_mask[PTOPEMaskBitOfPEIdentity(1)] == '1' then result.packed_defined_elements[131072 +: 131072] = Ones{131072}; end; if pe_mask[PTOPEMaskBitOfPEIdentity(2)] == '1' then result.packed_defined_elements[262144 +: 131072] = Ones{131072}; end; if pe_mask[PTOPEMaskBitOfPEIdentity(3)] == '1' then result.packed_defined_elements[393216 +: 131072] = Ones{131072}; end; result.defined_valid_elements = (tile.valid_rows * tile.valid_columns) as integer {0..524288}; result.contents_defined = pe_mask == '1111'; return result;end;
readonly func TileInfoWithLogicalElementAndDefined(tile: TileInfo, element: PackedTileElementIndex, value: Word, defined: boolean) => TileInfobegin var result = tile; if TileUsesPackedCarrierRepresentation(tile) then let carrier = TilePackedCarrierIndex(tile.data_type, element); let lane = TilePackedLaneIndex(tile.data_type, element); result.payload[[carrier]] = PackedTileWordWithElement( tile.payload[[carrier]], lane, tile.data_type, value); result.packed_defined_elements[element] = if defined then '1' else '0'; else result.payload[[element as ModelTileElementIndex]] = value; result.defined_elements[element as ModelTileElementIndex] = if defined then '1' else '0'; end; return result;end;
readonly func TileInfoWithLogicalElement(tile: TileInfo, element: PackedTileElementIndex, value: Word) => TileInfobegin return TileInfoWithLogicalElementAndDefined(tile, element, value, TRUE);end;
func WriteTileLogicalElement(index: TileIndex, element: PackedTileElementIndex, value: Word)begin _Tiles[[index]] = TileInfoWithLogicalElement( _Tiles[[index]], element, value);end;
readonly func ReadTileLogicalElement(index: TileIndex, element: PackedTileElementIndex) => Wordbegin let tile = _Tiles[[index]]; assert TileLogicalElementDefined(tile, element); return TileReadLogicalElement(tile, element);end;
Architecture behavior
This internal model unit is documented through its normative ASL/NDF owners and validation evidence; it has no reader-guide migration target.
NDF clauses
Bodies come from owning ASL. Dragging or buttons change only this page-session view order.
No NDF clause is attached to this unit.
Evidence index
9 matching entries
Executable evidence3
The bounded Word-carrier model represents every legal element width at the maximum Shared capacity.
- surfaceTILE
- ownerPTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY
- categoryBOUNDARY
- case002
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-TILE-CARRIER-WIDTHS-002- Path
tests/asl/tile/model/definedness/packed-boundary/tile-bound-definedness-carrier-widths-002.asl- Kind / role
- boundary
- Requirements
- PTO-INST-BLOCK-B-IOS
- Pass condition
- U4, S8, S16, S32, and S64 descriptors address, define, write, and read their final logical element through carrier 32767 without narrowing capacity.
- SHA-256
91a71f35c0f29f20b21985a91cfc54c89d4ef880482d86b5bd49f3e5f141b85c
PTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY compiles as an independent normative unit
- surfaceTILE
- ownerPTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY
- categorySTATIC-INVARIANT
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY-STATIC-001- Path
tests/asl/tile/model/definedness/packed-boundary/tile-static-packed-boundary-contract-001.asl- Kind / role
- static-invariant
- Pass condition
- the complete model and this unit's static invariant compile
- SHA-256
5d3ae7a6c432ce2be46391ca085f5bb468ab49ededb7855dfdbf4d5f4c858fb0
Decoded BSTART.TLOAD Local B.IOT SizeCode=10 and Shared B.IOS SizeCode=12 commit their maximum packed U4 shapes through dispatch, binding, translated preflight, and execution before carrier-tail observation.
- surfaceTILE
- ownerPTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY
- categoryBOUNDARY
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-TILE-PACKED-CAPACITY-BOUNDARY-001- Path
tests/asl/tile/model/definedness/packed-boundary/tile-bound-definedness-packed-capacity-001.asl- Kind / role
- boundary
- Pass condition
- The Local path commits a 64 KiB/U4 shape and observes logical indices 65536 and 131071; the Shared path independently commits a 256 KiB/U4 shape and observes indices 393216 and 524287. Equivalent page-faulting translated probes reject both paths before destination or Shared descriptor publication.
- SHA-256
a8db73d519a9a330f9779b72d0065c724a46e55647caa5eaa7d8c62ad7b949c5
Commit-scoped evidence5
spec/evidence/release-traceability-readiness.json · closed
PTO-EVIDENCE-RELEASE-TRACEABILITYSources and references
- Complete stable ID
PTO-EVIDENCE-RELEASE-TRACEABILITY- Path
spec/evidence/release-traceability-readiness.json- Kind / role
- ASL/NDF/documentation/AVS traceability
- SHA-256
c7327021d39dc67ac5564bc55073b3870a397d79ac8d9648284d56e33bc14a3e
spec/evidence/instruction-contract-closure.json · closed
PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURESources and references
- Complete stable ID
PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE- Path
spec/evidence/instruction-contract-closure.json- Kind / role
- mnemonic and encoding contract closure
- SHA-256
3ef2bb62421c79dff8fa77a1c7983923b523244b8090812883ef81286ca8106a
spec/evidence/architecture-readiness.json · open
PTO-EVIDENCE-ARCHITECTURE-READINESSSources and references
- Complete stable ID
PTO-EVIDENCE-ARCHITECTURE-READINESS- Path
spec/evidence/architecture-readiness.json- Kind / role
- architecture maturity and blockers
- SHA-256
4b0b85199101251bea744e0f3591cc31906909dc80d5ab651c417a936036a004
spec/evidence/release-gate-readiness.json · ready-for-exact-head-verification
PTO-EVIDENCE-RELEASE-GATE-READINESSSources and references
- Complete stable ID
PTO-EVIDENCE-RELEASE-GATE-READINESS- Path
spec/evidence/release-gate-readiness.json- Kind / role
- exact-head gate readiness
- SHA-256
a0f4d2b6920c08981ea55fd8ef820708a40d4feb5402c5150e8e9ab532d84ce0
spec/release-manifest.json · draft
PTO-EVIDENCE-RELEASE-MANIFESTSources and references
- Complete stable ID
PTO-EVIDENCE-RELEASE-MANIFEST- Path
spec/release-manifest.json- Kind / role
- release content and encoding fingerprints
- SHA-256
1a64c109ed7a90351c41e2a418b3c0ebaf8ad975838986d2101385186b85c0d8
Decision history1
Re-encode B.IOT and B.IOS size and PE mode fields · accepted
- decision recordADR
- case0096
Decision record
Loading ADR-0096…
Sources and references
- Complete stable ID
ADR-0096- Path
docs/status/decisions/0096-b-iot-b-ios-sizecode-pemode.md- Affected units
- PTO-ARCH-DATA-TYPES-INTEGER, PTO-ARCH-FEATURES-TILE-ALLOCATION, PTO-ARCH-MEMORY-MODEL-GLOBAL-MEMORY-ACCESS, PTO-ARCH-PROFILE-RESET, PTO-ARCH-PROGRAMMING-MODEL-CORE-PE-TOPOLOGY, PTO-BLOCK-B-IOS, PTO-BLOCK-B-IOT, PTO-BLOCK-MODEL-DISPATCH-COMMANDS, PTO-BLOCK-MODEL-DISPATCH-CUBE-TMATMUL, PTO-BLOCK-MODEL-DISPATCH-DESTINATION-SHAPE, PTO-BLOCK-MODEL-DISPATCH-SHARED-CUBE-MATRIX, PTO-BLOCK-MODEL-DISPATCH-SHARED-TLSU, PTO-BLOCK-MODEL-OPERANDS-SHARED-BINDINGS, PTO-BLOCK-MODEL-OPERANDS-TILE-BINDINGS, PTO-BLOCK-MODEL-SCHEMA-PROFILE-ENCODING, PTO-BLOCK-MODEL-STATE-TYPES, PTO-TILE-MODEL-DEFINEDNESS-ELEMENTS, PTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY, PTO-TILE-MODEL-EXECUTION-COMPARISON, PTO-TILE-MODEL-EXECUTION-COMPLEX, PTO-TILE-MODEL-EXECUTION-CUBE, PTO-TILE-MODEL-EXECUTION-ELEMENTWISE, PTO-TILE-MODEL-EXECUTION-EXPANSION, PTO-TILE-MODEL-EXECUTION-FUSED-MULTIPLY-ADD, PTO-TILE-MODEL-EXECUTION-GENERATION, PTO-TILE-MODEL-EXECUTION-IMAGE-TO-COLUMN, PTO-TILE-MODEL-EXECUTION-INDEXED-REARRANGEMENT, PTO-TILE-MODEL-EXECUTION-REARRANGEMENT, PTO-TILE-MODEL-EXECUTION-REDUCTION, PTO-TILE-MODEL-EXECUTION-SORTING, PTO-TILE-MODEL-EXECUTION-UNARY, PTO-TILE-MODEL-LEGALITY-ALLOCATION-CAPACITY, PTO-TILE-MODEL-LEGALITY-DESCRIPTOR-SHAPE, PTO-TILE-MODEL-LEGALITY-IMAGE-TO-COLUMN, PTO-TILE-MODEL-LEGALITY-INDEXED-REARRANGEMENT, PTO-TILE-MODEL-LEGALITY-MATRIX-INFO-DESCRIPTOR, PTO-TILE-MODEL-LEGALITY-MATRIX-POSTPROCESS, PTO-TILE-MODEL-LEGALITY-PE-MASK, PTO-TILE-MODEL-MEMORY-LOAD-STORE, PTO-TILE-MODEL-MEMORY-SHARED-MOVEMENT, PTO-TILE-MODEL-NUMERIC-FORMATS, PTO-TILE-MODEL-ORDERING-SORTING, PTO-TILE-MODEL-SHAPE-VALID-REGION, PTO-TILE-MODEL-STATE-ALLOCATION, PTO-TILE-MODEL-STATE-DESCRIPTORS, PTO-TILE-MODEL-STATE-FEATURE-MAP-DESCRIPTORS, PTO-TILE-MODEL-STATE-SHARED-REGISTERS, PTO-TILE-MODEL-STATE-TYPES, PTO-TILE-TLOAD
- Affected NDF
- PTO-ARCH-GM-ACCESS-001, PTO-B-IOS-SHARED-STATE-001, PTO-B-IOT-STREAM-001, PTO-CUBE-ACCUMULATOR-OUTPUT-001, PTO-TLOAD-CUBE-001, PTO-TLOAD-MEMORY-001
- SHA-256
c4b4fb7bc17878f710015207dc19ddaf22a0cf6989d185b16844714c71e23f62
Unit metadata
Open 4 generated metadata fields
Open generated traceability record
{
"classification": [
"model",
"definedness",
"packed-boundary"
],
"documentation": "docs/tile/model/definedness/packed-boundary.md",
"id": "PTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY",
"mnemonic": null,
"readiness_subjects": [
"ADR-0096"
],
"semantic_tests": [
"PTO-AVS-TILE-CARRIER-WIDTHS-002",
"PTO-AVS-TILE-PACKED-CAPACITY-BOUNDARY-001"
],
"source": "asl/tile/model/definedness/packed-boundary.asl",
"surface": "tile",
"tests": [
"PTO-AVS-TILE-CARRIER-WIDTHS-002",
"PTO-AVS-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY-STATIC-001",
"PTO-AVS-TILE-PACKED-CAPACITY-BOUNDARY-001"
]
}Sources and release identity
Show commit, paths, hashes, version, and canonical owners
- Release
0.58.5· Release candidate- Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812- Original ASL
- asl/tile/model/definedness/packed-boundary.asl
- ASL SHA-256
5c76ed856b225b2e097700c7459f21131c8421791ea8877e78fe47cfa6e8e0c9- Generated documentation
- docs/tile/model/definedness/packed-boundary.md · embedded in this page
- Documentation SHA-256
3f846f0a231a472f67d73c61c19e430c6d259c762b65e996816c193c6480eb04
Exact owners
- ASL PTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY
asl/tile/model/definedness/packed-boundary.asl