{"id":50330650,"url":"https://github.com/a6tvhmj/cubelibrary","last_synced_at":"2026-05-31T11:00:56.400Z","repository":{"id":358227865,"uuid":"1234430664","full_name":"A6TVhmj/CubeLibrary","owner":"A6TVhmj","description":"Rubik's Cube solver in pure Python","archived":false,"fork":false,"pushed_at":"2026-05-16T10:42:10.000Z","size":400,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T09:38:13.755Z","etag":null,"topics":["kociemba","rubiks-cube","rubiks-cube-solver","ttkbootstrap","two-phase-algorithm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/A6TVhmj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-10T07:10:18.000Z","updated_at":"2026-05-19T10:09:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/A6TVhmj/CubeLibrary","commit_stats":null,"previous_names":["a6tvhmj/cubelibrary"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/A6TVhmj/CubeLibrary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A6TVhmj%2FCubeLibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A6TVhmj%2FCubeLibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A6TVhmj%2FCubeLibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A6TVhmj%2FCubeLibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/A6TVhmj","download_url":"https://codeload.github.com/A6TVhmj/CubeLibrary/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A6TVhmj%2FCubeLibrary/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33728391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kociemba","rubiks-cube","rubiks-cube-solver","ttkbootstrap","two-phase-algorithm"],"created_at":"2026-05-29T09:30:25.860Z","updated_at":"2026-05-31T11:00:56.388Z","avatar_url":"https://github.com/A6TVhmj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CubeLibrary (CL)\n\n**CubeLibrary**（简称 **cl**），是一个向 Herbert Kociemba 经典的 Delphi 版 **Cube Explorer** 致敬的现代化 Python 重制版。\n\n本项目不仅利用 `ttkbootstrap` 赋予了原版等距视角（Isometric 3D）魔方编辑器极具现代感的全新 UI，更在底层**用纯 Python 从零重构了 Kociemba 的两阶段算法（Two-Phase Algorithm）**。结合现代化的多线程队列与内存优化，打造出了一个速度极快、功能极全的魔方极客工具箱。\n\n## ✨ 全新核心特性 (Features)\n\n* 🎨 **经典的 3D 展开图与 WCA 规范**：完美复刻原版视觉体验。支持左/右键快速填色、未知色块（`?`）标记。默认遵循 WCA 标准配色（白顶绿前），并内置自动推导面色（AutoFix）与全局自定义调色板。\n* 🌍 **国际化与一秒换肤 (i18n \u0026 Themes)**：支持多语言**热切换**，无需重启瞬间生效！内置多种现代应用主题，一键切换暗黑/明亮模式。\n* 🎲 **WCA 随机状态打乱生成器 (Random State Scrambler)**：拒绝低效的“随机乱转”。内置真正的状态打乱引擎，生成 100% 符合 WCA 比赛标准的 20 步完美逆向打乱公式。\n* 🚀 **双核解算模式**：\n  * **Two-Phase (Fast)**：极速模式，应用铁腕深度剪枝，瞬间给出最优的快解还原公式。\n  * **Optimal (Slow)**：纯正的最少步（God's Number）死磕模式，绝对最短路径优先输出，自动向下兼容生成高质量次优解。\n* 🧩 **残缺魔方模式探测 (Incomplete Search)**：\n  * 支持输入带有未知色块的魔方状态。内置角/棱块排列穷举器与奇偶校验（Parity Check），自动过滤物理上无法还原的“错装状态”，输出所有数学合法的推导补全方案。\n\n## ⚡️ 底层算法与工程黑科技 (Under the Hood)\n\n与直接调用第三方封装库的 UI 套壳软件不同，**cl** 拥有完全自主掌控的底层计算引擎 CL Core，并实现了以下极限工程优化：\n\n1. **突破 NumPy 循环封印（Bytes Casting 提速）**：\n   在纯 Python 环境的 IDA* 高频循环中，引擎自动将百万量级的状态剪枝表转换为 **Python 原生 `bytes` 内存视图**，彻底消除 NumPy 装箱拆箱开销，寻路速度暴增 2~3 倍。\n2. **真正的全局迭代加深（True Iterative Deepening）**：\n   重构传统 Phase 1 深度迭代缺陷，**严格按“总步数”逐级展开搜索树**，确保列表最顶端输出的 100% 是数学意义上的绝对最短解。\n3. **二阶回溯与物理剪枝（2-step Lookback Pruning）**：\n   从底层物理规则上彻底封杀 `U D U'`、`R L R'` 合并等跨步抵消魔法，保证程序吐出的每一条次优解都是**饶了不同物理弯路的高含金量干货公式**，杜绝凑步数的垃圾废话。\n4. **电竞级背压控制与异常刺穿（Backpressure \u0026 Exception Piercing）**：\n   面对每秒成千上万的解法喷涌，采用 `Queue(maxsize=20)` 完美平衡毫秒级引擎算力与屏幕重绘；利用抛出 `StopSearchException` 刺穿深达 20 层的递归树，实现对后台计算引擎的 **0 延迟光速熔断**，彻底告别假死与僵尸线程。\n\n## 🤝 贡献与许可\n\n底层坐标转换与数学模型深受 Herbert Kociemba 先生论文及原始 Delphi 源码的启发，特此致敬。\n鸣谢魔方速拧社区及相关算法极客在 Pattern Database 剪枝逻辑上的宝贵讨论。\n本项目遵循 GPL-3.0 License 开源协议。如果您修改了本项目的核心算法或在其他软件中衍生使用了本项目代码，请保持同等开源并注明出处，共同促进魔方算法社区的繁荣！\n欢迎提交 Issue 或 Pull Request 共同探讨高阶图论搜索算法！\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa6tvhmj%2Fcubelibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa6tvhmj%2Fcubelibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa6tvhmj%2Fcubelibrary/lists"}