mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-07 01:53:24 +09:00
[Refactor] (P13 W5 S7): Magma's wire-object collection, wire-store teardown, depth-resolve entry point and the fast-rebind destroy epoch follow the record-arm guard.
This commit is contained in:
@@ -3244,7 +3244,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
(samplerBindingOverrides == nullptr || samplerBindingOverrides->empty());
|
||||
if (cacheable && samplerDescriptorsUnchangedHint && m_fastRebindMemo.valid &&
|
||||
m_fastRebindMemo.frameIndex == frameIndex &&
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if MOBILEGL_BUILD_RECORD_ARM
|
||||
// A wire store destroyed since the memo was taken may have handed its handle
|
||||
// value to a later mint (see FastRebindMemo): "same VkBuffer" then names a
|
||||
// different store, so the memo is refused and the full walk re-records it.
|
||||
@@ -3546,7 +3546,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
}
|
||||
};
|
||||
mixWords(&programObj.descriptorSetLayout, sizeof(programObj.descriptorSetLayout));
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if MOBILEGL_BUILD_RECORD_ARM
|
||||
// P7 M2 round 2 (ID-P7-43): the buffer infos below name WIRE stores by VkBuffer
|
||||
// handle, and a wire store can be destroyed mid-frame (VkBufferManager::
|
||||
// DeferredWireRelease) with its handle value re-minted before this frame's memo
|
||||
@@ -3611,7 +3611,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
/*valid=*/true, frameIndex, program.GetLifetimeId(), programObj.hash,
|
||||
fastRebindUboBinding, bufferInfos[0].buffer,
|
||||
bufferInfos[0].range, descriptorSet,
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if MOBILEGL_BUILD_RECORD_ARM
|
||||
m_bufferManager->GetWireStoreDestroyEpoch(),
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -1236,7 +1236,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
void VkBufferManager::Shutdown() {
|
||||
if (g_activeBufferManager.Get() == this) {
|
||||
g_activeBufferManager.Get() = nullptr;
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if MOBILEGL_BUILD_RECORD_ARM
|
||||
// Under a transport the table is the PROCESS's and serves every session: it dispatches
|
||||
// to the calling session's own manager (WireManager), so one session's renderer going
|
||||
// away must not take it from the others - their buffer creates would be dropped from
|
||||
@@ -1255,7 +1255,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
m_unboundTexelBuffer.Destroy();
|
||||
DestroyAllDeferredReleases();
|
||||
ReleaseAllLiveResources();
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if MOBILEGL_BUILD_RECORD_ARM
|
||||
// DestroyAllDeferredReleases above emptied the parked list; this destroys the stores the
|
||||
// records still hold, so nothing this arm minted outlives the count.
|
||||
if (!m_wireBuffers.empty()) ++m_wireStoreDestroyEpoch;
|
||||
|
||||
@@ -3506,7 +3506,7 @@ void main() {
|
||||
// Parked surface targets (ActivateSurfaceTarget) go before the device and instance.
|
||||
for (auto& [_, target] : m_parkedTargets) DestroyParkedTarget(target);
|
||||
m_parkedTargets.clear();
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if MOBILEGL_BUILD_RECORD_ARM
|
||||
// P7 wave 2 package B3: the session's decline tally. Silent when nothing declined, so a
|
||||
// green lane stays quiet and a lane that dropped a draw cannot (rule I's observable).
|
||||
WireDeclineTally::Dump("shutdown");
|
||||
@@ -3518,11 +3518,15 @@ void main() {
|
||||
CollectWireObjects(m_submitCounter, true);
|
||||
ClearAllWireDrawPassCaches();
|
||||
DestroyWireColorBlitResources();
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
DestroyWireYuvResources();
|
||||
#endif
|
||||
DestroyWireDepthMipmapResources();
|
||||
DestroyWireMultisampleResolveResources();
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
DestroySharedImagePresentTargets(false);
|
||||
DestroySharedImageSync();
|
||||
#endif
|
||||
#endif
|
||||
OnSubmitsCompletedUpTo(m_submitCounter);
|
||||
DestroySubmitFencePool();
|
||||
@@ -13843,8 +13847,10 @@ void main() {
|
||||
// Mid-frame-flushed command buffers whose submission just completed can
|
||||
// be freed now; present-less flush loops have no other reclaim point.
|
||||
m_frameContext.FreeRetiredCommandBuffersCompletedUpTo(m_completedSubmitCounter);
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if MOBILEGL_BUILD_RECORD_ARM
|
||||
CollectWireObjects(m_completedSubmitCounter);
|
||||
#endif
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
RecycleSharedImageSemaphores(m_completedSubmitCounter);
|
||||
#endif
|
||||
}
|
||||
@@ -16030,11 +16036,13 @@ void main() {
|
||||
m_shaderDrawParametersFeatureEnabled ? "true" : "false");
|
||||
VK_VERIFY(vkCreateDevice(m_physicalDevice.handle, &deviceCreateInfo, nullptr, &m_device), "vkCreateDevice");
|
||||
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if MOBILEGL_BUILD_RECORD_ARM
|
||||
if (wireDepthResolveEnabled) {
|
||||
m_wireCreateRenderPass2 = reinterpret_cast<PFN_vkCreateRenderPass2>(
|
||||
vkGetDeviceProcAddr(m_device, wireDepthResolveCore ? "vkCreateRenderPass2" : "vkCreateRenderPass2KHR"));
|
||||
}
|
||||
#endif
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
if (m_wireAhbImport) {
|
||||
m_wireGetAhbProperties =
|
||||
reinterpret_cast<void*>(vkGetDeviceProcAddr(m_device, "vkGetAndroidHardwareBufferPropertiesANDROID"));
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
| W5 S0 | 本地完成 | | 设计见 `notes/p13/` 下的 `W5-DESIGN.md`(临时 CMake 变量 `MOBILEGL_BUILD_RECORD_ARM`,S7 一次翻转,S8 unifdef 掉)。开放三点已定:记录失败钩子在 `FatalFunnel.cpp` 静态注册;`RecordArmTable` 承接三个持久映射 / wire 延迟旋钮(`IpcTable` 仍只在 DISAGG);S7 加 mprotect 臂开关(FCL 是 JVM 进程,SIGSEGV 链接是真风险)。清单 `W5-INVENTORY.csv`(`tools/w5_classify.py`):A 385 块 / 10586 行、B 29/434、C 92/10878、D 89/4683、E 77/933、F 292/3184、N(取反 / 复合)30/1545。主机 x86_64 Release 基线:push 库 `.text` 11540563、0 个 `MG_Remote::` 符号;split 库 `.text` 12766899、1651 个 |
|
||||
| W5 S1 | 本地完成 | `534f14e3` `3b441531`(已推) | 致命词表(`FatalFamilies.def`、`MGFatalFamily`、名字、计数)移到 `MG_Pipe/PipeFatalFamily.h`,`MG_Remote/FatalFamily.h` 只留线上投影并转出旧名。记录臂的失败 / 闩缝:`MGPipeRecordFail` / `MGPipeRecordLatch` / `MGPipeRecordLatched`(`PipeSessionFail.h`,默认:日志 + stderr + abort),链接了 MG_Remote 时由 `FatalFunnel.cpp` 静态注册 `SessionFail` / `SessionLatch` / `SessionLatched`。fatal census 认新调用(规则 2)并认默认分支的 abort 为漏斗;单元 `RecordFailSeamTest` 两棵树都跑 |
|
||||
| W5 S2 | 本地完成 | | `MOBILEGL_BUILD_RECORD_ARM`(普通 CMake 变量,恒定义 0/1,S7 前等于 DISAGG);`tools/w5_rewrite.py` 把 MG_State(缓冲 / 程序 / 帧缓冲状态)、MG_Impl(GLImpl、Pipe)、MG_Pipe、MG_Util/SelfTest、MG_Backend 下 A / F 类与 `!DISAGG`、`VERIFY && !DISAGG` 守卫改名,共 536 组、按目录 7 个提交;EGL 层、GL 上下文的设备丢失状态、日志角色文件、统计 dump 路径留给 S3 手工。不变量已核:split 与 push 两库 `.text` 字节相同(sha 前缀 `a0d08e0e` / `df9d3b7a`,与 S1 一致)。`wire_declines_audit` 把新守卫当作构建选择开关(含两条自测) |
|
||||
| W5 S3 | 本地完成 | `e544121e`…`7f194a85` | 手工改守卫:记录臂的声明、存根、T0 拆分、Magma wire 纹理 / 顶点输入构建、对象死亡、caps 来源跟 `RECORD_ARM`;共享图像、设备丢失闩、双块诊断留 DISAGG。应用侧后端经 `MG_Backend::ApplyRoleBackend` 钩子(`ServerLoop.cpp` 静态安装,无传输时为空,与 monolith 原答案相同) |
|
||||
| W5 S4 | 本地完成 | `73a185f6` `0f5658f5` `fe5324c9` `8e76f9dc` `85125167` | 代码迁出 MG_Remote,命名空间 `MG_Record`:暂存库到 `MG_Backend/Record/`;持久映射跟踪器到 `MG_State/.../BufferState/`(领养层判定留 `MG_Remote/Client/AdoptTierChoice`);`ServerVerbSink` 的记录动词抽成 `RecordVerbSink`(`ServerVerbSink` 继承它,只留会话动词);动词发射器、monolith 动词端口、客户端 GPU 写集合到 `MG_Impl/Pipe/Verb/`(会话经 `MG_Record::VerbSession`,`EmitTables.cpp` 静态装解析器)。include-closure 新探针 `record-core`(`--expect-probes 5`)。link ratchet 171 不变,fatal census 76 不变 |
|
||||
| W5 S5 | 本地完成 | `b13af729` `b1978890` | 记录臂三旋钮进 `RecordArmTable`;`DataArmIsRecord` / `RecordArmAliasesFrontend`、`MonolithTakesRecordArm`、`MOBILEGL_PIPE_DATA_ARM` 跟 `RECORD_ARM`(不再跟传输) |
|
||||
| W5 S6 | 本地完成 | `dd7fbbd7` | 集成 peek 在无传输构建里也答 `dataArmIsRecord`;跟踪器探针跟 `RECORD_ARM` |
|
||||
| W5 S7 | 本地完成(CI 待跑) | `19610290` `23593c9f`…`e9a353c3` | **翻转**:`MOBILEGL_BUILD_RECORD_ARM` 恒 ON,无 MG_Remote 的库(FCL 形态)也跑记录臂。`MOBILEGL_PIPE_PERSISTENT_MPROTECT=0` 关掉跟踪器的 SIGSEGV 处理器(FCL 是 JVM;启动打日志;单元 `TheMprotectSwitchSendsEveryNewMapToTheHashScan`),mprotect 臂只在 Linux / Android 编。`runtime_mode_proof` 加正半:两形态都要 `MG_Record` 符号(push 294、split 300),自测含两条无 `MG_Record` 的红例。翻转后 push 单元暴露的残留误分类(记录动词的 verb 状态盖章、按记录读的顶点 / IBO / 绑定点 / 采样器路径、XFB 捕获回落、视图窗口 mip、镜像可绑定重铸、暂存库跟随、跟踪器成员资格、测试的前端臂钉)全部改跟 `RECORD_ARM`;push 单元 2028/2028 |
|
||||
|
||||
### G1 退役读数(ID-P13-4,2026-10-06)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user