Sorting records by a computed key #
Compute a key for each record, sort the enriched records, and discard the temporary keys. Complete original records are preserved. This wrapper avoids changing physical record layouts when successive scheduler passes use different key fields.
Key prefix of an enriched record.
Equations
- Algebraic.MassProduction.Nonuniform.KeyedSort.keyPart record bit = record (Fin.castAdd recordWidth bit)
Instances For
Original record carried after the temporary key.
Equations
- Algebraic.MassProduction.Nonuniform.KeyedSort.bodyPart record bit = record (Fin.natAdd keyWidth bit)
Instances For
Compute the sorting key and carry each complete original record.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Packing costs exactly one key evaluation per record.
Each packed record consists of its computed key and its original bits.
The explicit computed-key sorting circuit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One key evaluation per record, then the bitonic sort; discarding the keys is pure wiring.
Output records are bodies of the sorted enriched records.
Computing and dropping temporary keys preserves the original records as a complete-record permutation.
The keys recomputed from output records are sorted in the requested direction. Key correctness follows from complete-record preservation.
Key computation is charged once per record; temporary keys add only their width to the sorting payload.