Skip to content

Commit 01645c7

Browse files
committed
examples: pin mcpp:plugins 0.5.2
0.5.2 fixes a defect the cross-platform run of the generator's fixture found: `namespace_of` trimmed a base directory off a file's directory as a string, and on Windows a root stated with forward slashes against a directory iterator appending with the preferred separator left `\image` rather than `image` -- so the root directory became a namespace segment and an entry point landed in `app::kernels::_::image`. The shader lane shares that function and had the defect latent: its Windows fixture keeps every payload in one directory, so a segment was never derived there. `examples/09-heterogeneous/vulkan` and `examples/10-graphics/offscreen` therefore take this pin for a reason of their own. Verified against the published package: `boundary` resolves `mcpp-x-plugins/0.5.2` from the index and prints `6 12 18 24`.
1 parent 57ad8ef commit 01645c7

15 files changed

Lines changed: 52 additions & 20 deletions

File tree

.agents/docs/2026-09-08-island-boundary-names.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,8 @@ negation.
413413
| a flatter fallback tree is accepted | fixture: `cuda/image/blur.cu` with `cpu/ops.cpp`; the namespace is `image` |
414414
| a backend-only entry point still has a place | fixture: a name only the second root declares; its namespace is that root's path |
415415
| the disagreement check still fires | the existing `island-interface` negative fixture, unchanged in behaviour |
416+
| overlapping roots are refused | negative fixture: `src` named beside `src/kernels`; the message names both roots |
417+
| the derivation runs on every host | the fixture builds and its namespaces are asserted on macOS and Windows, not only Linux |
416418
| the output is a function of the tree, not of the walk | the same tree scanned twice produces byte-identical files, and a no-op rebuild touches neither |
417419
| an empty root set is an error | a fixture whose roots hold sources but no marker; the build fails naming the root |
418420
| two files in ONE root, one name | refused, and the message says the two belong in two roots |
@@ -421,17 +423,33 @@ negation.
421423
## 12. What shipped
422424

423425
`mcpp:plugins` **0.5.0** (2026-09-08) carries §2 through §8 and §6.1. **0.5.1**
424-
carries the refusal of overlapping roots that §6 states and 0.5.0 omitted --
425-
the shape of defect §10 of the plan warns about, where a requirement folded
426-
into a larger change disappears when that change ships. It also stops a
426+
carries the refusal of overlapping roots that §6 states and 0.5.0 omitted. That
427+
is the shape of defect where a requirement folded into a larger change
428+
disappears when that change ships: §6 stated it in prose and §11 gave it no
429+
criterion of its own, so nothing was red when it was absent. It has one now. It also stops a
427430
single-file root from registering a re-run glob over the directory that file
428431
happens to sit in.
429432

430-
Both are indexed, and `mcpp` pins 0.5.1 across the example tree. The published
431-
0.5.1 was verified in an xlings sandbox against the index rather than a working
432-
tree: a project written inside the sandbox resolved
433-
`registry/data/xpkgs/mcpp-x-plugins/0.5.1`, printed `6 12 18 24`, and its
434-
generated module carried `export namespace sandbox::kernels` and
433+
**0.5.2** carries a defect the cross-platform run found. `mcpp.tools.island`
434+
compiled on all three hosts and had been exercised on one; the first Windows
435+
run of the fixture failed to compile with `no member named 'image' in namespace
436+
'island_interface::kernels'`. `namespace_of` trimmed the base directory off a
437+
file's directory as a STRING, and a root stated with forward slashes against a
438+
directory iterator appending with the preferred separator left `\image` rather
439+
than `image` -- so the root directory became a segment, sanitised to `_`. It
440+
compares components now.
441+
442+
The shader lane shares that function and had the defect latent: its Windows
443+
fixture keeps every payload in one directory, so a segment was never derived
444+
there. The leg that surfaced it is not the lane it lives on, and a step now
445+
asserts the derivation exists once so the island fixture's cross-platform run
446+
keeps protecting both.
447+
448+
All three are indexed, and `mcpp` pins 0.5.2 across the example tree. The
449+
published package was verified in an xlings sandbox against the index rather
450+
than a working tree: a project written inside the sandbox resolved
451+
`registry/data/xpkgs/mcpp-x-plugins`, printed `6 12 18 24`, and its generated
452+
module carried `export namespace sandbox::kernels` and
435453
`export namespace sandbox::kernels::vec`.
436454

437455
## 13. Decided in review

docs/42-heterogeneous-builds.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ exported whatever a file contained would make the boundary an accident of that
287287
file's contents.
288288
289289
```cpp
290+
const std::string root = std::string(mcpp::manifest_dir());
291+
290292
mcpp::tools::island::options opt;
291293
opt.module_name = "app.kernels";
292294
opt.out_dir = std::string(mcpp::out_dir()) + "/island";
@@ -322,6 +324,12 @@ point implemented several times, and the declarations must then agree verbatim.
322324
The second is the check nothing else in the toolchain can perform; the first is
323325
what makes the namespace honest.
324326

327+
Two configuration errors are refused beside them: roots that overlap, because a
328+
file reachable from both has two namespace paths and which one it got would
329+
depend on the order of the list; and roots that hold no marked entry point at
330+
all, because an empty module fails later and less clearly than a misspelled
331+
path does here.
332+
325333
**`strip_prefix` is a spelling, not a second entity.** An island's symbol is
326334
global to the whole program, so an entry point carries a package prefix whether
327335
or not it sits in a namespace, and the namespace then repeats it. The option

docs/zh/42-heterogeneous-builds.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ int app_saxpy(float a, const float* x, const float* y, float* out, unsigned n)
237237
变成那个文件恰好包含了什么的意外结果。
238238

239239
```cpp
240+
const std::string root = std::string(mcpp::manifest_dir());
241+
240242
mcpp::tools::island::options opt;
241243
opt.module_name = "app.kernels";
242244
opt.out_dir = std::string(mcpp::out_dir()) + "/island";
@@ -265,6 +267,10 @@ layout root 的目录才延长命名空间;其余的根只需要定义同样的
265267
声明必须逐字一致。后者是工具链里没有别的东西能做的检查;前者是让命名空间不说谎的
266268
那一条。
267269
270+
此外还有两种配置错误被拒绝:互相重叠的根 —— 同时可以从两个根到达的文件有两条命名
271+
空间路径,而它拿到哪一条取决于这个列表的顺序;以及根里一个被标记的入口点都没有 ——
272+
一个什么都不导出的模块,比一个写错的路径在这里被指出来要晚得多、也难懂得多。
273+
268274
**`strip_prefix` 是一种拼法,不是第二个实体。** 岛的符号对整个程序是全局的,所以
269275
入口点无论是否落在命名空间里都带着包前缀,而命名空间随后又把它重复一遍。这个选项在
270276
`using ::app_blur;` 旁边写出 `inline constexpr auto blur = app_blur;`。作者写下的

examples/09-heterogeneous/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ selects it and the accelerator it serves, so a project writes one edge and no
104104

105105
```toml
106106
[build-dependencies.mcpp]
107-
plugins = { version = "0.5.1", features = ["rules-cuda", "tools-island"], host-module = true }
107+
plugins = { version = "0.5.2", features = ["rules-cuda", "tools-island"], host-module = true }
108108
```
109109

110110
`multi-backend/` is the one example here that also pins a version, and it does

examples/09-heterogeneous/boundary/mcpp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ standard = "c++23"
88
# `tools-island` is not a device rule: it claims no extension and names no rule
99
# module, so the edge states `host-module = true` itself.
1010
[build-dependencies.mcpp]
11-
plugins = { version = "0.5.1", features = ["tools-island"], host-module = true }
11+
plugins = { version = "0.5.2", features = ["tools-island"], host-module = true }
1212

1313
[build]
1414
sources = ["src/*.cpp", "src/kernels/**/*.c"]

examples/09-heterogeneous/cann/app/mcpp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import_std = true
1414
# imports it as `mcpp.rules.ascendc`. `[build-dependencies]`, because a rule
1515
# package's library must never reach the target while its rule is wanted.
1616
[build-dependencies.mcpp]
17-
plugins = { version = "0.5.1", features = ["rules-ascendc"], host-module = true }
17+
plugins = { version = "0.5.2", features = ["rules-ascendc"], host-module = true }
1818

1919
# NO [xlings.workspace]. `mcpp.rules.ascendc` declares `xim:cann-toolkit`
2020
# itself, gated on this accelerator and on the feature that selects the rule --

examples/09-heterogeneous/cuda/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ The rule names it. This project writes one edge and no payload list at all:
9898

9999
```toml
100100
[build-dependencies.mcpp]
101-
plugins = { version = "0.5.1", features = ["rules-cuda", "tools-island"], host-module = true }
101+
plugins = { version = "0.5.2", features = ["rules-cuda", "tools-island"], host-module = true }
102102
```
103103

104104
`mcpp.rules.cuda` declares nvcc, cudart, cuRAND's headers, CCCL and the driver

examples/09-heterogeneous/cuda/app/mcpp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ default = "llvm@22.1.8"
2323
# `extern "C"` boundary the island's compiler reads and the module the seam
2424
# imports, so neither signature is stated twice.
2525
[build-dependencies.mcpp]
26-
plugins = { version = "0.5.1", features = ["rules-cuda", "tools-island"], host-module = true }
26+
plugins = { version = "0.5.2", features = ["rules-cuda", "tools-island"], host-module = true }
2727

2828
# The driver's userspace library, reached through an index package that owns
2929
# the one hop mcpp needs: a directory on the artifact's runtime search path.

examples/09-heterogeneous/hip/app/mcpp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import_std = true
2020
default = "llvm@22.1.8"
2121

2222
[build-dependencies.mcpp]
23-
plugins = { version = "0.5.1", features = ["rules-hip"], host-module = true }
23+
plugins = { version = "0.5.2", features = ["rules-hip"], host-module = true }
2424

2525
# The driver's userspace library. HIP reaches the device through the CUDA
2626
# runtime here, so this is the same one hop the CUDA consumer needs: mcpp's

examples/09-heterogeneous/multi-backend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ saying it after the vocabulary grows.
9393

9494
```toml
9595
[build-dependencies.mcpp]
96-
plugins = { version = "0.5.1", features = ["rules-cuda", "rules-spirv"], host-module = true }
96+
plugins = { version = "0.5.2", features = ["rules-cuda", "rules-spirv"], host-module = true }
9797
```
9898

9999
Two rules, in one build program, which is what an additive-backend package

0 commit comments

Comments
 (0)