refactor(ecs): systems under their module, and a name on every observer - #1037
Merged
Conversation
flecs resolves a system_named("smash::tick_cooldowns") string relative to
the module scope that world.module::<Self>("smash::Ability") already set, so
the redundant prefix created a phantom smash node and buried every game
system at smash.Ability.smash.tick_cooldowns. The explorer drew 17 phantom
smash rows that correspond to nothing. Drop the prefix; the module scope
supplies the path. Terrain, which already resolved cleanly, is left alone.
Name every previously anonymous observer across hyperion and smash so the
explorer stops listing them as #NNN and the flecs borrow-panic can print the
observer's name.
tests/system_paths.rs guards both: it fails if any module grows a child
literally named smash.
Benchmark Results for generalComparing to 035a8ce |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1037 +/- ##
==========================================
+ Coverage 53.46% 54.06% +0.60%
==========================================
Files 345 347 +2
Lines 31870 32497 +627
Branches 1207 1234 +27
==========================================
+ Hits 17039 17571 +532
- Misses 14561 14644 +83
- Partials 270 282 +12
... and 15 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
flecs resolves the string in
system_named("smash::tick_cooldowns")relative to the module scope thatworld.module::<Self>("smash::Ability")already set. So the redundantsmash::prefix created a phantomsmashnode and buried every game system atsmash.Ability.smash.tick_cooldowns. On the live world the explorer drew 17 phantomsmashrows that correspond to nothing, plus the same defect in two hyperion effects modules.This drops the redundant prefix so the module scope supplies the path, and names every previously anonymous observer across hyperion and smash.
smash::Xprefix removed -> cleansmash.Module.leaf.effects/spawnandeffects/particle: samehyperion::phantom removed.smash.rotate_map(verified on the live REST endpoint, HTTP 200 atsmash/rotate_map, 404 atMapModule/smash/rotate_map), and stripping its prefix would have moved it out of thesmashtree..observer::<...>()in hyperion + smash is nowobserver_namedwith a meaningful leaf, so the explorer stops listing them as#NNNand the flecs borrow-panic can print the observer's name (thedocs/flecs-rust-api-notes.mdnote asked for this; it was dead for observers with no name).Behaviour is unchanged: only name strings and observer names moved, no logic.
Proof
events/smash/tests/system_paths.rsis the guard. It importsSmashModuleand fails if any module grows a child literally namedsmash.Broken on purpose (re-added a
smash::prefix to one system), the guard fires with the intended message:Restored, both pass:
cargo clippy -p smash -p hyperion --all-targets --all-features -- -D warnings: clean.cargo test -p smash: all pass.cargo test -p hyperion: all pass.