Skip to content

weekly: 1bit OS image builds under cron; the guard reports real failures - #173

Merged
bong-water-water-bong merged 1 commit into
mainfrom
fix/weekly-sbin
Sep 27, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
fix/weekly-sbin

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Today's Sunday run (a rehearsal: no READY file yet) died at the 1bit OS package and never reported.

  • Cause: os/mini/mkimage.sh calls modprobe, which lives in /usr/sbin. The weekly wrapper's PATH leaves that out, so the image's kernel-modules step failed on every try. Run from a login shell it passes, which is why yesterday's hand-run rehearsal worked. mkimage.sh now adds /usr/sbin:/sbin itself.
  • Misleading log: guard() logged "memory guard stopped it" for any non-zero exit and retried 10 times in 2 seconds. It now retries only mem-guard's own kill (exit 137) and reports anything else as FAILED (exit N).
  • Outside the repo: the wrapper on strixhalo (~/.local/bin/1bit-weekly) is fixed separately, backup kept. Its PATH gains /usr/sbin, and its failure branch no longer dies under set -e when grep finds no error line. That was why nobody was told about the failure.

Checked: mkimage.sh builds the image with the wrapper's PATH, and a rehearsal rerun is under way on strixhalo.

🤖 Generated with Claude Code

mkimage.sh calls modprobe (in /usr/sbin), which the weekly wrapper's PATH
left out, so the Sunday run failed at the image's kernel-modules step every
time (it passed when run from a shell). mkimage.sh now adds /usr/sbin:/sbin
itself. guard() said "memory guard stopped it" for any non-zero exit and
retried 10 times in two seconds; it now retries only mem-guard's own kill
(exit 137) and reports anything else as FAILED with the exit code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@context7

context7 Bot commented Sep 27, 2026

Copy link
Copy Markdown

Docs7 for 1bit-monster/engine

Result Status Action
Deployment ➖ Not used —
Content review ➖ Did not run. This site has no agent runs available this month. Wait for the monthly reset or check your Docs7 plan. —

Commit 1ca36f5

@bong-water-water-bong
bong-water-water-bong merged commit bc23003 into main Sep 27, 2026
9 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the fix/weekly-sbin branch September 27, 2026 12:48
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
⚡ Recommended focus areas for review

Possible Issue

The mkimage.sh script is responsible for building the 1bit OS image. The PR adds a new wrapper to handle failures in the weekly build process. However, the guard in scripts/weekly.sh might not correctly handle failures when the memory guard exits with an error other than 137 (SIGKILL), which could lead to false negatives in reporting the failure. This is especially relevant if the memory guard's exit code is not consistently 137, causing the wrapper to report a failure incorrectly. Additionally, the addition of /usr/sbin:/sbin to the PATH in mkimage.sh ensures that modprobe can find the necessary kernel modules, which is crucial for the GPU and NPU operations. Without this, the image build might fail to load required modules, as seen in the rehearsal failures. The guard's current implementation retries 10 times, but if the memory guard fails to pass within those tries, the overall build fails, and the error might not be clearly communicated to users unless properly logged or reported. Ensuring that the wrapper correctly reports failures and provides meaningful logs is essential for a reliable build process. Repeated failures could indicate issues with memory, disk, or other dependencies, and users should be informed of these failures appropriately. The current setup assumes a login shell passes, which might not hold in cron jobs, hence the need for the wrapper to explicitly prepend necessary paths. It is also important to verify that the memory guard's exit code is consistently 137, as this triggers the retry mechanism. If the exit code varies, the guard might not correctly identify the failure condition, leading to potential misreporting of the build status. Clear logs and error messages are necessary to diagnose issues, especially when the build fails silently or reports an incorrect status. The PR also mentions fixing the wrapper for 1bit-weekly, which suggests that there might be additional issues with the build process that need to be addressed for reliable image creation. It is crucial to ensure that the build process is robust and provides accurate feedback to users, even in automated or scheduled environments like cron. This includes handling edge cases such as insufficient memory, disk full, or module loading failures, and reporting them explicitly rather than masking them as successful retries.

export PATH="$PATH:/usr/sbin:/sbin"
out=${1:?usage: mkimage.sh <out> [engine build dir]}
Possible Issue

The guard() function in scripts/weekly.sh retries 10 times, but it only handles exit code 137 (SIGKILL) as a failure that can be retried. If the mem-guard.sh exits with any other error code (e.g., 1, 2, or a process that has terminated abnormally), the guard will not retry and will report the failure. This could lead to the build appearing to succeed when it actually has not, especially if the memory guard fails after some retries but before the loop ends. For example, if the memory guard exits with 136 (SIGHUP) or 135 (SIGTERM), the guard will not retry and will log a failure, but the build might continue or fail later for other reasons. The current implementation assumes that only SIGKILL is a retryable error, but other signals or exit codes might also indicate a problem that prevents the build from completing successfully. This is particularly relevant in the weekly build process, where failures might occur in background tasks or after a certain time has passed, and the guard might prematurely conclude success if the memory guard exits with a non-137 code. It is essential to ensure that the guard correctly identifies all failure conditions and provides appropriate retries or error reporting to prevent undetected build failures. The build process relies on the memory guard to ensure sufficient memory is available, and any failure here should halt the build or clearly indicate the issue to the user. Without proper error handling for non-137 exit codes, users might assume the build succeeded when it has not, leading to potential missing dependencies or system issues. This could be exacerbated if the build is run in an environment where the memory guard's exit conditions are not consistently triggered, such as in a cron job with a different user context or resource constraints. Therefore, the guard should be adjusted to handle a broader range of failure codes or to explicitly report any non-zero exit codes as failures, rather than relying solely on exit code 137.

    room || return 1
    rc=0; "$SRC/scripts/mem-guard.sh" 4 "$@" || rc=$?
    [ "$rc" = 0 ] && return 0
    # mem-guard kills with SIGKILL (exit 137); any other status is the command's own failure,
    # which a retry cannot fix
    if [ "$rc" != 137 ]; then say "FAILED (exit $rc): $*"; return "$rc"; fi
    say "memory guard stopped it (try $try): $*"
done
return 1


bong-water-water-bong added a commit that referenced this pull request Nov 2, 2026
… 82804197bcbe (#810)

The fork line moved three commits past the pin main carries today (1d32c22609d6, #170):

  d8bd0ff  hrx: refuse to run when the residency budget is below the working set (engine #788) (#173)
  ba4fdf0  hrx: make the host-weight residency budget mean the budget (engine #788) (#172)
  197e775  kv share: an optional guard page after an imported region, so a tile that writes past it faults
           instead of corrupting (#171)

So the first two are the residency budget actually binding (and now refusing rather than over-committing), and the
third gives an imported KV-share region a guard page - a mapping change, which is exactly the kind of thing the
hardware gate below is for.

- third_party/llama.cpp: 1d32c22609d6 -> d8bd0ff6052a
- hrx-system: unchanged at the held 82804197bcbe (config/hrx-system-hold.config); the hold is not lifted here
- registry/architectures.json: regenerated against the new gitlink (tools/registry_build.py reads HEAD, so this runs
  after the gitlink commit): 294 hrx / 7 npu, 0 architectures added or removed - the change is the recorded source
  pin only; --check-pins says "records the committed pins"

Checked on the new tip before cutting: the GGML_HRX_HIP_ADDON_DIR hook is present (6 refs), tests/test-backend-ops.cpp
still carries the zero-cases guard the gate row recognises, and tools/mtmd/models/models.h exists.

Co-authored-by: bong-water-water-bong <bong-water-water-bong@1bit.gg>
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