test_hash_grouped

Hash-mode grouped field-sum aggregation golden: one accumulator per DISTINCT key regardless of input order (the ordered tile’s sorted_by_key staging precondition removed), key-ascending drain, explicit overflow, and the host split-and-merge algebra that makes overflow recoverable.

Attributes

_MASK

Functions

_rows(seed, count, keys) → list[tuple[int, int, int, int]]

_as_pairs(groups)

test_one_record_per_distinct_key_regardless_of_order() → None

test_permutation_invariance() → None

test_sorted_input_agrees_with_the_ordered_tile() → None

test_drain_is_signed_key_ascending() → None

test_keys_are_int32_wires() → None

test_overflow_invalidates_the_batch() → None

The platform's uniform error convention: an error close-out

test_full_table_without_a_new_key_is_not_an_overflow() → None

test_bad_configuration_is_refused() → None

test_split_and_merge_equals_one_shot() → None

The property that makes overflow recoverable rather than fatal.

test_key_range_split_recovers_an_overflowed_batch() → None

test_merging_mixed_field_masks_is_a_caller_error() → None

test_empty_batch_emits_nothing() → None

test_record_words_match_the_ordered_tile_shape() → None

Module Contents

test_hash_grouped._MASK = 2
test_hash_grouped._rows(seed: int, count: int, keys: int) → list[tuple[int, int, int, int]]
test_hash_grouped._as_pairs(groups)
test_hash_grouped.test_one_record_per_distinct_key_regardless_of_order() → None
test_hash_grouped.test_permutation_invariance() → None
test_hash_grouped.test_sorted_input_agrees_with_the_ordered_tile() → None
test_hash_grouped.test_drain_is_signed_key_ascending() → None
test_hash_grouped.test_keys_are_int32_wires() → None
test_hash_grouped.test_overflow_invalidates_the_batch() → None

The platform’s uniform error convention: an error close-out invalidates the whole batch. Returning the partial accumulation would be a DOUBLE-COUNT hazard, since the host’s recovery re-runs the same rows split by key range.

test_hash_grouped.test_full_table_without_a_new_key_is_not_an_overflow() → None
test_hash_grouped.test_bad_configuration_is_refused() → None
test_hash_grouped.test_split_and_merge_equals_one_shot() → None

The property that makes overflow recoverable rather than fatal.

test_hash_grouped.test_key_range_split_recovers_an_overflowed_batch() → None
test_hash_grouped.test_merging_mixed_field_masks_is_a_caller_error() → None
test_hash_grouped.test_empty_batch_emits_nothing() → None
test_hash_grouped.test_record_words_match_the_ordered_tile_shape() → None