mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2054] update.sh: failed engine build leaves BUILD.json stamped with new source hash — engine never rebuilt (stale binary reports old version) #821
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#821
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MrKop-git on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2054
update.sh: a failed engine build leavesBUILD.jsonstamped with the new source hash — the engine is then never rebuiltEnvironment
/opt/cuda-12.8, GTX 1080 Ti (sm_61 →engine-cuda12,"source": "local")What happened (observable on disk)
engine-cuda12/strata --version→strata 0.1.42git pullto v0.1.43 (tag verified:git describe --tags→v0.1.43), then./update.shat 11:20#error -- unsupported GNU version! gcc versions later than 14 are not supported, from the gcc-16 upgrade)engine-cuda12/strata— unchanged old binary (mtime still 2026-10-11 11:44, still reports 0.1.42)engine-cuda12/BUILD.json— rewritten at 11:20 withversion: 0.1.43and the newsrchash./update.shprinted "engine already built for this PC" and finished with "Strata is updated (engine 0.1.43)" while the running binary was still 0.1.42. The mismatch persisted silently across multiple update runs.(Consistency side note: with
BUILD.jsonmoved away,./update.shinstead reports "engine 0.1.42" and does nothing —update_installed_engine()returns early when the stamp is missing, so there is no state in which the update offers to rebuild.)Workaround used
Invoking
build_engine()directly withCC=gcc-14 CXX=g++-14 CUDAHOSTCXX=g++-14rebuilt 0.1.43 correctly.Suggested hardening
meta.get("src") == source_hash(ENGINE_SOURCES)as "already built", also verify the installed binary's actual version matchessource_version()(e.g. runstrata --version, or compare a build-id/version resource). A stale-binary/new-stamp mismatch currently survives forever.Secondary: host compiler on rolling distros
host_compiler_defs()only honorsCC/CXX/CUDAHOSTCXXwhen the user sets them. On Arch-type systems gcc regularly moves ahead of what a given CUDA 12.x nvcc accepts, and the failure is a raw nvcc#errorinside CMake compiler detection — hard to interpret. It would help a lot ifinstall_build_tools()auto-fell-back to an older installed host compiler (e.g. probeg++-14,g++-13, …) when the default one is newer than the toolkit supports.Happy to provide full logs of the 11:20 run's output if useful — thanks for a great project, the conversation-cache/session design is lovely.
@MrKop-git commented on GitHub (Oct 12, 2026):
Full post-mortem (we dug out of this state — more hardening opportunities found)
Picking this back up after fully recovering, with the exact trigger and two more failure-mode details that would have saved us hours.
Trigger confirmed
The system gcc was upgraded 14 → 16 (Arch/CachyOS rolling) between the successful 0.1.42 build (Oct 11) and the
git pull+./update.shto 0.1.43 (Oct 12). CUDA 12.8's nvcc rejects gcc > 14 as host compiler → CMake's CUDA compiler-id detection dies. So the same setup that built fine yesterday fails today with zero Strata-side changes — rolling-distro users will hit this regularly.The poisoned on-disk state (for anyone reproducing)
Recovery that worked:
CC=gcc-14 CXX=g++-14 CUDAHOSTCXX=g++-14+ invokingbuild_engine()directly (plus proxy env for the llama.cpp fetch).update.shalone cannot recover from this state — nor from a deleted BUILD.json (see below).Additional hardening opportunities discovered on the way out
A stale
build-cuda12/CMakeCache.txtwithSTRATA_ENABLE_CUDA=OFFturns the failure opaque. If the build dir was ever configured without the engine defs (in our case: an interrupted earlier attempt, plus a manualcmake -S . -B build-cuda12),cmake_build()can configure "successfully" and then die atninja: error: unknown target 'strata'— twice (the retry repeats the identical failure), ending with a message that doesn't point at the real problem. Suggestion: after configure, verify the target actually exists; if not, wipe the build dir once and reconfigure before giving up. (Wiping the dir and re-running with the gcc-14 env fixed it here.)update_installed_engine()returns silently whenBUILD.jsonis missing. That's the one state a user who "cleaned up a bit" cannot recover from at all: with the stamp gone it neither downloads nor compiles — it just prints the binary's version and exits. Suggestion: treat missing stamp + existing binary (or missing both, with a local toolchain) as unknown provenance → rebuild, or at minimum log why nothing is being done.The minimal fix for the original bug remains the one from the report: before trusting
meta["src"] == source_hash(), check the installed binary's actual version againstsource_version()— a stale-binary/new-stamp mismatch then self-heals on the next update instead of surviving forever.Positive finding worth keeping (data point, not a bug)
Because of unrelated GPU-driver crashes this box rebooted ~8 times in one day while serving a ~47k-token session. The engine's built-in restore (it picks
autosave.bin, falls back toautosave.1.bin, both visible in the log with read+check timings) combined with a 5-minute autosave wrapper recovered the session on every single crash with ≤5 min loss. That part of the design works beautifully.@Niko1221 commented on GitHub (Oct 12, 2026):
Thank you, MrKop-git, for the post-mortem. The two-line description of the on-disk state (old binary, new BUILD.json) was exactly what we needed, and the gcc 14 -> 16 trigger is a good one to know about.
Fixed in 0.1.43.1: setup no longer trusts a BUILD.json on its own. It now reads the version compiled into the engine file and compares it with the source's: a stale binary beside a new stamp is compiled again on the next
./update.sh(andUPDATE.bat), and a build that finishes without producing an engine of the source's version stops with a message and writes no stamp and installs nothing, so the old engine and its old stamp stay as they were. The HIP build has the same check.Not done in this release, and worth their own issues if you want them: choosing an older installed host compiler (
g++-14,g++-13) automatically when the default one is newer than the toolkit supports, repairing a wiped build folder whose cache has the engine switched off, and rebuilding when BUILD.json is missing but a binary is there. For the compiler,CC=gcc-14 CXX=g++-14 CUDAHOSTCXX=g++-14 ./update.shis the way for now.@qiuzan2001 commented on GitHub (Oct 15, 2026):
The three follow-ups from your last comment, as their own issues: #2576 (an older installed g++ when the default is newer than the toolkit accepts), #2578 (a build folder configured without the
stratatarget), #2579 (an engine binary without its BUILD.json is never updated).@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for the report. This is fixed in 0.2.0-beta (or an earlier release), and we're closing it as part of the tracker reset for 0.2.0-beta.
If it still happens on 0.2.0-beta, add the area prefix to the title ([Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]), put the Strata version and your hardware in the issue form fields, and comment
/reopen. A check runs and reopens it.