Skip to content

feat: rework standalone ordered frames and memory-tree reports (#206) - #232

Merged
codeasier merged 2 commits into
mainfrom
feat/206-standalone-frame-tree-v3
Oct 11, 2026
Merged

codeasier merged 2 commits into
mainfrom
feat/206-standalone-frame-tree-v3

Conversation

@codeasier

@codeasier codeasier commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Reworks the standalone scope of #206 on top of the tested #230/#231 content, replacing the obsolete implementation in #207. This PR is for review; it does not expand cross-shard frame-tree support.

  • Standalone imports use format 3 and preserve lossless filename/line/name, original positions, recursion, and structured stack identity. Captured-frame counts distinguish genuine empty stacks from lost tail/all links.
  • Native sharded imports retain format 2, text identity, cache reuse, and their existing frameJson/coverage reader contracts. Compatibility exports remain format 1. Native shards do not get misleading empty standalone-frame tables.
  • event_frames returns original order (or explicit root-first display without changing position), and rejects partial/corrupt arrays by returning no rows.
  • active_memory_frame_tree_at_event decomposes live blocks after an event by full caller path. Inclusive/self bytes, requested bytes, and block counts conserve at each node. Pending-free stays included; static, preexisting, captured-empty, and missing/corrupt attribution remain distinct.
  • report memory-tree shares the query/API contract, supports timeout and text/JSON/self-contained HTML, and rejects partial or nonconserving graphs. Dataset roots are explicitly unsupported rather than implicitly selecting a shard.
  • English/Chinese documentation and append-only snapshot provenance updated.
  • Accessible full-tree search results, child-list/parent navigation, and stable keyboard focus make tiny and zero-byte frames reachable without changing proportional geometry.

Related work

Implements the single-database foundation requested by #206; supersedes the unmerged approach in #207. Cross-shard trees remain outside scope. No issues/PRs are closed automatically by this description.

Final verification

Tested head: 70f5817a93cad2b36310c1067a814889ba350e0e.
Frozen content tree: 71e00c3f529b654ad200d13ca998063cc6d79490.

  • CI run 38101001659: all seven jobs succeeded.
  • Dedicated Chromium job: all 12 browser interaction tests passed, zero skipped; with fixture provenance, 19 passed total. Missing browser support fails this job.
  • Python 3.11–3.13: each 2270 passed / 15 skipped. Python 3.10: 2239 passed / 46 skipped, including additional existing lifecycle condition skips. Browser tests skipped in the ordinary matrix execute in the dedicated browser job.
  • Final local full suite: 2270 passed / 15 skipped; branch coverage 92.87%, all critical coverage floors passed. Ruff/Black/diff passed; basedpyright 0 errors and 1633 informational warnings.
  • Five physical repository pickle fixtures re-imported and independently checked: 51,936 events, 325,233 ordered frame occurrences, 19,308 lifetimes, 81 complete event-time trees. Two LFS-pointer-only large fixtures were not counted.
  • Six actual HTML payloads preserve all 206 nodes, 200 edges, and 2028 numeric fields from the audited data. Remote changed-file blob SHAs and the CI merge-commit tree match the frozen source.
  • Wheel build/audit and clean-wheel acceptance passed in Python 3.13 CI. Local clean-wheel acceptance needed an isolated offline dependency installation because the stock nested venv could not see parent-venv dependencies; repository acceptance code was unchanged.

Actual-browser verification and screenshots

Renderer SHA256: 5dca5252bd35cda27ebaf57d058bd2d59745686c485ded6954707838adddc481.

Tested in real cloud Chrome on 2026-10-11 01:05:39–01:08:02 UTC, with real mouse and keyboard input. Six pickle-derived pages passed deepest 40-byte frame selection, distinct same-name paths, global search across unrelated focus changes, reset, zero results, clearing search, and focus preservation. Repeated Tab/Enter child navigation was exercised.

Captured filenames/functions were anonymized before testing; topology, numbers and renderer behavior were unchanged. No raw pickle/database, original source path, account information or credentials are published.

Initial proportional flamegraph and root totals

Sample 1 initial flamegraph and root memory totals

Previously zero-width deepest frame reached through search: inclusive/self/requested are all 40 bytes

Sample 1 deepest 40-byte frame selected through a search-result button

Keyboard navigation: visible blue focus outline on the next child-list button

Sample 5 device 1 keyboard focus retained on a child-list button

Evidence provenance and scope

Scope and limitations

This is the standalone single-database feature; cross-shard frame trees remain outside scope. Actual-fixture browser acceptance does not claim mobile/other-browser/GPU coverage, Space-key activation, every individual tiny node or every synthetic edge case. Dedicated automated Chromium tests cover the synthetic edge cases separately. The temporary interactive preview was restored to owner-only; these three approved anonymized screenshots remain available as PR evidence.

Snapshot provenance decision: updated

Copy link
Copy Markdown
Owner Author

最终本地验收完成:当前head55325a82757754dbe061654f061d31acb5d409d4、tree4b461866731b8a10caf7f8e1ddf4e4c9601d1bb9。

  • 完整套件含slow/规模及installed wheel:2271 passed / 2 intentional skips,617.37s;branch coverage92.87%,全部critical coverage门槛通过。没有新增帧功能测试被跳过。
  • 非editable wheel的50项帧/查询/报告/import隔离测试通过,包来源已确认非源码checkout。
  • 独立同树18项测试通过,覆盖损坏关联、删末尾/全部帧、非整数位置、native-v2/standalone-v3隔离、只读、超时恢复、守恒及1100层深栈。
  • Ruff/Black/diff、追加式snapshot provenance、build/wheel audit/clean-wheel通过;typecheck0errors,1633warnings(基线1630)。源码及产物冻结未变。

边界:实际Chromium因环境socket限制未启动,Node DOM执行实际renderer JavaScript并覆盖zoom/reset/search/hover/恶意文本转义,但不构成真实浏览器布局验收。clean-wheel使用既有依赖目录的临时适配,不宣称全新依赖解析。仍为单库功能,native-v2/compat-v1保留,跨片树不在本PR范围;当前远端exact-head CI另行核验。

Copy link
Copy Markdown
Owner Author

已追加修复提交 70f5817a93cad2b36310c1067a814889ba350e0e(tree 71e00c3f529b654ad200d13ca998063cc6d79490),保留草稿。

真实 fixture 浏览器验收发现,原比例图中小分支可被固定间隙压成零宽,搜索着色也无法进入。现在保留原始面积比例和所有节点数据,新增全树搜索结果、直接子节点列表、父级导航及稳定键盘焦点。同名结果按完整调用路径和 node_id 区分,零字节/微小节点也有可操作入口;文本仍用 textContent。

验证:

  • 最终本地完整套件:2270 passed / 15 skipped,覆盖率92.87%;15项为12项本地缺浏览器环境的测试及3项原有条件skip。Lint、格式、类型和关键覆盖门禁通过。
  • 独立 Chromium CI 明确强制浏览器环境,12项新交互测试全部 PASSED,0 skip(另7项fixture provenance通过)。覆盖微小/零值节点、同名路径、中文/恶意标签、全树搜索、键盘/重复导航、清空/reset及大量匹配。
  • 5份真实pickle重新导入并独立核对:51,936事件、325,233帧出现、19,308生命周期、81时点完整树均一致;两个LFS指针样本未计入。
  • 6份真实输出经路径/函数名匿名化后,在真实云Chrome中重新验收:40B最深节点可通过搜索及子节点导航进入,连续键盘操作、父级、Reset、跨分支搜索通过;根图几何与原输出一致。临时预览已恢复owner-only并验证未登录访问门禁。
  • 远端9个变更文件blob与本地冻结源码一致;CI测试merge commit的tree也等于上述head tree。

本次 CI:https://github.com/codeasier/pt-snap-cli/actions/runs/38101001659 ,Python3.10–3.13、Chromium、Lint、provenance共7个jobs全部成功。本评论补充并更新先前说明中的浏览器验收限制;不宣称移动端/跨浏览器或真实GPU执行已验收。

@codeasier
codeasier marked this pull request as ready for review October 11, 2026 01:28
@codeasier
codeasier merged commit cd1aac6 into main Oct 11, 2026
14 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.

1 participant