fix: negative splice start corrupts scene order; deleted entries unmount last - #9
Draft
sskyy wants to merge 3 commits into
Draft
fix: negative splice start corrupts scene order; deleted entries unmount last#9sskyy wants to merge 3 commits into
sskyy wants to merge 3 commits into
Conversation
…anchor lookup data0 passes raw splice argv through to the patch. A negative start (Array.prototype.splice semantics, e.g. splice(-1, 1, x)) made findAnchor compute the anchor from the wrong index, silently inserting new rows at the head of the list and diverging scene order from data (and from the hosts bookkeeping, corrupting all subsequent patches). Co-authored-by: Zhenyu Hou <skyking_H@hotmail.com>
distanceTo returned -1 for entries deleted from the spatial index, but the unmount queue drains in descending distance order, so deleted (ghost) entries were unmounted last under budget pressure — the opposite of the documented intent. Return Infinity instead; mount and replace queues are unaffected (deleted entries are filtered by buildMountRow existence checks). Co-authored-by: Zhenyu Hou <skyking_H@hotmail.com>
Bump version to 0.1.0 for the first npm publish, add publishConfig (public access for the scoped package) and repository metadata, and make the AXLE_VERSION test read the version from package.json instead of hardcoding it. Co-authored-by: Zhenyu Hou <skyking_H@hotmail.com>
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.
深度 review 中发现并实测复现的两个 bug,均已修复并附回归测试;另含 0.1.0 首次发布的版本准备。
1.
RxListHost.handleSplice:负数 splice 索引静默破坏场景图顺序data0 的
RxList.splice把原始argv(含负数 / 越界 start,Array.prototype.splice语义)透传给 patch。hosts.splice本身按原生语义处理没问题,但findAnchor(start + deleteCount)用的是未规范化的 start:items.splice(-1, 1, 9)(数据[1,2,3] → [1,2,9])会把锚点算到findAnchor(0),新行被插到列表头,场景图变成[9,1,2];hosts簿记数组(原生负索引语义)与场景图从此不一致,后续所有 patch 的锚点都会错位。修复:在锚点计算前按原生语义规范化 start(负数从尾部折算、越界 clamp 到
[0, hosts.length])。2.
RxWindowedList:已从索引删除的条目最后才卸载(与注释/文档意图相反)distanceTo对已删除条目返回-1,注释写的是「排到队首」;但卸载队列按b.distance - a.distance降序消化(最远优先),-1是最小值,实际被排到队尾。预算紧张时(正是分帧卸载机制存在的场景),数据层已不存在的幽灵卡反而在画布上停留最久。修复:deleted 返回
Infinity。挂载/替换队列按升序消化,deleted 排到队尾且出队时会被buildMountRow的存在性校验过滤,不受影响。3. 0.1.0 发布准备
0.0.0 → 0.1.0(package.json+AXLE_VERSION),版本一致性测试改为从package.json读取而不是硬编码;publishConfig.access: public(scoped 包首次发布必需)与repository元数据。注意:
npm publish目前被@axiijsscope 在 npm 上不存在(404 Scope not found)阻塞,需要先在 npmjs.com 上创建axiijsorganization(token 用户sskyy认证正常)。测试
npm run check(typecheck + lint + 全部 247 个测试 + build)全部通过。