Regalia v1.0.7 #21
YDW99
announced in
Announcements
Replies: 1 comment
|
The source code files include an outdated README.md file along with the manuals. For detailed information about the relevant revisions (which encompass the manuals), please refer to the following: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What's Changed
Full Changelog: v1.0.6...v1.0.7
Regalia v1.0.7 — Stability & Performance Maintenance Release
v1.0.7 is a code-quality and stability maintenance release based on three independent code-review reports + two comprehensive first-principles code-review passes (Phase 18/19) + two rounds of UX refinement (Phase 20/21). Across 21 phases, 52+ improvements were implemented. No new features were introduced, but numerous latent bugs were fixed, and the two remaining architectural suggestions from the Kimi audit report (LRU cache eviction + virtual list) were implemented.
📊 Release Overview
🎯 Key Highlights
⚡ Performance Breakthroughs
1.
_reviewEvalCacheLRU Eviction (Phase 18)The old code commented "Unlimited cache size", arguing 60k entries ≈ 12MB was "negligible". First-principles analysis found three errors:
Fix:
MAX_ENTRIES = 2000soft cap (~800KB JSON, well under any quota)_evictIfOverCap()evicts oldest entries by Map insertion order (= LRU order)get()/set()refresh LRU order via delete+set_reviewEvalRequestedStep(the in-flight step) to avoid "analyzing..." flickerArray.from(m.entries())set()2. Review Move-List Virtual List (Phase 18)
When move count > 80, windowed rendering is enabled — only the viewport + 10 rows of overscan above/below are rendered as DOM nodes; top/bottom spacer
<div>s fill the total scroll height._buildReviewMovesInnerHTML(start, end)eliminates ~40 lines of landscape/portrait duplicationpassive:true), cannot block scrolling or interfere with scroll-restore_refreshReviewMovesOnly()replaces only.review-movesinnerHTMLrequestAnimationFrame_forceReviewWindowToStep()ensuresreviewGoTo()target is in window_resetRvVirtualState()on enter/exit review, new game, importPerformance: Not enabled under 80 moves (full render is faster for short lists); long-game render cost reduced from O(total moves) to O(visible + overscan).
3. Move Animation Slowed 30% (Phase 20, 120fps Preserved)
will-change:transform+translate3dcubic-bezier(.25,.1,.25,1)easing curve unchanged; only duration is longerdurationstable🐛 Critical Bug Fixes
Chess960 Castling "King Self-Capture" Fatal Bug (Phase 17)
Symptom: In Chess960 mode, when the king's starting position happens to be its castling destination square (e.g. an SP-ID where the white king starts on g1), castling caused the king to "capture itself" and vanish from the board.
Root cause: The
makeMv/makeMvInPlacecastling branch unconditionally executed:Fix: When castling AND
from === to, skip the king move entirely (per the Fischer Random Chess "castling in place" rule). Also fixedunmakeMvandanimateMovesymmetrically. Added 20 Node-sandbox regression tests.Chess960
unmakeMvBoard Corruption (Phase 18, Critical)Symptom: In ~half of all Chess960 SP-ID positions (e.g. white king on f1 castling kingside), the
makeMvInPlace→unmakeMvround-trip corrupted the board.Root cause:
unmakeMvstep 2 restores the king atf(king source), but the rook's destinationcr.tomay equalf(the rook moved to the king's old square) — step 2 already overwrote the rook with the king; step 4s.board[cr.from] = s.board[cr.to]then read the king instead of the rook.Fix: Save the rook piece itself in
undo.castlingRook.piece, restoring from the saved piece rather than relying on board state._reviewEvalCacheCorruption Race (Phase 19, Critical)Symptom:
requestEngineEval's cache-hit fast path and terminal-position fast path did not clear the pending debounce timer, allowing a stale debounce timer capturing a prior step's FEN to fire after the cache-hit return and overwrite the current step's correct cached eval.Fix: Clear
_reviewEvalDebounceTimerand increment_evalStaleGenon both fast paths to invalidate any in-flight callback.Cross-Mode Stale Callback Race (Phase 19, Critical)
Symptom:
onEngineEval's two filters are mode-exclusive; afterexitReview, a review-mode callback still in flight could pass the normal-mode gen check and overwrite the correct eval for up to 30 seconds.Fix: Capture
_evalRequestReviewModeat request time;onEngineEvalrejects cross-mode callbacks at the top.PGN
[%eval]Placeholder Offset (Phase 19, Critical)Symptom: FEN-start PGNs where Black is to move had evals attach to the wrong reviewStep (off by 1).
Root cause:
_parsePGNwas unaware of the null placeholder thatimportPGNprepends after parsing.Fix: Apply
_placeholderOffsetwhen populating the eval/annotation/comment caches.StockfishNative Thread Safety (Phase 19)
Five fields changed from non-volatile to volatile:
Root cause: These fields are written from multiple threads (
_engineExecutorworker, heartbeat thread, JS binder) without volatile/synchronization. A read on one thread may never observe a null write from another, producing NPEs or writes to a destroyed process's stream.stopAndWaitForBestmoveTimeout Stale-Bestmove Corruption (Phase 19)Symptom: When the engine didn't respond to "stop" within 1 second, the late bestmove was processed as a real move, potentially generating an AI move for the wrong position.
Fix: On timeout, set
_discardingPonderBestmove = trueto discard the late bestmove.ChessApp
UncaughtExceptionHandlerSwallowedError(Phase 19)Symptom: Worker-thread
Errors (OOM/StackOverflow/NoClassDefFoundError) were silently swallowed, leaving the JVM in a corrupted state — e.g. if the SF-Reader thread died from OOM, the engine silently stopped responding whileisProcessAlive()still returned true, causing a 30-120s apparent hang.Fix:
Errorsubclasses are now chained to the default handler so the process dies cleanly and restarts.🎨 UX Refinements (Phase 20 + 21)
Review Eval Bar / Analyze Button Enlarged (Phase 20)
Text and emoji now display fully with comfortable breathing room — no longer cramped.
Portrait Dialog Positioning Precision Fix (Phase 21)
Phase 20 attempt → Phase 21 precision fix:
The fullscreen dialog (New Game Settings) uses negative margins to cancel both paddings, maintaining true full-screen fill.
Landscape Anti-Shake Clipping Root-Cause Fix (Phase 21)
Phase 20 attempt (
.bsec margin-right:10px) was ineffective — the clip happens at.bsec's ownoverflow:hiddenboundary, not at the gap.Phase 21 triple fix:
margin-right:10px.bsecchanged tooverflow-x:visible; overflow-y:hidden_antiShakenow reserves 8px in BOTH orientations (isLandscape?0:6→8, matchingMAX_DISPLACEMENT_PX=8.0f)Landscape Move-History Panel Clipping Fix (Phase 21)
.panelnow hasoverflow-x:auto, so wide content scrolls within the panel instead of being clipped by.main'soverflow-x:hidden.📋 All 21 Phases at a Glance
@media(orientation:portrait)no width threshold +vw/clamp()findCastlingRooks, Shredder-FEN, UCI_Chess960_recalcCellSizefirst-principles rewriteenPassantTargetreverse-mapping_totalSteps = moveRecords.length + 1[%eval]off-by-one + redundancy cleanup🔍 Phase 19 Comprehensive Code Review Details
7 subagents reviewed all 20 source files (28,281 lines) in parallel:
20+ critical fixes implemented by priority: bug fix > functionality > performance > redundancy cleanup > simplification.
🛡️ Security & Compliance
stats.html CSP Added (Phase 19)
The stats page renders user-pasted PGN content but previously had no Content Security Policy. A CSP matching chess.html has been added:
File Header License Notice Completed (Phase 19 supplement)
stats.htmlwas missing the full Copyright + GPL v3 license block (only had the AI-GEN line in the<style>comment). A complete HTML comment license block matchingindex.html.tpl's style has been added to<head>.📁 Project Structure
📥 Downloads
Regalia-v1.0.7-release.apkRegalia-v1.0.7-manual-zh.htmlRegalia-v1.0.7-manual-en.htmlInstallation Requirements
Build Verification
📜 License
Regalia is a dual-licensed combined work:
🙏 Acknowledgements
🔄 Full Changelog
The changelog is ordered newest-to-oldest. See:
Regalia-v1.0.7-manual-zh.htmlAppendix ARegalia-v1.0.7-manual-en.htmlAppendix A🎉 v1.0.7 release complete! Thank you for using Regalia.
AI-GEN
This discussion was created from the release Regalia v1.0.7.
All reactions