Logical Render Pipelines and Command Packets
JaCoCo Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 61.06% (17124/28043) * Branch Coverage: 51.92% (6584/12681) * Lines of Code: 28043 * Cyclomatic Complexity: 11219 #### Quality Gates Summary Output truncated.
Test / Build skipped: 15, passed: 594
Intrepid/Prometeu/Studio/pipeline/head This commit looks good

This commit is contained in:
2026-05-25 19:34:19 +01:00
parent 81437b1fc3
commit 3f99e90ac8
29 changed files with 195 additions and 194 deletions
@@ -1,18 +1,18 @@
declare host LowComposer {
[Host(module = "composer", name = "set_camera", version = 1)]
[Capability(name = "gfx")]
[Capability(name = "composer")]
fn set_camera(x: int, y: int) -> void;
[Host(module = "composer", name = "bind_scene", version = 1)]
[Capability(name = "gfx")]
[Capability(name = "composer")]
fn bind_scene(scene_bank_id: int) -> int;
[Host(module = "composer", name = "unbind_scene", version = 1)]
[Capability(name = "gfx")]
[Capability(name = "composer")]
fn unbind_scene() -> int;
[Host(module = "composer", name = "emit_sprite", version = 1)]
[Capability(name = "gfx")]
[Capability(name = "composer")]
fn emit_sprite(
glyph_id: int,
palette_id: int,
@@ -1,32 +1,32 @@
import { Color } from @core:color;
declare host LowGfx {
[Host(module = "gfx", name = "clear", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "clear", version = 1)]
[Capability(name = "gfx2d")]
fn clear(color: Color) -> void;
[Host(module = "gfx", name = "fill_rect", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "fill_rect", version = 1)]
[Capability(name = "gfx2d")]
fn fill_rect(x: int, y: int, w: int, h: int, color: Color) -> void;
[Host(module = "gfx", name = "draw_line", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_line", version = 1)]
[Capability(name = "gfx2d")]
fn draw_line(x1: int, y1: int, x2: int, y2: int, color: Color) -> void;
[Host(module = "gfx", name = "draw_circle", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_circle", version = 1)]
[Capability(name = "gfx2d")]
fn draw_circle(x: int, y: int, r: int, color: Color) -> void;
[Host(module = "gfx", name = "draw_disc", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_disc", version = 1)]
[Capability(name = "gfx2d")]
fn draw_disc(x: int, y: int, r: int, border_color: Color, fill_color: Color) -> void;
[Host(module = "gfx", name = "draw_square", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_square", version = 1)]
[Capability(name = "gfx2d")]
fn draw_square(x: int, y: int, w: int, h: int, border_color: Color, fill_color: Color) -> void;
[Host(module = "gfx", name = "draw_text", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_text", version = 1)]
[Capability(name = "gfx2d")]
fn draw_text(x: int, y: int, message: str, color: Color) -> void;
}
@@ -131,7 +131,7 @@ class PbsDiagnosticsContractTest {
void shouldTagHostAdmissionDiagnosticsWithHostAdmissionPhase() {
final var source = """
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
fn draw_pixel(x: int, y: int) -> void;
}
""";
@@ -441,8 +441,8 @@ class PbsFrontendCompilerTest {
) {
}
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw_pixel(x: int, y: int, color: Color) -> void;
}
[BuiltinConst(target = "Color", name = "white", version = 1)]
@@ -459,7 +459,7 @@ class PbsFrontendCompilerTest {
assertEquals(1, fileBackend.reservedMetadata().builtinTypeSurfaces().size());
assertEquals(1, fileBackend.reservedMetadata().builtinConstSurfaces().size());
assertEquals(1, fileBackend.reservedMetadata().requiredCapabilities().size());
assertEquals("gfx", fileBackend.reservedMetadata().requiredCapabilities().getFirst());
assertEquals("gfx2d", fileBackend.reservedMetadata().requiredCapabilities().getFirst());
assertEquals("Color", fileBackend.reservedMetadata().builtinTypeSurfaces().getFirst().canonicalTypeName());
assertEquals(1, fileBackend.reservedMetadata().builtinTypeSurfaces().getFirst().fields().size());
}
@@ -671,7 +671,7 @@ class PbsFrontendCompilerTest {
void shouldRejectHostBindingWithoutCapabilityAtHostAdmission() {
final var source = """
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
fn draw_pixel(x: int, y: int) -> void;
}
""";
@@ -693,8 +693,8 @@ class PbsFrontendCompilerTest {
void shouldRejectHostBindingCapabilityNotDeclaredInStrictContext() {
final var source = """
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw_pixel(x: int, y: int) -> void;
}
""";
@@ -719,7 +719,7 @@ class PbsFrontendCompilerTest {
void shouldRejectUnknownHostCapabilityAtHostAdmission() {
final var source = """
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "video")]
fn draw_pixel(x: int, y: int) -> void;
}
@@ -740,7 +740,7 @@ class PbsFrontendCompilerTest {
void shouldRejectMalformedHostCapabilityMetadataAtHostAdmission() {
final var source = """
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(version = 1)]
fn draw_pixel(x: int, y: int) -> void;
}
@@ -51,8 +51,8 @@ class PbsGateUSdkInterfaceConformanceTest {
}
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw_pixel(x: int, y: int, color: Color) -> void;
}
""";
@@ -114,7 +114,7 @@ class PbsGateUSdkInterfaceConformanceTest {
&& t.intrinsics().stream().anyMatch(i -> i.canonicalName().equals("input.button.hold"))));
assertTrue(positive.irBackend().getReservedMetadata().hostMethodBindings().stream()
.anyMatch(h -> h.ownerName().equals("LowGfx")
&& h.abiModule().equals("gfx")
&& h.abiModule().equals("gfx2d")
&& h.abiMethod().equals("clear")
&& h.abiVersion() == 1));
assertTrue(positive.irBackend().getReservedMetadata().hostMethodBindings().stream()
@@ -254,8 +254,8 @@ class PbsGateUSdkInterfaceConformanceTest {
}
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw_pixel(x: int, y: int, color: Color) -> void;
}
""";
@@ -319,8 +319,8 @@ class PbsGateUSdkInterfaceConformanceTest {
}
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw_pixel(x: int, y: int, color: Color) -> void;
}
@@ -364,7 +364,7 @@ class PbsGateUSdkInterfaceConformanceTest {
void gateU_shouldEmitHostAdmissionDiagnosticForMissingCapabilityMetadata() {
final var source = """
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
fn draw_pixel(x: int, y: int) -> void;
}
""";
@@ -223,8 +223,8 @@ class PbsModuleVisibilityTest {
final var sourceAst = parseSource(
"""
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw_pixel(x: int, y: int) -> void;
}
""",
@@ -136,8 +136,8 @@ class PbsParserTest {
@Test
void shouldRejectAttributesInOrdinarySourceAndRecover() {
final var source = """
[Host(module = "gfx", name = "draw", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw", version = 1)]
[Capability(name = "gfx2d")]
fn run() -> int { return 1; }
declare struct Point(x: int,);
""";
@@ -305,8 +305,8 @@ class PbsParserTest {
fn pack() -> int;
}
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw(x: int, y: int, color: Color) -> void;
}
[BuiltinConst(target = "Color", name = "white", version = 1)]
@@ -343,8 +343,8 @@ class PbsParserTest {
void shouldRecoverFromMalformedReservedDeclarationsInInterfaceModuleMode() {
final var source = """
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw(x: int, y: int) -> void;
unexpected_token
}
@@ -23,8 +23,8 @@ class PbsInterfaceModuleSemanticsTest {
}
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw_pixel(x: int, y: int, c: Color) -> void;
}
@@ -51,8 +51,8 @@ class PbsInterfaceModuleSemanticsTest {
}
declare contract Api {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn run() -> void;
}
@@ -104,15 +104,15 @@ class InterfaceModuleLoaderTest {
"""
declare host LowComposer {
[Host(module = "composer", name = "bind_scene", version = 1)]
[Capability(name = "gfx")]
[Capability(name = "composer")]
fn bind_scene(scene_bank_id: int) -> int;
[Host(module = "composer", name = "unbind_scene", version = 1)]
[Capability(name = "gfx")]
[Capability(name = "composer")]
fn unbind_scene() -> int;
[Host(module = "composer", name = "emit_sprite", version = 1)]
[Capability(name = "gfx")]
[Capability(name = "composer")]
fn emit_sprite(
glyph_id: int,
palette_id: int,
@@ -647,8 +647,8 @@ class PBSFrontendPhaseServiceTest {
fn pack() -> int;
}
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw(x: int, y: int, color: Color) -> void;
}
""");
@@ -721,8 +721,8 @@ class PBSFrontendPhaseServiceTest {
"gfx.pbs",
"""
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw(x: int, y: int) -> void;
}
"""))),
@@ -1328,8 +1328,8 @@ class PBSFrontendPhaseServiceTest {
"main.pbs",
"""
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Capability(name = "gfx")]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "gfx2d")]
fn draw_pixel(x: int, y: int) -> void;
}
"""))),
@@ -1547,7 +1547,7 @@ class PBSFrontendPhaseServiceTest {
"main.pbs",
"""
declare host Gfx {
[Host(module = "gfx", name = "draw_pixel", version = 1)]
[Host(module = "gfx2d", name = "draw_pixel", version = 1)]
[Capability(name = "unknown_capability")]
fn draw_pixel(x: int, y: int) -> void;
}
@@ -2013,7 +2013,7 @@ class PBSFrontendPhaseServiceTest {
"gfx.pbs",
"""
declare host Gfx {
[Host(module = "gfx", name = "clear", version = 1)]
[Host(module = "gfx2d", name = "clear", version = 1)]
fn clear() -> void;
}
"""))),
@@ -2079,7 +2079,7 @@ class PBSFrontendPhaseServiceTest {
"gfx.pbs",
"""
declare host Gfx {
[Host(module = "gfx", name = "clear", version = 1)]
[Host(module = "gfx2d", name = "clear", version = 1)]
[InitAllowed]
fn clear() -> void;
}