Skip to content

Commit 9edccc4

Browse files
2026.11.9.1: targets and providers; a platform defines rows; mcpp#911 G1–G12, B1–B3; tests are mtest's (#912)
The target model of SPEC-016, the items of #911 as evaluated in the design's §19, a graph's C library leading a Mach-O image's link, and mtest 0.5.2. Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent 2211fb5 commit 9edccc4

329 files changed

Lines changed: 24762 additions & 18175 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/docs/2026-11-09-target-model-design.md‎

Lines changed: 413 additions & 0 deletions
Large diffs are not rendered by default.

‎.agents/docs/README.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ superseded_by: 2026-09-07-....md # when status is superseded
1818
---
1919
```
2020

21-
355 records.
21+
356 records.
2222

2323
## By subject
2424

@@ -138,6 +138,10 @@ Records that declare one. Everything else is listed by date below.
138138
- [#674 设计方案评审:`-include unistd.h` 在 Windows + `presents = "posix"` 上的可行性](2026-09-20-issue-674-design-review.md) — active
139139
- [`__cxa_thread_atexit` 在 openkal-Windows 上:两层都已定位并修复](2026-09-20-cxa-thread-atexit-finding.md) — landed
140140

141+
### target-model
142+
143+
- [目标与提供者:统一的目标模型(结合 mcpp#911)](2026-11-09-target-model-design.md) — active
144+
141145
### targets
142146

143147
- [A verified Web run that asked the host for node](2026-09-12-a-verified-web-run-that-asked-the-host-for-node.md) — landed
@@ -179,6 +183,7 @@ Records that declare one. Everything else is listed by date below.
179183

180184
### 2026-11
181185

186+
- [目标与提供者:统一的目标模型(结合 mcpp#911)](2026-11-09-target-model-design.md) — active
182187
- [生态顶层方案:#885 收尾之后的工作流、原则与依赖](2026-11-08-ecosystem-top-level-design.md) — active
183188
- [#885 收尾补充方案:目标角色、平台事实、系统接口与版本书写](2026-11-08-ecosystem-885-supplement-design.md) — active
184189
- [生态 #885 收尾设计:核心、插件、openkal、语言服务与编辑器的一轮闭合](2026-11-07-ecosystem-885-closeout-design.md) — active

‎.edited‎

Whitespace-only changes.

‎.gitattributes‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# The cross-host admission compares the exact source bytes compiled by each host.
22
tests/fixtures/openkal-hosted-threads/src/main.cpp.in text eol=lf
3+
# The rows' snapshot is compared line by line with what the engine answers, in its own bytes.
4+
tests/fixtures/target-rows.snapshot text eol=lf

‎.github/actions/bootstrap-mcpp/action.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ runs:
107107
env:
108108
XLINGS_NON_INTERACTIVE: '1'
109109
XLINGS_VERSION: ${{ inputs.xlings-version }}
110+
GITHUB_TOKEN: ${{ github.token }}
110111
run: |
111112
REPO_DIR="$(pwd)"
112113
# Always install the pinned version — the cache may hold an older
@@ -231,6 +232,7 @@ runs:
231232
env:
232233
XLINGS_NON_INTERACTIVE: '1'
233234
XLINGS_VERSION: ${{ inputs.xlings-version }}
235+
GITHUB_TOKEN: ${{ github.token }}
234236
run: |
235237
REPO_DIR="$(pwd)"
236238
# FAST PATH: see the unix leg for the reasoning. The cost on Windows is

‎.github/actions/e2e-mtest/action.yml‎

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: e2e-mtest
22
description: >
33
mtest for the e2e suite (design 2026-11-08 W8; tests/e2e/mtest.toml): the
4-
release this action pins, its sha256 checked, and the stores main's last
4+
release this action pins, installed by xlings, and the stores main's last
55
successful CI run kept for this host, taken into tests/e2e/.mtest so that
66
`--shard` divides the suite by measured time and a run orders its tests
77
longest first. Exports E2E_MTEST for run_all.sh. A run with no store of main
@@ -12,13 +12,13 @@ inputs:
1212
description: the host's name in the stores' artifact names (linux, macos, windows)
1313
required: true
1414
version:
15-
description: the mtest release
15+
description: the mtest release, an xlings package (xim:mtest), whose sha256 the index states
1616
required: false
17-
default: '0.4.0'
17+
default: '0.5.2'
1818
sha256:
19-
description: sha256 of mtest-<version>-openkal-bundle-all.tar.gz
19+
description: sha256 of mtest-<version>-openkal-bundle-all.tar.gz, for the release taken when xlings cannot install it
2020
required: false
21-
default: 'b62e4ac7cd76b20dbdc48a5d041d377444e8815ee7a4ff1e7686145d13acc925'
21+
default: 'be443f8c546b3f4628dcd3f1eb6f45b4d698a7f805232f966349faf8250863c6'
2222
token:
2323
description: a token that reads this repository's actions
2424
required: false
@@ -27,24 +27,41 @@ inputs:
2727
runs:
2828
using: composite
2929
steps:
30+
# THE ENGINE IS AN XLINGS PACKAGE (xim:mtest), installed as the job installs
31+
# mcpp, verified by the index's sha256, and kept in the job's xlings cache:
32+
# by the configured mirror (GLOBAL), then by CN (GitCode first), each with a
33+
# refreshed index; else the release bundle itself (fetch_release.sh: the
34+
# web address, then the API's), checked against the pinned sha256.
3035
- name: mtest
3136
shell: bash
3237
env:
3338
MTEST_VERSION: ${{ inputs.version }}
3439
MTEST_SHA256: ${{ inputs.sha256 }}
40+
GITHUB_TOKEN: ${{ inputs.token }}
3541
run: |
3642
set -euo pipefail
37-
archive="mtest-$MTEST_VERSION-openkal-bundle-all.tar.gz"
38-
temp="$RUNNER_TEMP"; python=python3
39-
if [ "$RUNNER_OS" = Windows ]; then temp=$(cygpath -u "$RUNNER_TEMP"); python=python; fi
40-
curl -fsSL --retry 5 --retry-all-errors --retry-delay 5 -o "$temp/$archive" \
41-
"https://github.com/mcpp-community/mtest/releases/download/v$MTEST_VERSION/$archive"
42-
actual=$("$python" -c "import hashlib,sys; print(hashlib.sha256(open(sys.argv[1],'rb').read()).hexdigest())" "$temp/$archive")
43-
[ "$actual" = "$MTEST_SHA256" ] || { echo "::error::$archive: sha256 $actual, the action pins $MTEST_SHA256"; exit 1; }
44-
mkdir -p "$temp/mtest" && tar xzf "$temp/$archive" -C "$temp/mtest"
45-
launcher="$temp/mtest/mtest-$MTEST_VERSION-openkal-bundle-all/bin/mtest"
46-
[ "$RUNNER_OS" = Windows ] && launcher="$launcher.exe"
47-
"$launcher" --version
43+
launcher=""
44+
for mirror in GLOBAL CN; do
45+
xlings config --mirror "$mirror" > /dev/null 2>&1 || true
46+
xlings update > /dev/null 2>&1 || true
47+
if xlings install "mtest@$MTEST_VERSION" -y; then launcher=$(command -v mtest); break; fi
48+
done
49+
xlings config --mirror GLOBAL > /dev/null 2>&1 || true
50+
if [ -z "$launcher" ]; then
51+
echo "::warning::xlings could not install mtest $MTEST_VERSION; taking the release itself"
52+
archive="mtest-$MTEST_VERSION-openkal-bundle-all.tar.gz"
53+
temp="$RUNNER_TEMP"; python=python3
54+
if [ "$RUNNER_OS" = Windows ]; then temp=$(cygpath -u "$RUNNER_TEMP"); python=python; fi
55+
bash "$GITHUB_WORKSPACE/.github/tools/fetch_release.sh" \
56+
"https://github.com/mcpp-community/mtest/releases/download/v$MTEST_VERSION/$archive" "$temp/$archive"
57+
actual=$("$python" -c "import hashlib,sys; print(hashlib.sha256(open(sys.argv[1],'rb').read()).hexdigest())" "$temp/$archive")
58+
[ "$actual" = "$MTEST_SHA256" ] || { echo "::error::$archive: sha256 $actual, the action pins $MTEST_SHA256"; exit 1; }
59+
mkdir -p "$temp/mtest" && tar xzf "$temp/$archive" -C "$temp/mtest"
60+
launcher="$temp/mtest/mtest-$MTEST_VERSION-openkal-bundle-all/bin/mtest"
61+
[ "$RUNNER_OS" = Windows ] && launcher="$launcher.exe"
62+
fi
63+
"$launcher" --version | grep -qF "$MTEST_VERSION" \
64+
|| { echo "::error::the mtest at $launcher is not $MTEST_VERSION: $("$launcher" --version)"; exit 1; }
4865
echo "E2E_MTEST=$launcher" >> "$GITHUB_ENV"
4966
# The pull request's change, for the `pr` set: the base's tip and HEAD's
5067
# parents, so that `git diff <base>...HEAD` has its merge base. When they

‎.github/actions/setup-macos-llvm/action.yml‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,25 @@ runs:
5151
env:
5252
XLINGS_NON_INTERACTIVE: '1'
5353
XLINGS_VERSION: ${{ inputs.xlings-version }}
54+
GITHUB_TOKEN: ${{ github.token }}
5455
run: |
55-
WORK=$(mktemp -d)
56-
tarball="xlings-${XLINGS_VERSION}-macosx-arm64.tar.gz"
57-
# Retried and verified — .github/tools/fetch_release.sh. A bare curl
58-
# here is the `curl: (52) Empty reply from server` flake.
59-
bash "$GITHUB_WORKSPACE/.github/tools/fetch_release.sh" \
60-
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}" \
61-
"${WORK}/${tarball}"
62-
tar -xzf "${WORK}/${tarball}" -C "${WORK}"
63-
XLINGS_DIR="${WORK}/xlings-${XLINGS_VERSION}-macosx-arm64"
64-
"$XLINGS_DIR/subos/default/bin/xlings" self install
56+
# THE CACHE ALREADY HOLDS THE PINNED XLINGS (its key names the version):
57+
# nothing is downloaded, as bootstrap-mcpp's fast path does. This step
58+
# fetched the release on every run, a cache hit or not, and a 504 of
59+
# that fetch failed the job (2026-11-09).
60+
XL="$HOME/.xlings/subos/default/bin/xlings"
61+
if ! { [ -x "$XL" ] && "$XL" --version 2>/dev/null | head -1 | grep -qF "$XLINGS_VERSION"; }; then
62+
WORK=$(mktemp -d)
63+
tarball="xlings-${XLINGS_VERSION}-macosx-arm64.tar.gz"
64+
# Retried and verified, and by the API's address when the web's
65+
# fails — .github/tools/fetch_release.sh.
66+
bash "$GITHUB_WORKSPACE/.github/tools/fetch_release.sh" \
67+
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}" \
68+
"${WORK}/${tarball}"
69+
tar -xzf "${WORK}/${tarball}" -C "${WORK}"
70+
XLINGS_DIR="${WORK}/xlings-${XLINGS_VERSION}-macosx-arm64"
71+
"$XLINGS_DIR/subos/default/bin/xlings" self install
72+
fi
6573
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
6674
xlings --version
6775
echo "PATH=$HOME/.xlings/subos/default/bin:$PATH" >> "$GITHUB_ENV"

‎.github/tools/check_e2e_coverage.py‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
under tests/e2e:
1919
2020
ran some report says pass, fail or timeout;
21+
unaffected no report ran it, and a run narrowed to a set (`E2E_SET`, the
22+
`pr` set of a pull request) says the change does not affect it:
23+
the full runs of main are its coverage, and this run's claim is
24+
about the tests the change reaches;
2125
job no report ran it, but a workflow names it outside a comment, as a
2226
whole token: by file name, by name without `.sh`, or by its number
2327
as an `E2E_ONLY` pattern such as `239_*.sh`. A dedicated job runs it
@@ -34,7 +38,8 @@
3438
calls a target row `verified` when CI builds and runs its artefact, and the
3539
`*-openkal` rows claim that for every system. tests/e2e/host-requirements.tsv
3640
lists such a test with the hosts its result must come from; a listed test that
37-
did not pass on one of them, or that does not exist, fails the check.
41+
did not pass on one of them, or that does not exist, fails the check; one a
42+
set left out on that host as unaffected meets it for that run.
3843
3944
With --timings-out DIR it writes `<host>.tsv`, the measured duration of every
4045
test that ran, merged across that host's shards, in the format run_all.sh reads
@@ -133,6 +138,7 @@ def main() -> int:
133138
ran: dict[str, set[str]] = defaultdict(set)
134139
passed: dict[str, set[str]] = defaultdict(set)
135140
skipped: dict[str, set[str]] = defaultdict(set)
141+
unaffected: dict[str, set[str]] = defaultdict(set)
136142
shard_ms: dict[tuple[str, int], int] = defaultdict(int)
137143
timings: dict[str, dict[str, int]] = defaultdict(dict)
138144
reports = 0
@@ -146,6 +152,8 @@ def main() -> int:
146152
timings[host][test] = ms
147153
elif status == "skip":
148154
skipped[test].add(f"{host}: {detail}")
155+
elif status == "unaffected":
156+
unaffected[test].add(host)
149157
if reports == 0:
150158
print(f"no report under {args.reports}: nothing can be said about coverage")
151159
return 1
@@ -157,6 +165,8 @@ def main() -> int:
157165
counts["ran"] += 1
158166
if test in exceptions:
159167
stale.append(f"{test} is excused but ran on {', '.join(sorted(ran[test]))}")
168+
elif test in unaffected:
169+
counts["unaffected"] += 1
160170
elif named_by_a_workflow(test, workflows):
161171
counts["job"] += 1
162172
elif test in exceptions:
@@ -171,13 +181,14 @@ def main() -> int:
171181
if test not in tests:
172182
stale.append(f"{test} is required on hosts but does not exist")
173183
continue
174-
for host in sorted(hosts - passed[test]):
184+
for host in sorted(hosts - passed[test] - unaffected[test]):
175185
why = [d for d in skipped[test] if d.startswith(f"{host}: ")]
176186
unmet.append(f"{test} did not pass on {host}"
177187
f"{' (' + '; '.join(why) + ')' if why else (' (it ran and did not pass)' if host in ran[test] else ' (no report of it there)')}")
178188

179-
print(f"{len(tests)} tests: {counts['ran']} ran on a shard, {counts['job']} run by a "
180-
f"dedicated job, {counts['excused']} excused, {len(uncovered)} uncovered")
189+
print(f"{len(tests)} tests: {counts['ran']} ran on a shard, {counts['unaffected']} unaffected by "
190+
f"the change, {counts['job']} run by a dedicated job, {counts['excused']} excused, "
191+
f"{len(uncovered)} uncovered")
181192
for (host, shard), ms in sorted(shard_ms.items()):
182193
print(f" {host} shard {shard}: {ms / 60000:.1f} min of tests")
183194
for line in uncovered:

‎.github/tools/check_target_tiers.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python3
22
"""Every documented tier agrees with the target table.
33
4-
WHY THIS EXISTS. `kKnownTargets` in modules/toolchain-model/src/triple.cppm is
5-
the single source for a row's tier, and four documents restate it: both
4+
WHY THIS EXISTS. The built-in rows, modules/toolchain-model/data/builtin.toml
5+
(SPEC-016 §2.2), are the single source for a row's tier, and four documents restate it: both
66
READMEs, both copies of docs/21. When `wasm32-emscripten` became `verified` and
77
the Android rows gained tiers, docs/21 was updated and the READMEs were not --
88
so the front page told a reader that three targets were `planned` while the
@@ -16,17 +16,19 @@
1616
"""
1717
import re
1818
import sys
19+
import tomllib
1920
from pathlib import Path
2021

2122
ROOT = Path(__file__).resolve().parents[2]
22-
TABLE = ROOT / "modules/toolchain-model/src/triple.cppm"
23+
TABLE = ROOT / "modules/toolchain-model/data/builtin.toml"
2324
TIERS = ("verified", "preview", "planned")
2425

2526
# The engine's answer.
2627
rows = {}
27-
for m in re.finditer(r'^\s*\{\s*"([a-z0-9_.+-]+)",\s*"(verified|preview|planned)"',
28-
TABLE.read_text(), re.M):
29-
rows[m.group(1)] = m.group(2)
28+
with TABLE.open("rb") as f:
29+
for row in tomllib.load(f).get("platform", {}).get("define", []):
30+
if row.get("tier") in TIERS:
31+
rows[row["triple"]] = row["tier"]
3032
if len(rows) < 20:
3133
sys.exit(f"ERROR: only {len(rows)} rows parsed from {TABLE.name}; "
3234
"the pattern no longer matches the table")

‎.github/tools/check_windows_home_legacy.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,23 @@
1414
assert original.count(marker) == 1, 'identify the test-only code-page setting explicitly'
1515

1616

17-
def run_case(pattern, passed_case):
18-
result = subprocess.run([os.environ['MCPP'], '--offline', 'test', pattern], cwd=root,
17+
def run_case(passed_case):
18+
# The case by its identifier (mtest's): it runs in the process of its file.
19+
result = subprocess.run([os.environ['MCPP'], '--offline', 'test', '--case', passed_case], cwd=root,
1920
capture_output=True, text=True, encoding='utf-8', errors='replace',
2021
timeout=600)
2122
sys.stdout.write(result.stdout)
2223
sys.stderr.write(result.stderr)
2324
assert result.returncode == 0, result.returncode
2425
output = re.sub(r'\x1b\[[0-9;]*m', '', result.stdout + result.stderr)
25-
assert '[ OK ] ' + passed_case in output, \
26+
assert re.search(r'^\s*ok\s+' + re.escape(passed_case) + r'\s*$', output, re.M), \
2627
'the legacy ACP case did not pass; a UTF-8-only skip is not proof'
2728

2829

2930
try:
3031
manifest.write_bytes(original.replace(marker, b'windows_code_page = "legacy"', 1))
31-
run_case('home', 'HomeSelection.UnicodeLocatorRoundTripDoesNotNarrowTheSelectedPath')
32-
run_case('bmi_cache', 'BMICacheMaintenance.RunnerCachePathDoesNotUseTheWindowsAnsiCodePage')
32+
run_case('HomeSelection/UnicodeLocatorRoundTripDoesNotNarrowTheSelectedPath')
33+
run_case('BMICacheMaintenance/RunnerCachePathDoesNotUseTheWindowsAnsiCodePage')
3334
finally:
3435
manifest.write_bytes(original)
3536
print('PASS: home and runner-cache paths ran under legacy Windows ACP; manifest restored')

0 commit comments

Comments
 (0)