Commit 39264fc
docs, examples: an island's entry points arrive in the module's own namespace (#591)
* docs, examples: an island's entry points arrive in the module's own namespace
`docs/42` states one rule for both lanes -- the module name and the namespace
are one identifier path -- and the shader lane followed it while
`mcpp.tools.island` did not: every entry point was emitted at global scope, so
`import app.kernels` bought a file name and nothing else. `mcpp:plugins` 0.5.0
makes the island lane follow it, and this updates the three examples that use
the generator and the chapters that describe it.
The rule is now stated once, for both lanes, with the leaf identifier as the
only difference: the data lane derives it from a file name because a payload
has no name of its own, and the island lane takes the entry point's name
because the author wrote one. That is also why a file name reaches nothing on
the island lane, and why moving a function between two files in one directory
renames nothing a consumer wrote.
The generator's section moves from 31 to 42. 31's reader is a rule author, and
no rule package calls the generator -- `tools/island.cppm` says a project does,
from its own build program. What stays in 31 is the one field a rule owes it,
`options::flags`, and a link. `docs/README.md`'s concept row moves with it, and
`MCPP_EXPORT_C` is now explained in the chapter that row points at rather than
named in a table cell.
`examples/09-heterogeneous/boundary` gains a second island one directory deeper,
because the namespace mirroring the tree is the thing the example exists to
show, and it takes `strip_prefix` -- it is the one example whose consumer
writes a boundary name directly. `cuda` and `sycl` name two roots and say which
supplies the shape; their seams call `kernels::saxpy_device` from inside
`namespace app`.
Every example pins 0.5.0, so one version of the package is resolved across the
tree.
Verified against the released mcpp 2026.9.8.1 before the pin was restored:
`boundary` prints `6 12 18 24` and `nm` shows one `boundary_saxpy` and no
`saxpy`; the CPU legs of `cuda` and `sycl` build and run with the namespaced
boundary. `check_docs_structure.sh`, `check_docs_style.sh`,
`check_version_pins.sh` and e2e 616 pass.
* examples: pin mcpp:plugins 0.5.1, and record what shipped
0.5.1 adds the refusal of overlapping roots that the design record states and
0.5.0 shipped without. Every example resolves one version of the package.
* 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`.
* docs(plan): the plan records three releases, not one
0.5.0 carried the design, 0.5.1 the refusal of overlapping roots the design
states and 0.5.0 omitted, and 0.5.2 the separator defect the first
cross-platform run of the generator's fixture found.
---------
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>1 parent 9a71c9a commit 39264fc
30 files changed
Lines changed: 1090 additions & 148 deletions
File tree
- .agents/docs
- docs
- zh
- examples
- 09-heterogeneous
- boundary
- src
- kernels
- vec
- cann/app
- cuda
- app
- src
- hip/app
- multi-backend
- sycl/app
- src
- vulkan/app
- 10-graphics
- offscreen
Lines changed: 215 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
0 commit comments