Skip to main content

PTO-TILE-MODEL-EXECUTION-SORTING

PTO-TILE-MODEL-EXECUTION-SORTING

ASL pseudocode

The complete ASL owner is shown directly below.

// PTO-UNIT: {"id":"PTO-TILE-MODEL-EXECUTION-SORTING","surface":"tile","classification":["model","execution","sorting"],"depends_on":["PTO-TILE-MODEL-LEGALITY-SORTING"]}
func TSORT(    destination: TileIndex,    destination_indices: TileIndex,    source: TileIndex,    sort_width: integer {1..64},    descending: boolean)begin    assert TileOperandsLegal_TSORT(        destination,        destination_indices,        source,        sort_width,        descending);
    let source_tile = _Tiles[[source]];    let source_has_signaling_nan =        TileSortSourceHasSignalingNaN(source);    assert source_tile.valid_columns >= 1;    let column_count =        source_tile.valid_columns as integer {1..65535};    var result_values = _Tiles[[destination]];    var result_indices = _Tiles[[destination_indices]];    var values = source_tile;    var indices = result_indices;
    for row = 0 to source_tile.valid_rows - 1 looplimit 65536 do        for column = 0 to source_tile.valid_columns - 1 looplimit 65536 do            let element = TileLogicalLinearIndex(                source_tile,                row as integer {0..65535},                column as integer {0..65535});            indices = TileInfoWithLogicalElement(indices, element,                Zeros{PTO_XLEN} + (column MOD sort_width));        end;
        let group_count: integer {1..65535} =            ((column_count - 1) DIVRM sort_width) + 1;        for group = 0 to group_count - 1 looplimit 65536 do            let group_begin = (group * sort_width)                as integer {0..65535};            let group_end =                if group_begin + sort_width < column_count then                    group_begin + sort_width                else                    column_count;
            for sort_pass = 0 to 63 do                for offset = 0 to 62 do                    let left_column = group_begin + offset;                    if left_column + 1 < group_end then                        let left_element = TileLogicalLinearIndex(                            source_tile,                            row as integer {0..65535},                            left_column as integer {0..65535});                        let right_element = TileLogicalLinearIndex(                            source_tile,                            row as integer {0..65535},                            (left_column + 1) as integer {0..65535});                        if !TileSortLeftBefore(                               TileReadLogicalElement(values, left_element),                               TileReadLogicalElement(values, right_element),                               descending,                               source_tile.data_type) then                            let left_value =                                TileReadLogicalElement(values, left_element);                            let right_value =                                TileReadLogicalElement(values, right_element);                            values = TileInfoWithLogicalElement(                                values, left_element, right_value);                            values = TileInfoWithLogicalElement(                                values, right_element, left_value);
                            let left_index =                                TileReadLogicalElement(indices, left_element);                            let right_index =                                TileReadLogicalElement(indices, right_element);                            indices = TileInfoWithLogicalElement(                                indices, left_element, right_index);                            indices = TileInfoWithLogicalElement(                                indices, right_element, left_index);                        end;                    end;                end;            end;        end;    end;
    result_values = values;    result_values = TileWithValidRegionDefined(result_values);    result_values = TileWithPadding(result_values, TilePad_Null);    result_values.location = TileLocation_Any;
    result_indices = indices;    result_indices = TileWithValidRegionDefined(result_indices);    result_indices = TileWithPadding(result_indices, TilePad_Null);    result_indices.location = TileLocation_Any;
    // Numeric status and both result Tiles are one non-faulting architectural    // publication group.  Signaling NaNs remain stable sortable values and    // set the sticky invalid flag instead of making the operation illegal.    if source_has_signaling_nan then        RecordNumericStatusFlags(Zeros{5} + 1);    end;    _Tiles[[destination]] = result_values;    _Tiles[[destination_indices]] = result_indices;end;
func TMRGSORT(    destination: TileIndex,    source_left: TileIndex,    source_right: TileIndex,    descending: boolean)begin    assert TileOperandsLegal_TMRGSORT(        destination,        source_left,        source_right,        descending);
    let left_tile = _Tiles[[source_left]];    let right_tile = _Tiles[[source_right]];    let source_has_signaling_nan =        TileSortSourceHasSignalingNaN(source_left) ||        TileSortSourceHasSignalingNaN(source_right);    var result = _Tiles[[destination]];    var left_column: integer {0..65535} = 0;    var right_column: integer {0..65535} = 0;    let output_columns =        left_tile.valid_columns + right_tile.valid_columns;
    for output_column = 0 to output_columns - 1 looplimit 65536 do        var take_left = right_column >= right_tile.valid_columns;        if left_column < left_tile.valid_columns &&           right_column < right_tile.valid_columns then            let left_element = TileLogicalLinearIndex(                left_tile,                0,                left_column);            let right_element = TileLogicalLinearIndex(                right_tile,                0,                right_column);            take_left = TileSortLeftBefore(                TileReadLogicalElement(left_tile, left_element),                TileReadLogicalElement(right_tile, right_element),                descending,                left_tile.data_type);        end;
        if take_left then            let left_element = TileLogicalLinearIndex(                left_tile,                0,                left_column);            let output_element = TileLogicalLinearIndex(                result,                0,                output_column as integer {0..65535});            result = TileInfoWithLogicalElement(result, output_element,                TileReadLogicalElement(left_tile, left_element));            left_column = (left_column + 1) as integer {0..65535};        else            let right_element = TileLogicalLinearIndex(                right_tile,                0,                right_column);            let output_element = TileLogicalLinearIndex(                result,                0,                output_column as integer {0..65535});            result = TileInfoWithLogicalElement(result, output_element,                TileReadLogicalElement(right_tile, right_element));            right_column = (right_column + 1) as integer {0..65535};        end;    end;
    result = TileWithValidRegionDefined(result);    result = TileWithPadding(result, TilePad_Null);    result.location = TileLocation_Any;    if source_has_signaling_nan then        RecordNumericStatusFlags(Zeros{5} + 1);    end;    _Tiles[[destination]] = result;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
  • PTO-TILE-MODEL-EXECUTION-SORTING compiles as an independent normative unit
    1. surfaceTILE
    2. ownerPTO-TILE-MODEL-EXECUTION-SORTING
    3. categorySTATIC-INVARIANT
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-TILE-MODEL-EXECUTION-SORTING-STATIC-001
    Path
    tests/asl/tile/model/execution/sorting/tile-static-sorting-contract-001.asl
    Kind / role
    static-invariant
    Pass condition
    the complete model and this unit's static invariant compile
    SHA-256
    48bd0509c1e6e9575fd8ec327830b25aee1b0609ae8b4c2600ca74a175c9b639
    Open exact source ↗ for PTO-AVS-TILE-MODEL-EXECUTION-SORTING-STATIC-001
  • The TMRGSORT kernel merges two ascending streams with stable left precedence
    1. surfaceTILE
    2. ownerPTO-TILE-MODEL-EXECUTION-SORTING
    3. categoryEXECUTION
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-TILE-TMRGSORT-KERNEL-001
    Path
    tests/asl/tile/model/execution/sorting/tile-exec-tmrgsort-kernel-001.asl
    Kind / role
    execution
    Requirements
    PTO-INST-TILE-TMRGSORT
    Pass condition
    the destination contains the complete ordered four-element merge
    SHA-256
    8fd29bb0b8795bf5c66cd2687ff2a690919b658c9d612ce140c8add066935459
    Open exact source ↗ for PTO-AVS-TILE-TMRGSORT-KERNEL-001
  • The TSORT kernel sorts one width-three group and preserves the trailing group
    1. surfaceTILE
    2. ownerPTO-TILE-MODEL-EXECUTION-SORTING
    3. categoryEXECUTION
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-TILE-TSORT-KERNEL-001
    Path
    tests/asl/tile/model/execution/sorting/tile-exec-tsort-kernel-001.asl
    Kind / role
    execution
    Requirements
    PTO-INST-TILE-TSORT
    Pass condition
    values and group-local U32 indices are published together
    SHA-256
    07465838397c2c58a6667ee7b2a9c9ebc3d259a08f8d8b666da41d4f1ff58b71
    Open exact source ↗ for PTO-AVS-TILE-TSORT-KERNEL-001
Commit-scoped evidence5
  • spec/evidence/release-traceability-readiness.json · closedPTO-EVIDENCE-RELEASE-TRACEABILITY
    Sources 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
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-TRACEABILITY
  • spec/evidence/instruction-contract-closure.json · closedPTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
    Sources 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
    Open exact source ↗ for PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
  • spec/evidence/architecture-readiness.json · openPTO-EVIDENCE-ARCHITECTURE-READINESS
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-ARCHITECTURE-READINESS
    Path
    spec/evidence/architecture-readiness.json
    Kind / role
    architecture maturity and blockers
    SHA-256
    4b0b85199101251bea744e0f3591cc31906909dc80d5ab651c417a936036a004
    Open exact source ↗ for PTO-EVIDENCE-ARCHITECTURE-READINESS
  • spec/evidence/release-gate-readiness.json · ready-for-exact-head-verificationPTO-EVIDENCE-RELEASE-GATE-READINESS
    Sources 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
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-GATE-READINESS
  • spec/release-manifest.json · draftPTO-EVIDENCE-RELEASE-MANIFEST
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-RELEASE-MANIFEST
    Path
    spec/release-manifest.json
    Kind / role
    release content and encoding fingerprints
    SHA-256
    1a64c109ed7a90351c41e2a418b3c0ebaf8ad975838986d2101385186b85c0d8
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-MANIFEST
Decision history1
  • Re-encode B.IOT and B.IOS size and PE mode fields · accepted
    1. decision recordADR
    2. 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
    Open exact decision source ↗ for ADR-0096

Unit metadata

Open 4 generated metadata fields
id
PTO-TILE-MODEL-EXECUTION-SORTING
surface
tile
classification
[
  "model",
  "execution",
  "sorting"
]
depends_on
[
  "PTO-TILE-MODEL-LEGALITY-SORTING"
]
Open generated traceability record
{
  "classification": [
    "model",
    "execution",
    "sorting"
  ],
  "documentation": "docs/tile/model/execution/sorting.md",
  "id": "PTO-TILE-MODEL-EXECUTION-SORTING",
  "mnemonic": null,
  "readiness_subjects": [
    "ADR-0096"
  ],
  "semantic_tests": [
    "PTO-AVS-TILE-TMRGSORT-KERNEL-001",
    "PTO-AVS-TILE-TSORT-KERNEL-001"
  ],
  "source": "asl/tile/model/execution/sorting.asl",
  "surface": "tile",
  "tests": [
    "PTO-AVS-TILE-MODEL-EXECUTION-SORTING-STATIC-001",
    "PTO-AVS-TILE-TMRGSORT-KERNEL-001",
    "PTO-AVS-TILE-TSORT-KERNEL-001"
  ]
}

Sources and release identity

Show commit, paths, hashes, version, and canonical owners
Release
0.58.5 · Release candidate
Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812
ASL SHA-256
3135fe08cdf15b661345e0eec976f39eba792cd698030590468dd687f0f02a0d
Generated documentation
docs/tile/model/execution/sorting.md · embedded in this page
Documentation SHA-256
e67242da6967a6144de2adbf46a841cb47614265caa063bf4f34ba9f48e68fe1

Exact owners