Skip to content

Fix NVIDIA NVRTC bundling and require clean KataGo startup - #62

Merged
wimi321 merged 14 commits into
mainfrom
codex/fix-windows-nvrtc-runtime
Oct 22, 2026
Merged

wimi321 merged 14 commits into
mainfrom
codex/fix-windows-nvrtc-runtime

Conversation

@wimi321

@wimi321 wimi321 commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

The v0.4.21 Windows NVIDIA bundle omits KataGo's directly imported nvrtc64_120_0.dll, causing loader status 0xC0000135 before the engine can start. This change supplies the official CUDA 12.1 NVRTC pair with pinned archive/DLL/license hashes and preserves its license and provenance.

Dependency checks cover normal and delay-loaded x64 PE imports plus NVRTC builtins. The packaging hook, NVIDIA app smoke and release workflow require the actual engine to start with an empty working directory and Windows-only PATH. Both portable and extracted NSIS payloads are checked before upload. A Windows CI regression rejects the original broken release and requires the corrected runtime to start cleanly. The packaging hook also imports Arch from the declared electron-builder dependency.

Fixes #58.

Validation on the integrated head 7b6dc7235c60c78f6e0deca4b3dc7db65b3c08e7:

  • Local macOS suite: 308 passed, one Windows-only archive test skipped; TypeScript and NVIDIA release-workflow checks passed.
  • Current-head PR CI, push CI and P0 release-candidate checks all passed before merge, including Windows clean-startup regression. The repaired engine reported KataGo 1.17.1 / CUDA and exited 0 with cleanEnvironment=true.
  • The integrated macOS app was rebuilt, its bundled Codex runtime initialized successfully, and it loaded the real local game library. Application flows and a real LLM teacher response were verified on an isolated copy of that profile.
  • Earlier Windows validation on 75c96473e7f3be817eb129433221268c4479dac2 verified isolated portable/NSIS payloads and executable startup; CI and P0 passed.

GPU model initialization, actual NVIDIA analysis and interactive installation remain release QA requirements; a loader/version check does not establish those results. No new public release is part of this PR. See docs/WINDOWS_NVIDIA_RUNTIME.md for sources, hashes and verification commands.

wimi321 and others added 14 commits October 3, 2026 18:15
- One design system in site.css, home.css and download.css replaces three layered stylesheets.
  39 unused legacy selectors are gone.
- Each locale uses the system fonts its OS ships (PingFang / Microsoft YaHei / Hiragino /
  Malgun / Sukhumvit). Before, headings fell back to SimSun on most Windows PCs.
- Bands no longer use width: 100vw, which added a horizontal scrollbar next to classic Windows
  scrollbars. The website contract now rejects it.
- Hero: a faint CSS board grid with star points and two CSS stones around the real screenshot,
  replacing the generated photo. The second headline line is green, and the secondary action is
  an outlined button.
- Review steps are cards. A new six-item feature grid lists what the app does, in seven
  languages.
- Download chooser: segmented platform tabs, build cards with the recommended build
  highlighted, and inline icons.
- SiteIcon inlines Bootstrap Icons, so icons follow currentColor instead of CSS filters.

Verified with build, astro check, website tests and the contract. Also measured in headless
Chrome with real scrollbars: no horizontal overflow, text contrast at least 4.5:1, and targets
at least 36 px, on all 46 pages. A maintainer still needs to review the preview visually; see
design-qa.md.
- Homepage tells one story with one real game: an SVG wooden board of move 127 of Shusaku's
  ear-reddening game (replayed from the public-domain SGF) with the KataGo suggestions the app
  showed, the real whole-game win-rate curve from KataGo, a dark showcase with a new 2x
  screenshot of the app at the same position, a seven-tile feature bento, three steps, the
  compact download chooser and a closing band.
- New header with the application's own icon, a one-row navigation and a download button; a dark
  footer with product, topic and community columns. Fixes the gap above the footer and the
  default disclosure marker.
- Guide, FAQ, privacy and changelog are rewritten for all seven languages in pages-copy.mjs and
  rendered by one ContentPage component, replacing the unused per-language GoAgent copy. Button
  names quote the app's own labels in each language. Privacy now covers LizzieYzy Next first;
  the changelog summarizes next-2026-10-17.1.
- Homepage copy is rewritten in seven languages. CJK headings wrap between phrases, Korean wraps
  between words, and Thai gets no letter-spacing.
- The Chinese topic pages are rewritten without jargon and use real screenshots. Three generated
  mock-ups of the interface are removed, and the contract now rejects them.
- New sharing image, favicon and touch icon; llms.txt and llms-full.txt list the verified
  features.

Verified with build (46 routes), astro check, 17 website tests and the contract. DOM checks in
headless Chrome found no horizontal overflow, contrast below 4.5:1 or targets under 40 px on
all 46 pages; screenshots were reviewed in every language. See design-qa.md.
Redesign the official website around the real application
- Cache the scrypt-derived local secret key. getSettings() re-derived it for
  every stored secret, which blocked the main process for 13.6 s of the first
  19 s after launch for users with saved API keys.
- Keep KataGo version probes that time out (first-launch OS malware scan)
  running in the background instead of caching "KataGo missing" for the whole
  session, and report loader exit codes such as 0xC0000135.
- Fail persistent-engine queries when KataGo exits during startup instead of
  hanging all later analysis, tolerate EPIPE on KataGo stdin, stop every
  KataGo process on quit and hide engine console windows on Windows.
- Salvage partial live and trial results for the cancel and timeout messages
  of both engine paths.
- Persist only detected changes in dashboard refreshes so settings saved in
  the meantime are not reverted, and skip the rewrite when nothing changed.
- Keep the LLM abort listener attached while a streamed body is read, so
  stopping a teacher run actually ends the request.
- Report LLM errors that mention a model as LLM problems, not KataGo ones.
- Save teacher sessions with one compact write.
- Renderer: ignore stale game loads, drop stale queued analysis during
  arrow-key navigation, and re-run analysis after a model change with the
  new settings.
- Prepare the Codex runtime in `pnpm dev`, reusing the checksummed binary
  that @openai/codex already installed.
Fix main-process stalls and harden KataGo and LLM lifecycles
- Add katagoCustomBin/katagoCustomModel/katagoCustomConfig settings that
  detection never overwrites. They take priority over the bundled and
  detected files; an unusable custom file falls back to automatic
  detection with a note explaining why.
- A custom model is not held to the official preset's minimum engine
  version, so older engines such as KataGo 1.16.5 work with their own
  networks.
- Add a "Custom KataGo (advanced)" settings card with file pickers, a check
  that runs `katago version` and one real analysis query (showing KataGo's
  stderr on failure), save, and reset to automatic. Saving re-runs the
  analysis of the open game with the new engine.
- Stop the idle persistent engine of a previous command, so switching
  engine, model or config no longer keeps the old network loaded.
- Fingerprint the engine in analysis cache keys only when a custom engine
  is set, so existing caches stay valid.
Let users run their own KataGo program, model and config (#57)
Nothing was ever pruned: on a real profile the analysis cache held 3,807
files (106 MB), the TTS cache 84 MB and 429 KataGo logs.

- Sixty seconds after launch, prune with async file I/O:
  - analysis cache: remove non-oracle entries older than 45 days (reads
    already reject them after 30), then evict least recently used games
    above 512 MB;
  - TTS cache: keep the most recently played audio under 200 MB;
  - KataGo logs: keep at most 100, none older than 14 days.
- Cache hits and audio plays refresh file times so eviction follows use.
- Deleting a game removes its cached analysis in every tier.
- Write analysis cache entries and teacher report JSON compactly.
Trim analysis and TTS caches and KataGo logs in the background
…ming

Live analysis
- On the foreground board, search the played move with the 1,200-visit
  evidence minimum instead of the full 4,000: the main search's candidate
  already wins whenever it explored that move more. A live move now finishes
  after ~5,240 visits instead of ~8,040 (66 s instead of ~100 s with the
  user's b28 on an M4 Pro), and the single scheduler slot frees sooner.
- In-progress live and trial updates carry ownership maps only for the
  root, the best candidate and the played move (the only ones read).

Renderer
- Memoize the board, winrate graph, issue list, library, teacher panel and
  each teacher message, and pass them stable callbacks and memoized values.
- Apply live analysis progress at most every 150 ms (finals immediately),
  and join streamed teacher deltas once per animation frame.
- Subscribe to desktop commands and teacher board-image requests once, with
  handlers that see the latest state (Cmd+1 used to analyze the main line
  while a trial branch was on screen).
- Follow the teacher thread only while the reader is at the bottom.
- Store evaluations in localStorage without secondary ownership maps.

During live analysis the renderer's JS time dropped from 1.9% to 0.3% of
the main thread and DOM mutations by 36% (20 s CDP measurement).
Shorten live analysis and cut renderer work during analysis and streaming
@wimi321
wimi321 marked this pull request as ready for review October 22, 2026 14:22
@wimi321
wimi321 merged commit 3783d8e into main Oct 22, 2026
12 checks passed
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.

[Bug]: 无法启动katago

1 participant