Skip to content

mcpp:plugins 0.3.0 —— 嵌入载荷用 import 到达,以及规则包自带语言 - #367

Merged
Sunrisepeak merged 1 commit into
mainfrom
feat/mcpp-plugins-0.3.0
Sep 7, 2026
Merged

mcpp:plugins 0.3.0 —— 嵌入载荷用 import 到达,以及规则包自带语言#367
Sunrisepeak merged 1 commit into
mainfrom
feat/mcpp-plugins-0.3.0

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

mcpp:plugins 0.3.0. latest moves with it — the three lines are replaced,
not added to, because a Lua table constructor takes the last assignment for a
duplicate key and a second ["latest"] resolves back to the previous release
while every exact pin stays correct.

Requires mcpp 2026.9.7.1, which is where the two new declarations are read.

What the release is

An embedded payload is reached by IMPORTING a module rather than by including a
header whose name the rule chose:

import myapp.shaders;
const auto s = myapp::shaders::scale_comp();   // address and size together

The module root comes from [package] name, the accessor from the file's stem
and stage, and the directory below the group's base becomes namespace segments —
so shaders/a/scale.comp and shaders/b/scale.comp are two payloads rather
than a collision. Nothing in a project names a generated file.

Two new members

rules-slang compiles Slang, which is a language rather than a second driver
for GLSL — its own module system, generics, and targets beyond SPIR-V. .slang
is not in the engine's device-source table at any version.
The feature declares
device_extensions = [".slang"] and rule_module = "mcpp.rules.slang", and the
engine routes it from there. That is the criterion for the whole arrangement: a
new device language costs no engine release.

tools-island generates the extern "C" boundary a device island is reached
across — the header its compiler reads and the module the C++ side imports, from
declarations marked where they are defined. Handed both halves of a seam, it
refuses two that declare one name differently: the two are never in one link and
C language linkage does not mangle, so that is the only point at which both
texts exist at once.

The floor

The documented floor moves to 2026.9.7.1. It is documentation rather than a gate
— the index-level min_mcpp is deliberately not raised for one package — but a
floor naming the wrong release tells a reader stopped below it the wrong thing
about what will happen. A client below it does not get a degraded surface; it
gets a build in which the rules never route, and mcpp says it has no role for
the extension.

Verified

The four claims were run against the released 2026.9.7.1 binary before this was
written: a module-surface project, the same project with no build.mcpp at all,
a .slang project and the same file refused without the rule feature, and
object storage with the words in an .incbin payload and in no header. 18
assertions, 0 failures.

The CN asset is the GitHub archive byte for byte, so one sha256 names both.

一份嵌入载荷现在由 `import` 到达,而不是 include 一个规则挑名字的头文件。
模块根取自 `[package] name`,访问器取自文件的 stem 与 stage,组基准目录以下
的子目录成为命名空间段 —— 于是两个同 stem 的 shader 是两份载荷而不是一次冲突。
工程里没有任何一行写出生成物的名字。

两个新成员:

  rules-slang   Slang 是一门语言而不是 GLSL 的第二个驱动。`.slang` **不在**
                引擎的设备源扩展名表里(任何版本都不在),这个 feature 自己声明
                `device_extensions` 与 `rule_module`,引擎据此路由。这就是整个
                安排的判据:一门新设备语言不需要引擎发版。
  tools-island  生成设备岛的 `extern "C"` 边界 —— 它的编译器读的头文件,和
                C++ 侧 import 的模块,来自标在定义处的声明。把 seam 的两个半边
                都交给它时,两个把同一个名字声明得不一样的定义会被拒绝:两者永不
                同链且 C 链接不做名字修饰,所以那是两份文本唯一同时在场的地方。

文档化的下界移到 2026.9.7.1,也就是读这两个键的那一版。低于它的客户端不会得到
一个降级的表面,而是得到一次「规则从不路由」的构建 —— 文件掉进普通源集,mcpp 说
它对这个扩展名没有角色。

`latest` 的三行是**替换**而不是新增:Lua 表构造器对重复键取最后一次赋值,第二个
`["latest"]` 会让它退回上一版,而每个精确 pin 仍然正确,所以只有不带版本的
`mcpp add` 会拿到旧包。

发布前对着已发布的 2026.9.7.1 二进制跑过四组:模块表面工程、同一个工程但完全没有
`build.mcpp`、一个 `.slang` 工程**以及去掉规则 feature 后同一个文件被拒绝**、
object 存储(字在 `.incbin` 载荷里而不在任何头文件里)。18 条断言,0 失败。

CN 资产与 GitHub 归档逐字节相同,所以一个 sha256 同时命名两边。
@Sunrisepeak
Sunrisepeak merged commit 4395dc6 into main Sep 7, 2026
8 checks passed
@Sunrisepeak
Sunrisepeak deleted the feat/mcpp-plugins-0.3.0 branch September 7, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant