Skip to content

[问题] 0.6编译1h都没完事 #1773

Open

Description

@coderykw

游戏名与版本

马力哦赛车世界 星之卡比switch2版

S2Arm 版本

0.6.0

在哪台设备上出的问题

iPhone

诊断码或诊断包

D-PHCV

设备型号与系统版本

iPhone duo 27.3

iPhone / iPad 用什么装的包(Mac 问题可不填)

No response

包号

No response

现象

编译1h出门回来都没完事 又重新编译赛车世界 47分钟还没完事

能复现吗

每次都会

怎么复现

No response

截图 / 录屏

No response

Activity

  1. added
    bug
    on Nov 20, 2026
  2. coderykw commented on Nov 20, 2026

    @coderykw
    Author

    百分之百了着色器还在继续计时

  3. jhaizhou-ops commented on Nov 20, 2026

    @jhaizhou-ops
    Owner

    coderykw 你好,收到,诊断码 D-PHCV 我们已经取下来看过了。上传诊断的时候:

    • 赛车世界(0400380020056000)那次出包已经跑了约 58 分钟,停在「编译着色器库」的「直连库 3/5」,还在进行中,没有报错;
    • 同时还有另一款(0400C3F00006E000)也在「编译着色器库」,已经跑了约 39 分钟;两款同时编,会互相抢 CPU,各自都会更慢;
    • 另外「推到 iPhone」那一次失败的原因是:手机上的 S2Arm 不是这一版,要先点「更新 S2Arm」再推。

    所以这次不是卡死,是编得慢、而且进度条只显示粗的阶段计数,看不出还在做什么。进度页这一点 #1770 也提到了,我们会一起改,让进度页能看出当前在做哪一步、这一步做到多少。

    想确认两件事:

    1. 你的电脑是哪款 Mac、多少内存?
    2. 等它跑完之后,两款各用了多长时间?方便的话再点一次「故障报修」上传诊断码,我们看各阶段的实际耗时。
  4. nevenhsu commented on Nov 20, 2026

    @nevenhsu
    Contributor

    @jhaizhou-ops 「100% 后着色器还在继续计时」且整段编译耗时偏长的问题,与 #1723 处理的是同一类原因,主要来自三处叠加:

    1. 后段缺少进度上报:dsh_batch 在编批库之后的 SeFinish(采样模拟变体 _se)、VpFinish(顶点补齐变体 _vp),以及 pack/stage_direct_cpso.sh 中的计算管线(cs_pipelines.py)和基础管线(base_pipelines.py),此前都没有输出 S2A_PROGRESS,导致进度到 100% 后界面不再更新、只继续计时。
    2. 并发路数偏保守(容易落到单路):dsh_batch 的 -j 在出包一开始按当时的空闲内存估算(S2A_DIRECT_J)并全程沿用,16 GB 内存机器开头空闲约 4.8–5.8 GB 时会只开 1 路;后续管线阶段也沿用重活路数 J 跑单路,整体耗时因此拉长。
    3. 基础管线计数停顿:base_pipelines.py 原本按提交顺序等待结果,遇到单个耗时长(70–80 秒)的管线时计数会停在它前面。

    #1723 的解法

    • 补齐四段进度计数:为 SeFinish、VpFinish、cs_pipelines.py、base_pipelines.py 加上 Ticker(对应「直连库·采样模拟变体」「直连库·顶点补齐变体」「直连库·计算管线」「直连库·拉取基础管线」及多语言文案);base_pipelines.py 改用 as_completed 按完成先后推进计数,预算提前停时收尾补满。
    • 按实时空闲内存放宽 Metal 编译路数:dsh_batch 在编批库、_se、_vp 三段开头按此刻空闲内存重算路数(LiveLanes + Metal.Widen,上限为本单核数 S2A_JOBS,下限 -j),不再沿用开头过严的单路估算。
    • 管线阶段按本单核数并发:pack/stage_direct_cpso.sh 中内存占用很小的计算管线与基础管线改用 S2A_JOBS 并发,不再受 J 限制。

    在 16 GB / 8 核 Mac 冷编一款体育游戏的对比中,「编译着色器库」整段从推算 ≥ 60 分钟降到了约 28.7 分钟,后段四个步骤的进度也能实时看到。

  5. jhaizhou-ops commented on Nov 20, 2026

    @jhaizhou-ops
    Owner

    nevenhsu 谢谢这么完整的说明,三处原因和解法都对得上。#1723 已在 08:23 合入 main(27997fe1b),随 0.6.2 发布(0.6.1 里没有)。

    coderykw 对应你这帖的现象:0.6.2 起「编译着色器库」到 100% 后的四段(采样模拟变体、顶点补齐变体、计算管线、拉取基础管线)都有自己的进度计数,不再只剩计时;内存不宽裕的机器也不会一开头就被定成单路编。在一台 16 GB / 8 核的 Mac 上冷编一款游戏,这段从 60 分钟以上降到约 29 分钟。另外,采样模拟变体和顶点补齐变体两段按批合编的改动也在路上,能再快一截。0.6.2 发布时在这里通知。


    nevenhsu Thanks for the thorough write-up; all three causes and fixes check out. #1723 was merged into main at 08:23 (27997fe1b) and ships in 0.6.2 (not in 0.6.1).

    coderykw For what you saw here: from 0.6.2, the four phases after "compile shader library" hits 100% (sampler-emulation variants, vertex-fill variants, compute pipelines, base pipelines) each show their own progress instead of just a timer, and machines without much free memory no longer get stuck at a single compile lane from the start. Cold-building one game on a 16 GB / 8-core Mac went from 60+ minutes to about 29 minutes for this stage. Batch-compiling the two variant phases is also on the way and will cut more. We'll post here when 0.6.2 is released.

  6. jhaizhou-ops commented on Nov 21, 2026

    @jhaizhou-ops
    Owner

    @coderykw 0.6.2 已发布:https://github.com/jhaizhou-ops/S2Arm/releases/tag/v0.6.2

    出包卡在「编译着色器库」100% / 很久不动的修复在 0.6.2 里:后段补了进度计数(aa565af2b),并按批合编、放宽并行路数(27997fe1b、9323e98cb),不会再因为长时间没有计数被判卡住而停掉。请更新后重新出包。


    @coderykw 0.6.2 is out: https://github.com/jhaizhou-ops/S2Arm/releases/tag/v0.6.2

    The fix for builds stalling at 100% in "Compile shader library" is in 0.6.2: the last part now reports progress (aa565af2b) and is compiled in batches with more parallel workers (27997fe1b, 9323e98cb), so it no longer gets stopped as "stuck". Please update and rebuild.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions