Refactor API status handling and add occlusion culling - #95
Conversation
🌿 Roseau API Breaking Change Report
🔴 rendering — 5 breaking change(s)
|
Reason: script execution via -e/-c flag Reply |
|
⏱️ Rate limited. Waiting 2.9s (attempt 2/3)... |
|
⏱️ Rate limited. Waiting 4.9s (attempt 3/3)... |
|
❌ Rate limited after 3 retries — Concurrency limit exceeded for user, please retry later |
|
API call failed after 3 retries: Concurrency limit exceeded for user, please retry later |
|
分析完成。以下是审查意见。 代码审查摘要 — PR #95操作: synchronize 🔴 关键(合并前需修复)
|
| 声称 | 状态 | 对应文件 |
|---|---|---|
| OcclusionCuller/OcclusionKey/OcclusionMethod 抽象 | ✅ | optimization/occlusion/*.java |
| 查询渲染管线 + 顶点/片元着色器 + FullTransformsUbo | ✅ | ALRPipelines.OCCLUSION_QUERY, occlusion_query.vsh/.fsh |
| GPU 设备接口 + OpenGL samples-query(GlSamplesQuery 生命周期) | GlSamplesQuery 存在但含 2 个 🔴 bug | |
| 可复用 GPU 资源 + ring buffer 基础(Query 池 / Query 缓冲池) | ✅ | GpuReusableResource(RingBuffer), LoopResetPool, SimpleResetPool, QueryBufferPack(RingBuffer) |
| Query 帧状态管理(当前帧提交执行、下帧读结果) | ✅ | FrameState, GpuQueryOcclusionCuller |
| compute-pass debug-group 懒 Supplier | ✅ | ALRComputePass(+Backend), GlComputePassBackend, GlDeviceMixin |
| ApiStatus.Internal 注解调整 | ✅ | 15 个 mixin 移除 + 内部实现类补注 |
| [x] Samples Query backend | 已实现但 glEndQuery/越界读使其实质不可用 | |
| [ ] Hi-Z backend | ✅(按 TODO 未声称完成) | 仅存 stub + depth_convert/ffx_spd shader + SPD pipeline 注册,未接线 |
| [ ] 接入 vanilla SubmitNodeStorage | ✅(未声称完成) | 未实现,符合描述 |
结论: REQUEST_CHANGES — 基础设施和框架设计扎实,但 GlSamplesQuery 的两处错误(glEndQuery target 传参 + 4/8 字节越界读)会让已声称完成的 Samples Query 后端在接入时立即挂起渲染线程;修复后再合并。其余为 Hi-Z 接线前的潜在问题,建议顺手修正宽高顺序和默认 flag 映射。
由 Hermes Agent 审查
|
💾 Self-improvement review: Skill 'rendering-gpu-pr-review' created. |
|
所有文件已审查完毕。汇总分析结果,输出审查意见: 代码审查摘要 — PR #95 (synchronize)操作: synchronize 📋 声称验证表
🔴 关键(接入即错的 latent bug,建议合并前修)
|
3c58b50 to
4cdf68c
Compare
|
💾 Self-improvement review: Patched SKILL.md in skill 'rendering-gpu-pr-review' (1 replacement). |
Reason: script execution via -e/-c flag Reply |
🌿 Roseau API Breaking Change Report
🔴 rendering — 6 breaking change(s)
|
|
All verification complete. I have a full picture of the PR. Writing the review: 代码审查摘要 — PR #95操作: synchronize 🔴 关键(接入前必须修复)
|
| 声称 | 状态 | 对应文件 |
|---|---|---|
| OcclusionCuller / OcclusionKey / OcclusionMethod 抽象 | ✅ | 3 个新文件 |
| occlusion-query 管线 + 顶点/片元着色器 | ✅ | ALRPipelines.OCCLUSION_QUERY + vsh/fsh |
| GPU 设备接口扩展 + GlSamplesQuery | ✅ | ALRGpuDeviceExtension(+Backend)、GlDeviceMixin、GpuDeviceMixin、ALRHICapabilities |
| GPU 资源/ring-buffer 池基础 | ✅ | GpuReusableResource(Pool)、LoopResetPool、SimpleResetPool |
| Query 帧状态管理(本帧提交、次帧读结果) | ✅ | FrameState、GpuQueryOcclusionCuller、QueryInstance |
| pushDebugGroup 改 Supplier | ✅ | ALRComputePass 全链路 |
| ApiStatus.Internal 注解调整 | ✅ | 渲染 + sync 模块 |
| Samples Query 后端 | GpuQueryOcclusionCuller;ALROptimizations.getOcclusionCuller() 无调用者 |
|
| Hi-Z 后端 | HierarchicalZOcculusionCuller 空实现 + ffx_spd/depth_convert + UBOs;createInstance 返回 null |
|
| 集成 vanilla SubmitNodeStorage | ❌ TODO | 无对应代码 |
🧪 测试建议
| 被测目标 | 推荐测试场景 | 优先级 |
|---|---|---|
FrameState.runQueries/fetchResults |
连续多帧 key 增删:池无重复 acquire、结果延迟一帧生效、释放后复用安全 | 🔴 |
| UBO 布局(接入后) | IntSizeUbo/ConvertDepthParamsUbo 写入字节与 GLSL 声明逐字段对照 |
🔴 |
GpuQueryOcclusionCuller.shouldDraw |
相机在 AABB 内部 / 包围盒部分可见 / 完全被地形遮挡三场景 | 🟡 |
GlSamplesQuery.getValue |
查询未 begin/end 时读取、release 后结果重置、close 后抛异常 | 🟡 |
结论: REQUEST_CHANGES — 基础设施质量整体很高(GL 调用、池时序、帧状态设计都正确),但三个 🔴 均为确定性缺陷:两个 UBO 宽高互换是接入即现的错误、withCull(true) 在相机入盒场景会错误剔除、Hi-Z 占位桩默认返回 false 是隐患。三者修复成本都极低(各一行级别),建议修复后再合入,避免错误语义沉淀到后续接线 PR。ALROptimizations 的接线入口建议在本 PR 内补一个最小调用链(哪怕只在 debug 模式),让 latent 问题能在真实帧循环中提前暴露。
由 Hermes Agent 审查
|
💾 Self-improvement review: Patched SKILL.md in skill 'rendering-gpu-pr-review' (1 replacement). |
🌿 Roseau API Breaking Change Report
🔴 rendering — 9 breaking change(s)
|
|
审查完成,所有关键路径已交叉验证(本地克隆 AnvilLib@dev/26.1、MC 26.1 反编译产物、shader、GL 常量值)。以下是审查意见: 代码审查摘要 — PR #95操作: synchronize 🔴 关键(确定性代码缺陷,接入即触发)
|
| 声称 | 状态 | 对应文件 |
|---|---|---|
| OcclusionCuller/Key/Method 抽象 | ✅ | optimization/occlusion/* |
| 查询管线 + 顶点/片元 shader + FullTransformsUbo | ✅(含 🔴 绕序/cull 问题) | ALRPipelines, occlusion_query.*, FullTransformsUbo |
| GPU device 接口 + GL samples-query 封装 | ✅ | GlSamplesQuery, GpuQueryObject, GlDeviceMixin |
| 资源池 + ring buffer 基础 | ✅(含 |
GpuReusableResourcePool, LoopResetPool, SimpleResetPool |
| 帧状态管理(本帧提交/次帧读取) | ✅ | FrameState, GpuQueryOcclusionCuller |
| compute debug-group 惰性 Supplier | ✅ | ALRComputePass, GlComputePassBackend |
| ApiStatus.Internal 注解调整 | ✅ | 15 个 mixin 移除 + 内部类标注 |
| Hi-Z 后端 | HierarchicalZOcclusionCuller | |
| Samples Query 后端 | GpuQueryOcclusionCuller | |
| 接入 vanilla SubmitNodeStorage | ❌ TODO 未勾选(自认) | 无 |
🧪 测试建议
| 被测目标 | 推荐场景 | 优先级 |
|---|---|---|
ALRComputePass.bindAll |
首次调用即 IOOBE(当前必现) | 🔴 |
ImageArrayBinding.apply |
resource.size() == size 与 > size 两分支(当前逻辑颠倒) |
🔴 |
QueryInstance 立方体 |
从 +x/-x 各方向 + 相机在 AABB 内部观察(samples 是否 >0) | 🔴 |
GpuSampleQueryPool |
连续 3 帧 key 数 > 池容量,验证 expand 与 release 时序 | 🟡 |
ALROptimizations |
启动顺序(create 先于 compute init)下的后端选择断言 | 🟡 |
结论: REQUEST_CHANGES — 基础设施方向正确、多数问题因未接线而处于 latent;但 bindAll 是对既有 API 的确定性回归、x+ 面绕序与 IntSizeUbo 宽高互换是确定的代码缺陷,建议合并前修复;其余
由 Hermes Agent 审查
|
💾 Self-improvement review: Patched SKILL.md in skill 'rendering-gpu-pr-review' (1 replacement). |
Reason: Security scan — [HIGH] Confusable Unicode characters in text: Content contains Unicode characters visually identical to ASCII (math alphanumerics, Cyrillic/Greek lookalikes) appearing near ASCII text, which may indicate a homoglyph attack Reply |
|
|
|
I reached the maximum iterations (90) but couldn't summarize. Error: <title>504 Gateway Time-out</title>504 Gateway Time-outopenresty |
🌿 Roseau API Breaking Change Report
🔴 rendering — 9 breaking change(s)
|
Reason: Security scan — [HIGH] Confusable Unicode characters in text: Content contains Unicode characters visually identical to ASCII (math alphanumerics, Cyrillic/Greek lookalikes) appearing near ASCII text, which may indicate a homoglyph attack Reply |
Reason: Security scan — [HIGH] Confusable Unicode characters in text: Content contains Unicode characters visually identical to ASCII (math alphanumerics, Cyrillic/Greek lookalikes) appearing near ASCII text, which may indicate a homoglyph attack Reply |
|
代码审查摘要 — PR #95操作: synchronize 📋 声称验证表
🔴 关键
|
| 被测目标 | 推荐测试场景 | 优先级 |
|---|---|---|
GpuSampleQueryPool / QueryInstancePool |
并发 acquire 耗尽 → fail(true) 扩容;release 后 isAcquired=false 可复用;close() 幂等 |
🔴 |
GlSamplesQuery.getValue() |
未 begin/end 的 query 读回;result 缓存与 release() 重置 |
🔴 |
FrameState.runQueries |
camera-inside 与正常 key 混合;UBO 数组含 null;key 数 > 512(DynamicUniformStorage 容量) |
🟡 |
OcclusionSubmitNodeCollection |
空列表、单 key 多 feature、wasUsed=false 时 endOcclusionRecord 不提交 |
🟡 |
QueryInstance.prepareTransform |
AABB 边界(零尺寸、负尺寸、极大坐标)下的矩阵数学 | 🟡 |
OcclusionFeatureRendererHelper.filterVisibleFeatures |
culler==null / 无 key 提交时零分配短路 | 🟢 |
结论: COMMENT — 基础设施质量高、分层清晰,Supplier 迁移与标注调整彻底。但 occlusion 流程渲染端已接线、提交端未接线的状态不一致 + 无条件创建 culler 带来的热路径每帧分配,建议在合入前明确接线状态(至少让 filterVisibleFeatures 在无 key 时短路),Hi-Z 空壳可保留但建议加显式开关。GPU query 的同步读回与未启动 query 读值建议后续优化。
由 Hermes Agent 审查(gh 未认证,标题未修改)
|
💾 Self-improvement review: Patched SKILL.md in skill 'rendering-gpu-pr-review' (1 replacement). |
🌿 Roseau API Breaking Change Report
🔴 rendering — 9 breaking change(s)
|
|
gh 认证已失效(token 无效),无法用 代码审查摘要 — AnvilLib PR #95操作: edited(PR 描述/分支变更) 🔴 关键(接入即崩 / 必现错误)
|
| 声称 | 状态 | 说明 |
|---|---|---|
新增 OcclusionCuller/OcclusionKey/OcclusionMethod 抽象 |
✅ | 三者齐备,createInstance 有 fallback 链 |
| occlusion-query 渲染管线 + 顶点/片元 shader | ✅ | OCCLUSION_QUERY + FullTransformsUbo + vsh/fsh |
GPU 设备接口 + GL samples-query 封装 GlSamplesQuery |
✅ | alrCreateSamplesQuery / glBeginQuery/glEndQuery 参数正确(end 传 target 非 id) |
| GPU 资源池 / ring-buffer 基础 + Query 专用池 | ✅ | GpuReusableResourcePool/LoopResetPool/SimpleResetPool + QueryInstancePool/GpuSampleQueryPool |
| Query 帧状态管理(当前帧提交/执行,下帧读取) | ✅ | FrameState 两帧滑动窗口 |
pushDebugGroup 改 Supplier<String> 惰性求值 |
✅ | ALRComputePass/ALRComputePipeline/GlDeviceMixin 同步更新 |
ApiStatus.Internal 从 mixin 类移除、渲染/sync 类标注 |
✅ | 15 个 mixin 移除,18+ 处新增(UBO/扩展接口/内部类) |
| [x] Samples Query backend | ✅ | GpuQueryOcclusionCuller 完整 |
[x] 集成 vanilla SubmitNodeStorage |
OcclusionSubmitNodeStorage 已实现,但 12 个 feature mixin 过滤链 + wrapSubmitNodeStorage 未见调用者——SubmitNodeStorage 包装未被实际挂到渲染流程(latent) |
|
| [ ] Hi-Z backend | HierarchicalZOcclusionCuller 骨架 + processFeatures 空实现 + shouldDraw 返回 true(保守 ✓)——可接受为后续工作 |
结论: REQUEST_CHANGES — 基础设施方向正确、GL 传参(glEndQuery target、4 字节读取宽度)本次已正确,但上一轮已标记的 5 个必现/回归级问题(x+ 面反绕、bindAll IOOBE、checkElementIndex 传反、FFX_SPD 缺 atomic binding、init 顺序)全部未修,且本 PR 已开始把 feature 过滤 mixin 接入(12 个 mixin 全部 @ModifyExpressionValue/ModifyReceiver),一旦接线完成这些 latent 问题会同时爆发。建议在合并前至少修复:查询盒绕序 + withCull(false)、bindAll 索引、checkElementIndex 参数、FFX_SPD atomic binding 注册、init() 顺序。
注:
gh auth status显示 token 已失效,无法执行gh pr edit更新标题(也未导出任何凭据)。标题Refactor API status handling and add occlusion culling基本准确,无需修改。
|
💾 Self-improvement review: Patched SKILL.md in skill 'rendering-gpu-pr-review' (1 replacement). |
Reason: script execution via -e/-c flag Reply |
Reason: Security scan — [HIGH] Confusable Unicode characters in text: Content contains Unicode characters visually identical to ASCII (math alphanumerics, Cyrillic/Greek lookalikes) appearing near ASCII text, which may indicate a homoglyph attack Reply |
🌿 Roseau API Breaking Change Report
🔴 rendering — 10 breaking change(s)
|
Reason: Security scan — [HIGH] Confusable Unicode characters in text: Content contains Unicode characters visually identical to ASCII (math alphanumerics, Cyrillic/Greek lookalikes) appearing near ASCII text, which may indicate a homoglyph attack Reply |
Reason: Security scan — [MEDIUM] Variation selector characters detected: Content contains Unicode variation selectors (VS1-256). These are commonly used in emoji sequences but may indicate steganographic encoding or obfuscation Reply |
|
gh 未认证(token invalid)→ 按 §20 规则跳过 代码审查摘要 — PR #95 (synchronize)操作: synchronize 基础设施阶段整体设计清晰(culler 抽象、双帧 query 状态机、ring pool、Supplier 化 debug group),但本同步轮仍遗留多个上一轮已标记的🔴问题,且绑定体系存在 3 个会直接导致 Hi-Z/FFX_SPD 首次 dispatch 崩溃或结果错位的缺陷。 🔴 关键(需修复后合并)
|
| 声称 | 状态 | 对应文件 |
|---|---|---|
| OcclusionCuller/Key/Method 抽象 | ✅ | OcclusionCuller, OcclusionKey, OcclusionMethod |
| occlusion-query 渲染管线 + 顶点/片元着色器 | ALRPipelines.OCCLUSION_QUERY, occlusion_query.vsh/fsh(drawIndexed 索引越界) | |
| 设备接口 + OpenGL samples-query 实现 | ✅ | ALRGpuDeviceExtension, GlDeviceMixin, GlSamplesQuery, GpuQueryObject |
| GPU 资源/ring-buffer 池化基础 | ✅ | GpuReusableResource(Pool), LoopResetPool, SimpleResetPool |
| Query 帧状态管理(双帧读回) | ✅ | FrameState, GpuQueryOcclusionCuller |
| pushDebugGroup 惰性 Supplier | ✅ | ALRComputePass, GlComputePassBackend, GlDebugLabelMixin |
| ApiStatus.Internal 注解调整 | sync 模块 8 文件重复 import(无功能影响但需清理) | |
| Samples Query 后端 | ✅ | GpuQueryOcclusionCuller + FrameState(已接线于 AnvilLibRendering + TestOcclusionTESR) |
| HiZ 后端 | HierarchicalZOcclusionCuller(stub:processFeatures/shouldDraw 空实现,未接线) | |
| SubmitNodeStorage 集成 | OcclusionSubmitNodeStorage/Collection(提交侧仅 TestOcclusionTESR 接线,消费侧 12 mixins 已接线) |
结论: REQUEST_CHANGES — 🔴 5 项需修复:drawIndexed 索引越界、checkElementIndex 传反、applyOrdered 未覆写、FFX_SPD atomic 绑定缺失、初始化顺序(Hi-Z 永不选中)。前 4 项是首次 dispatch 即崩/错位的硬缺陷,第 5 项是静默功能失效。上轮已标记的 IntSizeUbo 宽高互换、假能力探测、每帧阻塞读仍未修复。
由 Hermes Agent 审查(渲染专项 §1-21 清单核对)
注:gh 未认证(token invalid),按流程跳过标题修改。
|
💾 Self-improvement review: Patched SKILL.md in skill 'rendering-gpu-pr-review' (1 replacement). |
🌿 Roseau API Breaking Change Report
🔴 rendering — 10 breaking change(s)
|
Reason: Security scan — [MEDIUM] Variation selector characters detected: Content contains Unicode variation selectors (VS1-256). These are commonly used in emoji sequences but may indicate steganographic encoding or obfuscation Reply |
Reason: Security scan — [MEDIUM] Variation selector characters detected: Content contains Unicode variation selectors (VS1-256). These are commonly used in emoji sequences but may indicate steganographic encoding or obfuscation Reply |
Reason: Security scan — [MEDIUM] Variation selector characters detected: Content contains Unicode variation selectors (VS1-256). These are commonly used in emoji sequences but may indicate steganographic encoding or obfuscation Reply |
|
|
代码审查摘要 — PR #95操作: synchronize ✅ API 迁移健康度(26.1)
🔴 关键
|
| 声称 | 状态 | 对应文件 |
|---|---|---|
| OcclusionCuller/Key/Method 抽象 | ✅ | optimization/occlusion/* |
| occlusion-query 管线 + shader | ✅ | ALRPipelines, occlusion_query.vsh/.fsh |
| samples-query 创建/结果读取 + GlSamplesQuery | ✅ | ALRGpuDeviceExtension, GlDeviceMixin, GlSamplesQuery |
| GPU Query 生命周期 + ring-buffer 池 | ✅ | GpuQueryObject, pools, FrameState |
| Query 帧状态管理(本帧提交/下帧判读) | ✅ | GpuQueryOcclusionCuller, FrameState |
| compute debug group 惰性 Supplier | ✅ | ALRComputePass, GlComputePassBackend |
| ApiStatus.Internal 标注整理 | ✅ | rendering + sync 模块 20+ 文件 |
| Hi-Z 后端 | 仅基础设施占位(processFeatures 空、shouldDraw 恒 true) | |
| 与 vanilla SubmitNodeStorage 集成 | 已接入但被 Hi-Z 默认选中遮蔽,实际不剔除 |
结论: REQUEST_CHANGES
基础设施质量高、生命周期设计与池化逻辑自洽,但存在两处必须修复的问题:ImageArrayBinding 的 Preconditions 参数反转是明确的运行时 bug;后端选择顺序导致剔除集成在支持 compute 的常规机器上被无实现的 Hi-Z 后端接管而失效。另建议修复 TestOcclusionBlock codec 复制粘贴错误、清理调试 JVM 参数与重复 import。
由 Hermes Agent 审查
|
💾 Self-improvement review: Patched SKILL.md in skill 'minecraft-mod-pr-review' (1 replacement). |
🌿 Roseau API Breaking Change Report
🔴 rendering — 27 breaking change(s)
|
Reason: script execution via -e/-c flag Reply |
Reason: script execution via -e/-c flag Reply |
|
|
|
I reached the maximum iterations (90) but couldn't summarize. Error: <title>504 Gateway Time-out</title>504 Gateway Time-outopenresty |
|
💾 Self-improvement review: Patched SKILL.md in skill 'rendering-gpu-pr-review' (1 replacement). · Patched references/pr95-occlusion-culling-review-matrix.md in skill 'rendering-gpu-pr-review' (1 replacement). · Patched references/class-file-constant-extraction.md in skill 'rendering-gpu-pr-review' (1 replacement). |
Summary
This PR lays the first-stage foundation for occlusion culling in the rendering module and clarifies the visibility of selected internal APIs. It introduces the culler abstraction, GPU Query resources and draw path, and an OpenGL samples-query wrapper. The selectable Hi-Z and Query culling backends will be integrated in follow-up work.
Changes
OcclusionCuller,OcclusionKey, andOcclusionMethodto provide a common abstraction for rendering-feature submission, visibility decisions, and backend selection.FullTransformsUbo.GlSamplesQuerylifecycle wrapper.Supplier<String>values, avoiding unnecessary debug-text construction.ApiStatus.Internalannotations by removing them from mixin classes and explicitly marking rendering and sync classes, records, and extension interfaces that are internal implementations.Impact and Compatibility
ALRComputePass.pushDebugGroupand its backend implementation now acceptSupplier<String>instead ofString; direct implementations and callers of this internal API must be updated accordingly.TODO