Skip to content

feat(plan): MOBILE_2GB is strict, as its own documentation always claimed - #1128

Merged
michalharakal merged 1 commit into
developfrom
feature/mobile-profile-strict
Aug 25, 2026
Merged

michalharakal merged 1 commit into
developfrom
feature/mobile-profile-strict

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Follows #1109 / #1114.

MOBILE_2GB has said since it was written that it treats dequantization as "the defect it is". The strict flag said otherwise, so nothing enforced it.

On a 2 GB board a missing kernel is not a slow path to take quietly — it is a weight arriving several times its size on the device least able to hold it. The honest moment to say so is before the load, not at the OOM.

Both effects of strict change

before after
WeightFormResolver silently resolves to DequantizeTo(FP32) refuses, naming the encoding and the multiplier
checkDequant WARN past the 5 % threshold ERROR

Consistent, because it is the same defect whether it is paid once at load or on every step.

Three tests were asserting the old policy

Each rewrite says something truer than a flag flip would have:

  • PlannerProfileTest used MOBILE_2GB as its lenient example. DESKTOP is the honest one now: it has the memory to absorb a widening and is told, while a 2 GB board does not and fails. strict() stays covered, for turning a lenient profile into a failing one in CI.
  • The Same model, same code, two profiles, two forms, both run #1118 acceptance test had mobile as the side that dequantizes, which is no longer legal. Swapped — a desktop build without a Q8_0 kernel pays once at load; a phone with the kernel keeps it packed and mapped. Same contrast, more plausible story.
  • The pricing test now opts out of strict explicitly in order to price a widening, which is exactly the decision that number exists to inform.

The CLI needed it

skainet-plan --profile mobile --kernels dense would have surfaced an IllegalStateException as a stack trace. A strict profile refusing is an answer to what the planner was asked, so it prints the message and exits 1.

The opt-out is documented

copy(strict = false) is named on the profile itself. "Would rather load slowly than not at all" is a legitimate position for someone shipping to a phone that lacks a kernel — it just should not be the silent default.

Gate

scripts/pr-gate.sh — all legs passed.

🤖 Generated with Claude Code

…imed

The profile has said since it was written that it treats dequantization as
"the defect it is". The flag said otherwise, so nothing enforced it. On a 2 GB
board a missing kernel is not a slow path to take quietly: it is a weight
arriving several times its size on the device least able to hold it, and the
honest moment to say so is before the load rather than at the OOM.

strict drives two things, and both change. WeightFormResolver refuses to
resolve a weight nothing on the target can feed, and checkDequant turns a
dispatcher-inserted widening past the 5 % threshold from a warning into an
error. Consistent, because it is the same defect whether it is paid once at
load or on every step.

Three tests were asserting the old policy:

- PlannerProfileTest used MOBILE_2GB as its *lenient* example. DESKTOP is the
  honest one now — it has the memory to absorb a widening and is told, while a
  2 GB board does not and fails. strict() stays covered for turning a lenient
  profile into a failing one in CI.
- The #1118 acceptance test had mobile as the side that dequantizes, which is
  no longer legal. Swapped: a desktop build without a Q8_0 kernel pays once at
  load, a phone with the kernel keeps it packed and mapped. The same contrast,
  and a more plausible story.
- The pricing test opts out of strict explicitly to price a widening — which
  is exactly the decision that number exists to inform.

skainet-plan needed it too: `--profile mobile --kernels dense` would have
surfaced an IllegalStateException as a stack trace. A strict profile refusing
is an answer to what the planner was asked, so it prints the message and exits
1.

copy(strict = false) is documented on the profile: "would rather load slowly
than not at all" is a legitimate position, it just should not be the silent
default.

Gate: scripts/pr-gate.sh — all legs passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

📖 Documentation Preview

The documentation has been built successfully for this PR.

Generated Files:

  • Operator documentation: docs/modules/operators/_generated_/
  • JSON schema output: operators.json

Artifacts:

  • Download the documentation-preview-1128 artifact to view the complete documentation locally.

This comment will be updated automatically when the PR is updated.

@michalharakal
michalharakal merged commit cc2ecc5 into develop Aug 25, 2026
18 checks passed
@michalharakal
michalharakal deleted the feature/mobile-profile-strict branch August 25, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant