Repository navigation
perf: 涂鸦模型不变时复用预测背景 - #78
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解决什么问题 / Problem
自由涂鸦中模型权重未改变时,每次拖动仍重复预测 75 × 46 个背景格点;探针、光标和主题切换也重复这项计算。
玩家会看到什么变化 / User-visible change
只减少重复计算,不改画面、教学或操作:保留一份全精度概率网格,模型类别或任何权重值变化才重算。主题照常重新着色,训练仍执行原计算。三猫、原玩法、撤销、草稿、学习记录与公开网址不变。
验证 / Verification
npm run verify:1,055/1,055 通过,215 个运行文件构建;git diff --check通过。predict,不修改模型。建议审阅路径
neural-field.mjs:缓存只依赖 kind 和完整权重快照,最多保留一张网格。neural.mjs:只替换背景概率读取,后续绘制和状态逻辑不变。边界与 AI 协助 / Limits and AI assistance
AI 协助定位、实现和验证;独立只读审阅没有发现具体缺陷。计算次数来自受控回归,不宣称实机帧率或整体加载速度倍增。一次网格占 27,600 字节,每次仍正常绘制;模型变化的训练帧仍需重新预测。不把自动测试计为学习者掌握。