test_posture

Resolving a posture into a share, and delivering that share.

Attributes

Functions

test_cpu_and_offload_need_no_estimates(→ None)

The definitional postures are the point of offering them: a caller who

test_collaborative_balances_the_engines(→ None)

The share is where both finish together, so neither waits.

test_the_closed_form_lands_on_a_measured_optimum(→ None)

Constrained against the MEASUREMENT, not against the formula restated.

test_a_split_pays_least_when_one_engine_dominates(→ None)

The reason to check before building any of this: at parity a split

test_collaborative_refuses_rather_than_inventing_a_cost_model(→ None)

A host cost may be measured, but it is never guessed: with neither a

test_collaborative_rejects_nonpositive_estimates(→ None)

test_a_measured_profile_supplies_the_host_figure(→ None)

The measurement closes the loop the closed form leaves open: a caller

test_a_profile_prices_a_row_count(→ None)

test_adaptive_refuses_instead_of_falling_back(→ None)

A silent fall back to collaborative would answer a different question

test_offload_is_not_the_wall_clock_optimum(→ None)

Recorded because it is counterintuitive and a planner that only

test_unknown_posture_is_refused(→ None)

test_split_validates_its_own_fields(→ None)

test_every_posture_is_reachable_or_refused_by_name(→ None)

No posture may be silently absent -- a name in POSTURES that nothing

test_resident_wants_one_batch_at_any_size(→ None)

With no transfer to hide, every batch is pure per-call overhead.

test_streamed_reproduces_the_measured_optimum(→ None)

45.8 MiB measured fastest at 3 batches (18.78 ms), against 22.08 at one

test_the_two_optima_are_opposite(→ None)

Which is the entire reason the batch count depends on residency: a

test_small_payloads_are_not_split_below_the_knee(→ None)

Splitting below the knee costs transfer rate for a tail that is already

test_batches_are_never_split_below_the_knee(→ None)

Rounding up contradicted the measurement this targets: at 1.5x the knee

test_batch_count_rejects_impossible_inputs(→ None)

test_the_knee_has_no_default(→ None)

It is a measurement of one link, and a library-wide constant would be

test_the_device_fixed_cost_moves_the_balance_and_can_rule_the_split_out(→ None)

A device job costs something before its first row. The balance point

Module Contents

test_posture.KNEE_BYTES = 15728640
test_posture.test_cpu_and_offload_need_no_estimates() → None

The definitional postures are the point of offering them: a caller who will not pay for cost estimation can still state an intent.

test_posture.test_collaborative_balances_the_engines() → None

The share is where both finish together, so neither waits.

test_posture.test_the_closed_form_lands_on_a_measured_optimum() → None

Constrained against the MEASUREMENT, not against the formula restated.

Asserting the formula’s own output would pass against any formula, so the assertions are that the predicted SHARE lands on the measured optimum and that the predicted speedup is within the error this model claims.

test_posture.test_a_split_pays_least_when_one_engine_dominates() → None

The reason to check before building any of this: at parity a split returns 2x, and against a ten-times-faster engine it buys 1.1x over simply handing the whole query over.

test_posture.test_collaborative_refuses_rather_than_inventing_a_cost_model() → None

A host cost may be measured, but it is never guessed: with neither a figure nor a profile, a fabricated number would sit underneath a real decision.

test_posture.test_collaborative_rejects_nonpositive_estimates() → None
test_posture.test_a_measured_profile_supplies_the_host_figure() → None

The measurement closes the loop the closed form leaves open: a caller that profiled its host does not also have to price it by hand.

test_posture.test_a_profile_prices_a_row_count() → None
test_posture.test_adaptive_refuses_instead_of_falling_back() → None

A silent fall back to collaborative would answer a different question than the caller asked – adaptive chooses a boundary in the plan, not a row share.

test_posture.test_offload_is_not_the_wall_clock_optimum() → None

Recorded because it is counterintuitive and a planner that only minimized wall time would pick wrongly: on the measured pairing offload reaches 1.49x where collaborative reaches 2.49x, and buys back the host.

test_posture.test_unknown_posture_is_refused() → None
test_posture.test_split_validates_its_own_fields() → None
test_posture.test_every_posture_is_reachable_or_refused_by_name() → None

No posture may be silently absent – a name in POSTURES that nothing handles would fall through to the unknown-posture branch and read as a typo rather than a gap. adaptive is refused by name, as a decision this signature cannot make, and the refusal must not be the unknown-posture one.

test_posture.test_resident_wants_one_batch_at_any_size() → None

With no transfer to hide, every batch is pure per-call overhead. Measured: 5.27 ms at one batch against 5.91 at three.

test_posture.test_streamed_reproduces_the_measured_optimum() → None

45.8 MiB measured fastest at 3 batches (18.78 ms), against 22.08 at one and 22.59 at twelve. Targeting the link’s knee lands there.

test_posture.test_the_two_optima_are_opposite() → None

Which is the entire reason the batch count depends on residency: a single tuned constant would be wrong for one of them.

test_posture.test_small_payloads_are_not_split_below_the_knee() → None

Splitting below the knee costs transfer rate for a tail that is already short.

test_posture.test_batches_are_never_split_below_the_knee() → None

Rounding up contradicted the measurement this targets: at 1.5x the knee it produced two batches of 0.75x each, in the degraded region.

test_posture.test_batch_count_rejects_impossible_inputs() → None
test_posture.test_the_knee_has_no_default() → None

It is a measurement of one link, and a library-wide constant would be wrong for every link that is not the one it was measured on.

test_posture.test_the_device_fixed_cost_moves_the_balance_and_can_rule_the_split_out() → None

A device job costs something before its first row. The balance point hands the device less by exactly that much, the predicted speedup is against the wall that includes it, and when the fixed cost is most of the host’s whole time no share can win and the answer is host-only.