Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 20 additions & 7 deletions docs/issues/ISS-443.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

## Metadata
- Type: task
- Status: open
- Status: in_progress
- Priority: 1
- Labels: warnings, moonbit, toolchain, migration
- Assignee: unassigned
- Created: 2026-07-15
- Updated: 2026-07-15
- Updated: 2026-07-22
- External ref: none

## Description
Expand All @@ -25,23 +25,36 @@ migration separate from ISS-442 so the dense-storage branch remains easy to
evaluate or discard.

## Acceptance Criteria
- [ ] Every warning 83 reported by the updated MoonBit toolchain is removed.
- [x] Every warning 83 reported by the updated MoonBit toolchain is removed.
- [ ] A focused test for each touched package passes before moving to the next
package.
- [ ] `many_foxes` builds for native release with warnings denied and
- [x] `many_foxes` builds for native release with warnings denied and
`MOONBIT_NEW_NATIVE=1`.
- [ ] Public interface output is unchanged.
- [ ] No runtime or scheduling behavior changes are introduced.
- [x] Public interface output is unchanged.
- [x] No runtime or scheduling behavior changes are introduced.

## Relationships
- Depends on: none
- Parent: none
- Related: ISS-426
- Related: ISS-426, ISS-474
- Discovered from: ISS-442

## Notes

- 2026-07-15: The warnings appeared after the local MoonBit toolchain update.
They are outside the ECS package and are not caused by the dense-column diff.
- 2026-07-22: Added 98 explicit defining-trait extensions across 41 files and
one explicit `LevelMetadataAccessor` dispatch. The migration is private and
behavior-preserving; generated public interfaces remain unchanged.
- 2026-07-22: `MOONBIT_NEW_NATIVE=1 moon -C mgstudio-engine check --target
native --deny-warn` passed 1556 tasks. `MOONBIT_NEW_NATIVE=1 moon -C
mgstudio-engine build --target native --release --deny-warn
examples/stress_tests/many_foxes` passed 378 tasks, with only the existing
duplicate-library linker warning.
- 2026-07-22: Removed 433 unrelated executable-manifest migrations and eight
formatter-only source diffs from this change. An aggregate focused-test run
exposed the pre-existing Commands regression tracked by ISS-474. Further
aggregate native-release compilation was intentionally stopped, so the
per-package focused-test criterion remains open.

## Close Notes
47 changes: 47 additions & 0 deletions docs/issues/ISS-474.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# ISS-474: Fix Commands deferred-spawn test regression

## Metadata
- Type: bug
- Status: open
- Priority: 1
- Labels: app, ecs, commands, tests, regression
- Assignee: unassigned
- Created: 2026-07-22
- Updated: 2026-07-22
- External ref: none

## Description

The native release test `app: Commands spawn reserves an entity until deferred
flush` exits with `SIGABRT` at `app/commands_test.mbt:259`. The failure remains
when the unrelated ISS-443 `CounterResource` trait extension is temporarily
removed, so it is a baseline app/Commands regression rather than part of the
warning-syntax migration.

## Design

Reproduce the failure in isolation, capture the assertion or abort reason, and
trace entity reservation through deferred command flush. Compare the behavior
with the pinned Bevy Commands owner before changing ECS or app scheduling.

## Acceptance Criteria
- [ ] The isolated native release test reports the concrete failing invariant.
- [ ] Deferred `Commands::spawn` reserves an entity that is not query-visible
until flush and becomes live with its queued components afterward.
- [ ] The focused test passes under `MOONBIT_NEW_NATIVE=1` without weakening
warning policy or changing unrelated scheduling behavior.

## Relationships
- Depends on: none
- Parent: none
- Related: ISS-442
- Discovered from: ISS-443

## Notes

- 2026-07-22: Reproduced with `MOONBIT_NEW_NATIVE=1 moon -C mgstudio-engine
test app/commands_test.mbt --target native --release -f 'app: Commands spawn
reserves an entity until deferred flush'`; the test executable exited with
signal 6. The same result occurred with the ISS-443 app extension removed.

## Close Notes
6 changes: 4 additions & 2 deletions docs/issues/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Generated by derive-tracker.wasm
| [ISS-157](ISS-157.md) | 0 | bug | unassigned | Triage 2026-06-24 all-reference visual audit regressions | examples, screenshots, visual-parity, render, pbr, text, camera |
| [ISS-089](ISS-089.md) | 1 | bug | unassigned | Port pcss widget controls and shadow source parity | examples, pbr, pcss, shadows, widgets, taa, source-parity |
| [ISS-129](ISS-129.md) | 1 | bug | unassigned | Restore shadow_biases source parity | examples, pbr, shadows, lighting, ui, source-parity, visual-parity |
| [ISS-443](ISS-443.md) | 1 | task | unassigned | Clear new-toolchain type-parameter method warnings | warnings, moonbit, toolchain, migration |
| [ISS-474](ISS-474.md) | 1 | bug | unassigned | Fix Commands deferred-spawn test regression | app, ecs, commands, tests, regression |
| [ISS-047](ISS-047.md) | 2 | epic | unassigned | Triage failed example screenshot captures | examples, screenshots, visual-parity, capture, triage |
| [ISS-441](ISS-441.md) | 2 | bug | unassigned | Make many_foxes profiling survive long native compilation | performance, many_foxes, diagnostics, tooling, native |

Expand All @@ -37,6 +37,7 @@ Generated by derive-tracker.wasm
| [ISS-104](ISS-104.md) | in_progress | 1 | epic | unassigned | ISS-174 | ISS-091, ISS-108, ISS-109 | Port Bevy volumetric fog render pass ownership |
| [ISS-105](ISS-105.md) | in_progress | 1 | task | unassigned | none | none | Audit the latest 173 commits for Bevy source fidelity |
| [ISS-155](ISS-155.md) | in_progress | 1 | task | unassigned | none | none | Complete Bevy PBR material and render mesh owner parity |
| [ISS-443](ISS-443.md) | in_progress | 1 | task | unassigned | none | none | Clear new-toolchain type-parameter method warnings |
| [ISS-001](ISS-001.md) | open | 0 | epic | unassigned | none | none | Recover the many_foxes CPU frame budget |
| [ISS-004](ISS-004.md) | blocked | 0 | task | unassigned | ISS-043 | ISS-011 | Reduce animation target write amplification |
| [ISS-012](ISS-012.md) | open | 0 | epic | unassigned | none | none | Bring render, PBR, mesh, and light to Bevy source-level parity |
Expand Down Expand Up @@ -95,7 +96,7 @@ Generated by derive-tracker.wasm
| [ISS-407](ISS-407.md) | blocked | 1 | bug | unassigned | none | ISS-114 | Capture pinned Bevy contact_shadows window for visual parity |
| [ISS-427](ISS-427.md) | blocked | 1 | bug | unassigned | none | none | Unblock ASan and LSan startup on macOS |
| [ISS-428](ISS-428.md) | blocked | 1 | feature | unassigned | none | none | Add cancellable wgpu map-read futures |
| [ISS-443](ISS-443.md) | open | 1 | task | unassigned | none | none | Clear new-toolchain type-parameter method warnings |
| [ISS-474](ISS-474.md) | open | 1 | bug | unassigned | none | none | Fix Commands deferred-spawn test regression |
| [ISS-047](ISS-047.md) | open | 2 | epic | unassigned | none | none | Triage failed example screenshot captures |
| [ISS-441](ISS-441.md) | open | 2 | bug | unassigned | none | none | Make many_foxes profiling survive long native compilation |
| [ISS-011](ISS-011.md) | open | 4 | task | unassigned | ISS-004 | none | Recheck cluster assignment after top CPU costs are fixed |
Expand Down Expand Up @@ -577,6 +578,7 @@ graph TD
ISS_471["ISS-471: Optimize revocable table-batch value access"]
ISS_472["ISS-472: Restrict filtered table batches to matching rows"]
ISS_473["ISS-473: Align Camera2d frustum with uniform render scale"]
ISS_474["ISS-474: Fix Commands deferred-spawn test regression"]
ISS_002 --> ISS_003
ISS_002 --> ISS_004
ISS_043 --> ISS_004
Expand Down
3 changes: 3 additions & 0 deletions mgstudio-engine/app/resource_param_test.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ impl Resource for CounterResource with fn resource() {
counter_resource_key
}

///|
extend CounterResource with Resource::{resource}

///|
fn read_counter_resource(world : @ecs.World) -> CounterResource? {
world.get_resource(counter_resource_key)
Expand Down
21 changes: 21 additions & 0 deletions mgstudio-engine/asset/assets_test.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,27 @@
// See the License for the specific language governing permissions and
// limitations under the License.

///|
extend MissingLoaderAsset with Asset::{asset_debug_name}

///|
extend MultiLoaderAsset with Asset::{asset_debug_name}

///|
extend NamedProcessorScopeAsset with Asset::{asset_debug_name}

///|
extend ProcessorScopeAsset with Asset::{asset_debug_name}

///|
extend RegistryScopedLegacyAsset with Asset::{asset_debug_name}

///|
extend StoreTestAsset with Asset::{asset_debug_name}

///|
extend TestCustomAsset with Asset::{asset_debug_name}

///|
struct CountingLoadGuard {
releases : Ref[Int]
Expand Down
4 changes: 1 addition & 3 deletions mgstudio-engine/camera/plugin_test.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ test "camera projection plugin: updates frustum when transform or projection cha
let updated_projection = @pbr.Projection::Perspective(
@pbr.PerspectiveProjection3d::PerspectiveProjection3d().with_far(250.0F),
)
try! (app
.world()
.replace(entity, @pbr.ecs_key_projection, updated_projection)
try! (app.world().replace(entity, @pbr.ecs_key_projection, updated_projection)
|> ignore)
app = app.update()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,7 @@ test "camera/primitives: light frusta containers default to Bevy empty shape" {

///|
test "camera/primitives: Sphere intersects transformed Aabb" {
let aabb = Aabb::from_min_max_xyz(
-1.0F,
-1.0F,
-1.0F,
1.0F,
1.0F,
1.0F,
)
let aabb = Aabb::from_min_max_xyz(-1.0F, -1.0F, -1.0F, 1.0F, 1.0F, 1.0F)
let world_from_local = @math.Affine3::from_translation(
@math.Vec3::new(2.0F, 0.0F, 0.0F),
)
Expand Down
6 changes: 4 additions & 2 deletions mgstudio-engine/camera/visibility/visible_entities_wbtest.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,16 @@ test "camera visibility: check visibility fills camera VisibleEntities by visibi
visible_mesh,
@root_visibility.ecs_key_view_visibility,
@root_visibility.ViewVisibility::visible(),
) |> ignore)
)
|> ignore)
world.increment_change_tick() |> ignore
world.increment_change_tick() |> ignore
let tick_context = @core.SystemTickContext::new()
tick_context.set(@core.SystemTicks::new(1, 2))
world.set_tick_context(tick_context)
let view_visibility = (try! world.get_mut(
visible_mesh, key=@root_visibility.ecs_key_view_visibility,
visible_mesh,
key=@root_visibility.ecs_key_view_visibility,
)).unwrap()
view_visibility.bypass_change_detection(fn(value) { value.advance_frame() })

Expand Down
6 changes: 6 additions & 0 deletions mgstudio-engine/core_pipeline/skybox/top_wbtest.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

///|
extend ExtractedSkyboxes with @app.Resource::{resource}

///|
extend SkyboxUniforms with @ecs.Component::{component}

///|
fn skybox_test_abs(value : Float) -> Float {
if value < 0.0F {
Expand Down
13 changes: 10 additions & 3 deletions mgstudio-engine/ecs/ecs_perf_bench_test.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,9 @@ test "bench ecs: table batch read view cached" (b : @bench.T) {
let cache = QueryCache::new()
b.bench(name="table batch value accessor x102400", count=50U, () => {
let query : Query[ReadValue[BenchPosition], All] = query_filtered_with_cache(
world, All::new(), cache,
world,
All::new(),
cache,
)
let total = Ref(0)
try! query.for_each_table(fn(batch) {
Expand All @@ -482,11 +484,16 @@ test "bench ecs: table batch read view cached" (b : @bench.T) {
})
b.bench(name="table batch read view x102400", count=50U, () => {
let query : Query[ReadValue[BenchPosition], All] = query_filtered_with_cache(
world, All::new(), cache,
world,
All::new(),
cache,
)
let total = Ref(0)
try! query.for_each_table(fn(batch) {
batch.read(bench_position_key).unwrap().with_values(fn(positions) {
batch
.read(bench_position_key)
.unwrap()
.with_values(fn(positions) {
for position in positions {
total.val = total.val + position.x
}
Expand Down
12 changes: 8 additions & 4 deletions mgstudio-engine/ecs/query_table_batch_test.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ test "ecs table batch: read view exposes complete live column" {
let seen : Array[Int] = []

try! query.for_each_table(fn(batch) {
batch.read(table_batch_velocity_key).unwrap().with_values(fn(values) {
batch
.read(table_batch_velocity_key)
.unwrap()
.with_values(fn(values) {
for value in values {
seen.push(value.value)
}
Expand Down Expand Up @@ -670,9 +673,10 @@ test "panic ecs table batch: read view rejects filtered row batches" {

ignore(
try! query.try_for_each_filtered_table(fn(batch, _rows) {
batch.read(table_batch_velocity_key).unwrap().with_values(fn(_values) {
()
})
batch
.read(table_batch_velocity_key)
.unwrap()
.with_values(fn(_values) { () })
}),
)
}
Expand Down
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/2d_shapes/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/2d_viewport_to_world/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/bloom_2d/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/boxes2/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/contact_filter2/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/cpu_draw/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/custom_system_setup2/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/debug_despawn2/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/debug_toggle2/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/debugdump2/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/despawn2/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/dynamic_mip_generation/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
4 changes: 1 addition & 3 deletions mgstudio-engine/examples/2d/events2/moon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ import {

supported_targets = "native"

options(
"is-main": true,
)
pkgtype(kind: "executable")
Loading
Loading