Skip to content

Commit bed4876

Browse files
committed
fix: align benchmark LLVM and preserve precise CI diagnostics
1 parent dd30d64 commit bed4876

8 files changed

Lines changed: 161 additions & 13 deletions

‎.agents/docs/2026-10-08-llvm-2313-linux-aarch64-ecosystem-part2-design.md‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,3 +401,63 @@ xlings 客户端修复集中在一个必要 PR。资源生产、配方和消费
401401
依赖发布物摘要的自动索引更新、bootstrap pin 更新属于必要收尾;
402402
它们不能通过提前引用尚未发布的版本消除。Windows 红项的原因仍需
403403
失败现场证据,不能将新增 ARM64 支持视为该问题已经解决。
404+
405+
## 12. 2026-10-08 综合 review 补记
406+
407+
本节给出维护者评审入口,更新以上快照中的验证状态。本文仍为设计与
408+
准入方案;存在实现提交或资源构建通过,不表示生态交付已经完成。
409+
410+
### 12.1 默认组合与软件闭包
411+
412+
推荐冻结的新安装组合为 `llvm@23.1.3 + aarch64-linux-gnu`。工具链和
413+
target 两个持久配置同时验证。已有 musl 配置继续保留;迁移命令需要
414+
显式 target,例如 `mcpp toolchain default llvm@23.1.3 --target aarch64-linux-gnu`,
415+
并以实际配置、解析结果及构建运行确认两轴已经改变。
416+
417+
首批资源采用 glibc 2.44.3-r1、linux-headers 5.11.1、gcc-runtime 15.1.0、
418+
zlib 1.3.1、libxml2 2.13.5,以及 LLVM 内的 libc++、libc++abi、libunwind
419+
和 compiler-rt。gcc-runtime 满足编译器进程的 GNU C++ 运行依赖;新项目
420+
的 C++ 标准库仍是 libc++。C ABI 系统库消费者纳入交付,预制 C++ 库仍
421+
遵守现有 ABI 校验;完整 GUI 栈和 native GCC 不作为本次默认切换前提。
422+
423+
glibc 包的准入覆盖开发文件和运行数据:CRT、头文件、linker scripts、
424+
loader、核心库、gconv、UTF-8 locale、时区数据。NSS 探针验证解析功能;
425+
宿主 `/etc/hosts`、`resolv.conf`、`nsswitch.conf`、用户数据库是明确的
426+
配置输入,不能把读取这些输入描述为所有宿主依赖均已消除。受管 loader
427+
和核心 libc 同源,并分别验证工具进程与生成程序的实际依赖路径。
428+
429+
### 12.2 Review 结论与待决风险
430+
431+
| 项目 | Review 结论 | 准入条件 |
432+
|---|---|---|
433+
| 上游 ARM64 复用 | 优先采用上游 carve,已有内容检查支持继续推进 | G0–G3 原生运行证据及每份公开资产摘要 |
434+
| 架构资源选择 | 元数据和安装使用同一个客户端进程 ABI 上下文 | xlings 修复发布;索引能力下界与旧索引回退实际可用 |
435+
| GNU native 能力 | LLVM 默认及 target 双轴一起切换 | 冷安装、自举、modules、matrix、openkal、pack 均实际通过 |
436+
| 宿主污染 | unset 环境变量只是隔离措施的一部分 | include trace、INTERP、loader `--list` 证明受管路径,缺包负向探针失败 |
437+
| 历史兼容 | 新增 ARM64 不改变已发布 x86_64 资产摘要 | 旧 LLVM ARM64 具名不可用;有安装行为变化的旧配方递增 revision |
438+
| Windows 红项 | 原底镜像归因证据不足,仍是待闭合项 | 对实际驱动与辅助程序抓哈希、版本、搜索路径及原生启动对照 |
439+
| latest 与回退 | 精确版本先交付;latest 遵循 SPEC-009 §10.7 | 发布版 mcpp 消费通过;双镜像一致;故障回退用新 revision |
440+
441+
Windows 后续失败现场的驱动搜索目录含 `15.2.0` 和全局 registry,
442+
而索引钉住的归档是 GCC 16.1.0,归档 cc1plus 摘要与现场文件一致。
443+
这提示驱动选择或环境存在不一致,但尚未确定原因。驱动字节哈希、
444+
同字节改名启动及 PowerShell 原生启动对照用于区分污染与路径路由。
445+
归档有 cc1plus 和镜像发生变化均不能单独证明 Defender 是根因。
446+
447+
### 12.3 实测状态与发布顺序
448+
449+
| 证据对象 | 本次核查 | 尚未证明 |
450+
|---|---|---|
451+
| [索引首次原生资源构建](https://github.com/openxlings/xim-pkgindex/actions/runs/37684733504) | run 已完成,结论 success | 后续 provenance、运行数据修订的最终资产准入及双镜像消费 |
452+
| [xlings #647](https://github.com/openxlings/xlings/pull/647),`276fce5` | draft/open,9 个检查均 success | 已合入、已发版、旧客户端兼容与新索引公开传播 |
453+
| [xim-pkgindex #938](https://github.com/openxlings/xim-pkgindex/pull/938),`6ebe2179` | draft/open;源码、配方与运行数据修订已提交 | 最终 ARM64 资产公开路由与全部消费门 |
454+
| [mcpp #781](https://github.com/mcpp-community/mcpp/pull/781),`42e8b884` | draft/open;[该头 CI](https://github.com/mcpp-community/mcpp/actions/runs/37686310140) 已完成,结论 failure | Windows 缺口闭合及最终生态准入 |
455+
456+
发布依赖采用第 11.3 节的集中 PR 安排。资源构建与引擎接线可并行准备;
457+
公开启用顺序为:原生资产准入 → xlings 修复发布与镜像 → 索引架构路由和
458+
客户端下界 → mcpp 最终矩阵与发布 → GLOBAL/CN 发布版冷消费 → latest。
459+
不能提前宣告未来客户端版本已可用,也不能以旧头 CI 替代最终头验证。
460+
461+
维护者本次 review 的重点为默认组合、完整 glibc 运行数据、必要客户端
462+
修复、原生 GNU 支持范围及上述准入顺序。原生 GNU 行在未通过门之前
463+
维持 preview;本补记不授予发布准入,也不将计划中的测试计为通过。

‎.agents/docs/2026-10-08-llvm-2313-part2-execution-and-dependencies.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,26 @@ xim-pkgindex #938 已推送 `193f910e`,冻结五种依赖源码的下载摘要
9393
15 跳过、952 未选入、3 项既有 xpass;架构与客户端门 11/11 通过。
9494
原生资源首轮 CI 已完成依赖构建并进入 glibc;新提交将生成包含完整
9595
来源记录的资源。尚未写入 ARM64 公开路由或占位摘要。
96+
97+
## 6. 2026-10-08 最终头缺口与客户端发布
98+
99+
mcpp `42e8b884` 的 CI 已结束,存在五个失败检查:Linux E2E 分片、
100+
xcode-27 E2E 分片、ARM64 matrix、其依赖 coverage,以及 bare-Windows。
101+
Linux 641 将通用能力列表中的 Android 名称误判为实际目标选择;修正
102+
需要对解析出的 Linux C ABI 作正向断言。macOS 230 使用 benchmark 的
103+
旧 LLVM 常量,Xcode 27 链接失败;benchmark 当前常量更新,历史测量
104+
记录继续保持原版本与数字。
105+
106+
ARM64 matrix 的失败包含旧客户端选取 x86 glibc loader 和公开资源
107+
缺席。新的客户端、每架构配方和真实资源路由均是它的前置条件。coverage
108+
随 matrix 未完成失败,不构成另一个已定位的引擎故障。Windows 现场
109+
驱动搜索目录与已验证归档版本不一致,新增字节哈希、改名启动及原生
110+
启动对照;根因尚未确定,不按基础设施故障豁免准入。
111+
112+
xlings #647 在 `276fce5` 上的 9 个检查全部通过,自审确认 metadata、
113+
overlay、本地校验和安装复用同一进程 ABI 上下文。PR 已 squash 合入
114+
`c55d89aa`,关联 #646 随合入关闭。普通合入需要 reviewer;用户已授权
115+
完整合入与发布,按该仓库贡献流程,在全部检查通过后使用管理员合入。
116+
[2026.10.8.1 发布工作流](https://github.com/openxlings/xlings/actions/runs/37690643833)
117+
已经启动。发版成功、CN 补传、索引传播和 mcpp bootstrap pin 前移仍须
118+
以公开资源与消费证据证明。

‎.github/tools/check_aarch64_llvm_payload.sh‎

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,46 @@ grep -q 'libnativeabi.so.1' "$report/dynamic.txt" || {
102102
# Replay the engine's effective header compile as a preprocess trace. The trace
103103
# must resolve libc headers through the payload, without an ambient /usr tree.
104104
python3 - "$report" <<'PYTRACE'
105-
import json, pathlib, re, shlex, subprocess, sys
105+
import json, os, pathlib, re, shlex, subprocess, sys
106106
report = pathlib.Path(sys.argv[1])
107107
cdb = next(pathlib.Path('target/aarch64-linux-gnu').rglob('compile_commands.json'))
108108
entries = json.loads(cdb.read_text())
109109
entry = next(e for e in entries if e['file'].endswith('/headers.cpp'))
110110
args = entry.get('arguments') or shlex.split(entry['command'])
111+
# The driver named by the cold project's CDB must itself have a managed
112+
# ARM64 loader and dependency closure, independently of the program it emits.
113+
store = (pathlib.Path(os.environ['MCPP_HOME']) / 'registry/data/xpkgs').resolve()
114+
compiler = pathlib.Path(args[0]).resolve()
115+
relative = compiler.relative_to(store)
116+
assert relative.parts[:2] == ('xim-x-llvm', '23.1.3'), compiler
117+
118+
driver_env = dict(os.environ)
119+
driver_env.pop('LD_LIBRARY_PATH', None)
120+
driver_env.pop('LD_PRELOAD', None)
121+
122+
def capture(name, command):
123+
result = subprocess.run(command, text=True, capture_output=True, env=driver_env)
124+
text = result.stdout + result.stderr
125+
(report / name).write_text(text)
126+
assert result.returncode == 0, (command, text)
127+
return text
128+
129+
header = capture('compiler-elf-header.txt', ['readelf', '-hW', str(compiler)])
130+
assert re.search(r'Machine:\s+AArch64', header), header
131+
version = capture('compiler-version.txt', [str(compiler), '--version'])
132+
assert re.search(r'clang version 23\.1\.3(?:\s|$)', version), version
133+
program_headers = capture('compiler-program-headers.txt', ['readelf', '-lW', str(compiler)])
134+
match = re.search(r'Requesting program interpreter: ([^\]]+)', program_headers)
135+
assert match, program_headers
136+
loader = pathlib.Path(match.group(1)).resolve()
137+
loader_relative = loader.relative_to(store)
138+
assert loader_relative.parts[0] == 'xim-x-glibc', loader
139+
assert loader.name == 'ld-linux-aarch64.so.1', loader
140+
closure = capture('compiler-loader-resolution.txt', [str(loader), '--list', str(compiler)])
141+
assert not re.search(r'=> /(?:usr/lib|lib64?|usr/local/lib)/', closure), closure
142+
for path in re.findall(r'=> (/\S+)', closure):
143+
pathlib.Path(path).resolve().relative_to(store)
144+
print('PASS: cold LLVM frontend has native ARM64 managed loader and libraries')
111145
clean = []
112146
i = 0
113147
while i < len(args):
@@ -130,7 +164,10 @@ assert any('xim-x-glibc' in path and path.endswith('/features.h') for path in he
130164
assert not any(re.match(r'/usr/(include|lib/gcc|local/include)(/|$)', path) for path in headers), headers
131165
print('PASS: libc include trace uses the managed payload')
132166
PYTRACE
133-
cat "$report/program-headers.txt" "$report/loader-resolution.txt" "$report/include-trace.txt"
167+
cat "$report/program-headers.txt" "$report/loader-resolution.txt" \
168+
"$report/compiler-version.txt" "$report/compiler-elf-header.txt" \
169+
"$report/compiler-program-headers.txt" "$report/compiler-loader-resolution.txt" \
170+
"$report/include-trace.txt"
134171
"$MCPP" pack --mode self-contained --format dir --message-format json > "$report/pack.json"
135172
bundle="$(python3 - "$report/pack.json" <<'PYPACK'
136173
import json, sys

‎bench/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ than what it said.
212212
| xmake | **3.1.0** | `matrix.json` → `tools` |
213213
| bazel | **9.2.0** | `matrix.json` → `tools` |
214214
| gcc | **16.1.0** | `bench/src/toolchain.cppm` |
215-
| clang / libc++ | **22.1.8** (Windows: 20.1.7) | `bench/src/toolchain.cppm` |
215+
| clang / libc++ | **23.1.3** (all hosts) | `bench/src/toolchain.cppm` |
216216
| reference mcpp | **2026.8.11.3** | `matrix.json` → `reference_mcpp`; the run records which release it actually resolved in `meta.json`, and the report names it in the column header |
217217
| mcpp (the workload) | **2026.8.11.3** — `a749e9f` | submodule `projects/mcpp/mcpp-2026.8.11.3` |
218218
| xlings (combined style) | **2026.8.11.2** — `b1563fe` | submodule `projects/xlings/xlings-2026.8.11.2` |

‎bench/README.zh-CN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ __format/format_functions.h:99:30: error: call to implicitly-deleted default
202202
| xmake | **3.1.0** | `matrix.json` → `tools` |
203203
| bazel | **9.2.0** | `matrix.json` → `tools` |
204204
| gcc | **16.1.0** | `bench/src/toolchain.cppm` |
205-
| clang / libc++ | **22.1.8**(Windows:20.1.7) | `bench/src/toolchain.cppm` |
205+
| clang / libc++ | **23.1.3**(所有宿主) | `bench/src/toolchain.cppm` |
206206
| 参照 mcpp | **2026.8.11.3** | `matrix.json` → `reference_mcpp`;每次跑把实际解析到的版本写进 `meta.json`,报告的表头直接写出它 |
207207
| mcpp(被测工作负载) | **2026.8.11.3** — `a749e9f` | 子模块 `projects/mcpp/mcpp-2026.8.11.3` |
208208
| xlings(合并风格) | **2026.8.11.2** — `b1563fe` | 子模块 `projects/xlings/xlings-2026.8.11.2` |

‎bench/src/toolchain.cppm‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ export namespace bench::toolchain {
2828

2929
// The payload every arm of the benchmark compiles against.
3030
//
31-
// Windows is on llvm 20.1.7 rather than 22.1.8 because that is the version
32-
// mcpp's registry actually ships for the PE target; pinning a version that is
33-
// not there does not produce a slower number, it produces `unavailable`.
31+
// LLVM uses the same published line on every host. In particular, the macOS
32+
// linker must understand the arm64e.x1 SDK architecture shipped by Xcode 27.
3433
inline constexpr std::string_view kGcc = "16.1.0";
35-
inline constexpr std::string_view kLlvm = "22.1.8";
36-
inline constexpr std::string_view kLlvmWindows = "20.1.7";
34+
inline constexpr std::string_view kLlvm = "23.1.3";
35+
inline constexpr std::string_view kLlvmWindows = kLlvm;
3736

3837
bool on_windows();
3938

‎tests/e2e/182_windows_no_msvc_fallback.sh‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,36 @@ cleanup() {
2828
find "$MCPP_HOME" -type f \( -name cc1plus.exe -o -name g++.exe -o -name '*.dll' \) \
2929
-printf '%p %s bytes\n' > "$report/payload-files.txt" 2>/dev/null || true
3030
while IFS= read -r compiler; do
31+
printf '%s\n' "$compiler" > "$report/driver-path.txt"
32+
"$compiler" --version > "$report/driver-version.txt" 2>&1 || true
33+
"$compiler" -v > "$report/driver-configure.txt" 2>&1 || true
3134
"$compiler" -print-prog-name=cc1plus > "$report/driver-helper.txt" 2>&1 || true
3235
"$compiler" -print-search-dirs > "$report/driver-search.txt" 2>&1 || true
36+
sha256sum "$compiler" >> "$report/sha256.txt"
37+
# Keep DLL lookup identical while changing the executable basename.
38+
# Compare Git Bash launch with a native PowerShell launch, so a
39+
# name-dependent redirect cannot impersonate the cold compiler.
40+
local probe="$(dirname "$compiler")/mcpp-driver-probe.exe"
41+
cp "$compiler" "$probe" 2>/dev/null || true
42+
"$probe" --version > "$report/renamed-driver-version.txt" 2>&1 || true
43+
"$probe" -print-search-dirs > "$report/renamed-driver-search.txt" 2>&1 || true
44+
MCPP_DRIVER_DIAGNOSTIC="$(cygpath -w "$compiler")" \
45+
powershell.exe -NoProfile -Command \
46+
'$p = $env:MCPP_DRIVER_DIAGNOSTIC; Get-Item -LiteralPath $p | Format-List FullName,Length,LinkType,Target; Get-FileHash -LiteralPath $p -Algorithm SHA256; & $p --version; & $p -print-search-dirs; Write-Output "native driver exit: $LASTEXITCODE"' \
47+
> "$report/native-driver-probe.txt" 2>&1 || true
48+
if command -v objdump >/dev/null; then
49+
objdump -p "$compiler" > "$report/driver-pe.txt" 2>&1 || true
50+
fi
3351
done < <(find "$MCPP_HOME" -name g++.exe -type f 2>/dev/null)
3452
printf 'GCC_EXEC_PREFIX=%s\nCOMPILER_PATH=%s\nLIBRARY_PATH=%s\n' \
3553
"${GCC_EXEC_PREFIX:-}" "${COMPILER_PATH:-}" "${LIBRARY_PATH:-}" > "$report/driver-environment.txt"
54+
printf 'XLINGS_HOME=%s\nXLINGS_PROJECT_DIR=%s\nXLINGS_ACTIVE_SUBOS=%s\nPATH=%s\n' \
55+
"${XLINGS_HOME:-}" "${XLINGS_PROJECT_DIR:-}" "${XLINGS_ACTIVE_SUBOS:-}" "$PATH" \
56+
>> "$report/driver-environment.txt"
57+
command -v g++ > "$report/ambient-driver-path.txt" 2>&1 || true
58+
# Windows variable names are case-insensitive; Bash's lookup is not.
59+
env | grep -Ei '^(gcc_exec_prefix|compiler_path|library_path|collect_gcc|collect_lto_wrapper|xlings_[^=]*|msys[^=]*)=' \
60+
> "$report/driver-environment-all-cases.txt" || true
3661
while IFS= read -r helper; do
3762
echo "Direct invocation: $helper"
3863
"$helper" --version > "$report/cc1plus-version.txt" 2>&1 || \

‎tests/e2e/641_the_android_rows_are_wired_and_the_simulator_is_a_row.sh‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,16 @@ fi
125125
# not make bionic a candidate C library for a request that named none.
126126
d="$t/bare"; pkg "$d"
127127
out=$( cd "$d" && MCPP_NO_AUTO_INSTALL=1 "$MCPP" build --target aarch64-linux 2>&1 ) || true
128-
if grep -q "android" <<<"$out"; then
129-
echo "FAIL: a bare aarch64-linux request mentioned android"
130-
grep -m4 -E "android" <<<"$out" | sed 's/^/ /'
128+
# The refusal may list Android among OTHER targets this host can serve.
129+
# Only the selected target's resolution and diagnostic establish completion.
130+
selected=$(grep -E '(^|[[:space:]])(Target|Resolved)[[:space:]]|^error:.*target|target default for' <<<"$out" || true)
131+
if ! grep -Eq 'aarch64-linux-(gnu|musl)' <<<"$selected" \
132+
|| grep -q 'android' <<<"$selected"; then
133+
echo "FAIL: a bare aarch64-linux request did not select a Linux C ABI"
134+
printf '%s\n' "$out" | sed 's/^/ /'
131135
fail=1
132136
else
133-
echo " ok: a bare aarch64-linux request never mentions android"
137+
echo " ok: a bare aarch64-linux request selects a Linux C ABI"
134138
fi
135139

136140
# 6. `min_api_level` IS A MANIFEST KEY WITH A FLOOR, and it is refused where a

0 commit comments

Comments
 (0)