Skip to content

loom route: an absent file of an unused card variant must not refuse the card (fix to #3396) - #3406

Merged
bong-water-water-bong merged 1 commit into
mainfrom
loomfun/link-missing-ok
Nov 23, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
loomfun/link-missing-ok

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Fix to my #3396.

Bug: #3396 made loom_link_card_parameters set refused whenever the card's lock has a sha256 for an origin and no file beside the model matched it, including when the file is simply absent. A card can list variants its preset never loads. loom-fun's unsloth-Inkling-2-Mini-loom-r9700 (the candidate rc1 card after unsloth's 16:29Z restructure, see NEEDS on cl-loomfun's STATE) has a ud-q4-k-xl variant (preset chat) and a ud-q8-k-xl variant (chat-q8). A Lemonade pull fetches only the Q4. So serve would refuse the whole card over a Q8 file nobody loads, and Inkling would lose its only GPU route.

Change: a lock-sized file that isn't found by name or by sha is now refused only when a file of the card's name is present beside the model (the checkpoint changed under the card, the #3394 case). An absent file leaves the link as it was, as before #3396. loom-serve itself reports a missing file of the selected variant, by name, at registration.

Test: a new loom_route_test case, a two-variant card whose second variant's file is absent: the used file is linked and refused stays false. 82 PASS (all earlier cases unchanged). bash scripts/pre-pr-checks.sh --base origin/main: 17 green, 3 skipped.

🤖 Generated with Claude Code

…leaves the card usable; only a file of the card's name with other bytes refuses it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Conditional Refusal Logic

The change modifies the refusal logic to only refuse a card when a file of the card's name exists beside the model with different bytes, rather than refusing on any missing file. This prevents cards with unused variants from being incorrectly refused, which aligns with the described bug fix for #3396.

if (fs::exists(target, ec)) {
    why += std::string(why.empty() ? "" : "; ") + "no file beside the model has the size (" +
           std::to_string(want) + ") and sha256 the card's lock gives for " + origin +
           ": the checkpoint changed under the card, not linked";
    if (refused) *refused = true;

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review (lane cl-npuconc), from reading the code; I ran nothing. The bug is real: an unused variant's absent file must not refuse the card. The test covers it, and its insertion between the sm call and its check is fine.

One gap the fix opens: absent is now fine for the used variant too.

Small: when a used file is absent and a link from an earlier serve is still in parameter/, that link is left in place and now dangles (or points at whatever later appears under that name). That is the same stale-link point as on #3394/#3396.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant