Skip to content

Reject unsafe VRAM-budget loads before context creation - #35

Merged
leehack merged 3 commits into
mainfrom
fix/reject-unsafe-vram-load
Nov 2, 2026
Merged

leehack merged 3 commits into
mainfrom
fix/reject-unsafe-vram-load

Conversation

@leehack

@leehack leehack commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Reject budgeted wrapper loads before upstream entry when effective auto-fit is disabled, including explicit parameter placement, or when the default integrated-only GPU route cannot plan the budget. Return NULL with actionable sd_dart_last_error() even with logging muted. Unbudgeted loads and supported auto-fit routes remain available.

Refs #34 and 0.18.0 plan. This is a bounded wrapper restriction; raw upstream new_sd_ctx remains unsafe and existing Dart guards stay. Does not close #34 or publish an artifact.

Validation

  • Normal, Metal-defined and ASAN guard controls pass; previous candidate fails the explicit-placement regression.
  • Native teardown suite passes with one Linux-only skip; pinned-Dart progress stress passes all five tests; device/log tests pass.
  • Prior guard head 795aa2c passed independent blocking review and actual macOS release/ASAN runtime controls. The real-built library rejects both guarded combinations before allocation; this is not full affected-device inference qualification.
  • Current head a4ce93b660e47f7d4129ab8380a88bab78d8cac3, tree d13d4208c070e0dfc6c4a9496de89a8b88aea235, merges qualified main 2b4773a19354528010d131c57a6341ab64eeba97 (PR Pin Linux x64 qualification and release builders to Ubuntu 24.04 #36). Guard sources are unchanged; renewed exact-head audit accepted; all17 current-head CI checks pass. Three workflow contract tests pass.
  • Positive controls cover no budget, explicit backend with empty parameter placement, discrete default, and recovery after rejection.

Remaining gates

All17 current-head CI checks pass; renewed independent audit accepted the byte-identical guard diff against the new base. Earlier Linux Vulkan CI failed after floating runner/toolchain drift; PR #36 pins builders and qualification to Ubuntu 24.04 without relaxing thresholds. The old run is not current-head evidence. Affected-device qualification remains required before publication. The explicit-placement variant was established through upstream planner code and a regression control, not a new real-model crash reproduction. No wider GPU support claim.

leehack commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Additional exact-head local artifact checks at 795aa2c: macOS arm64 Release build succeeded and validate_artifacts.py macos-arm64 passed. Built library SHA-256 3e8568483468a6e0bf7a30a01b12b88d65bcc1c7fd614631fad3cdf754d120aa.

The maintained built-runtime teardown matrix passed (8 tests, 4 skips) with SD_REQUIRE_RUNTIME=1, pinned Dart and SD_REQUIRE_METAL_GENERATION=1; its untracked control reproduced the expected ggml-Metal exit abort. A linked C++ probe using the SD-Turbo Q8 model path safely rejected both fit-off and explicit-placement budget configurations with actionable errors. The guard rejects before model allocation, so this is real-library boundary evidence, not image-generation qualification. Model SHA-256 d50be7655f0a554cf8041c145d88b210bd5f3c545423119dee62ae08cae51580.

AddressSanitizer runtime matrix is still running. Linux runtime and broader affected-device/model qualification remain open; no publication readiness claim.

leehack commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

The AddressSanitizer built-runtime teardown matrix also passed on the same source head: 8 tests, 5 skips, required Metal generation enabled. Its untracked control again produced the expected Metal exit abort. Linux runtime and broader affected-device/model gates remain outstanding.

leehack commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

At head a4ce93b660e47f7d4129ab8380a88bab78d8cac3, fifteen jobs passed. The iOS x64 simulator job was cancelled before any step ran: GitHub reports that no hosted runner acquired it after multiple attempts, with macOS arm64 capacity warnings. One targeted retry of that job was dispatched; its dependent XCFramework check still needs to run. Merge remains gated on those results.

@leehack
leehack marked this pull request as ready for review November 2, 2026 16:14
@leehack
leehack merged commit 82a9a4b into main Nov 2, 2026
33 of 34 checks passed
@leehack
leehack deleted the fix/reject-unsafe-vram-load branch November 2, 2026 16:14
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.

new_sd_ctx aborts (GGML_ASSERT) with auto_fit off and max_vram below the weights

1 participant