Skip to content

Conversation

makspll
Copy link
Owner

@makspll makspll commented Sep 8, 2025

Summary

  • Improves DisplayWithTypeInfo and DebugWithTypeInfo implementations, making sure they pass the type info provider context fully down
    • Generally improved display implementations, with clearer templates and more robust type retrievals
  • Improves ScriptError allowing delaying of printing to a later system
  • Adds option to BMS infrastructure plugin to disable logging of script errors by default
  • Adds ReflectDisplayWithTypeInfo which will be used by the ReflectPrinter for Reflect values, currently used to print ScriptValue correctly since it's opaque but should allow users to override printing later
  • Cleans up shared workspace cargo keys reducing amount of boilerplate
  • Adds methods to GetTypeInfo to support downcasting to concrete types and querying for type data
  • Adds various utilities to WorldGuard

Copy link

semanticdiff-com bot commented Sep 8, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/bevy_mod_scripting_bindings/src/function/namespace.rs  92% smaller
  assets/tests/add_system/added_systems_run_in_parallel.lua  85% smaller
  crates/bevy_mod_scripting_bindings/src/docgen/info.rs  82% smaller
  crates/bevy_mod_scripting_bindings/src/script_value.rs  69% smaller
  crates/bevy_mod_scripting_bindings/src/error.rs  60% smaller
  crates/bevy_mod_scripting_display/src/lib.rs  57% smaller
  crates/bevy_mod_scripting_display/src/printer/mod.rs  53% smaller
  crates/bevy_mod_scripting_bindings/src/access_map.rs  48% smaller
  crates/bevy_mod_scripting_bindings/src/reference.rs  48% smaller
  crates/bevy_mod_scripting_core/src/extractors.rs  44% smaller
  crates/bevy_mod_scripting_display/src/impls/bevy_ecs.rs  44% smaller
  crates/bevy_mod_scripting_asset/src/language.rs  42% smaller
  crates/bevy_mod_scripting_core/src/commands.rs  34% smaller
  crates/bevy_mod_scripting_core/src/handler.rs  32% smaller
  crates/bevy_mod_scripting_core/src/context.rs  30% smaller
  crates/languages/bevy_mod_scripting_rhai/src/lib.rs  23% smaller
  crates/bevy_mod_scripting_core/src/lib.rs  16% smaller
  crates/bevy_mod_scripting_core/src/error.rs  3% smaller
  crates/bevy_mod_scripting_core/src/script_system.rs  3% smaller
  crates/bevy_mod_scripting_bindings/src/world.rs  1% smaller
  Cargo.toml Unsupported file format
  assets/tests/add_system/added_systems_run_in_parallel.rhai Unsupported file format
  assets/tests/display/print_value_by_default.lua  0% smaller
  crates/bevy_mod_scripting_asset/Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_asset/readme.md Unsupported file format
  crates/bevy_mod_scripting_bindings/Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_bindings/src/allocator.rs  0% smaller
  crates/bevy_mod_scripting_core/Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_core/readme.md Unsupported file format
  crates/bevy_mod_scripting_derive/Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_derive/readme.md Unsupported file format
  crates/bevy_mod_scripting_derive/src/derive/debug_with_type_info.rs  0% smaller
  crates/bevy_mod_scripting_display/Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_display/src/impls/bevy_platform.rs  0% smaller
  crates/bevy_mod_scripting_display/src/impls/parking_lock.rs  0% smaller
  crates/bevy_mod_scripting_display/src/impls/std.rs  0% smaller
  crates/bevy_mod_scripting_functions/Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_functions/readme.md Unsupported file format
  crates/bindings/bevy_a11y_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_animation_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_asset_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_color_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_core_pipeline_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_ecs_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_gizmos_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_gltf_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_image_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_input_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_input_focus_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_math_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_mesh_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_pbr_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_picking_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_reflect_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_render_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_scene_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_sprite_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_text_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_time_bms_bindings/Cargo.toml Unsupported file format
  crates/bindings/bevy_transform_bms_bindings/Cargo.toml Unsupported file format
  crates/lad_backends/mdbook_lad_preprocessor/Cargo.toml Unsupported file format
  crates/ladfile/Cargo.toml Unsupported file format
  crates/ladfile_builder/Cargo.toml Unsupported file format
  crates/ladfile_builder/readme.md Unsupported file format
  crates/languages/bevy_mod_scripting_lua/Cargo.toml Unsupported file format
  crates/languages/bevy_mod_scripting_lua/readme.md Unsupported file format
  crates/languages/bevy_mod_scripting_lua/src/lib.rs  0% smaller
  crates/languages/bevy_mod_scripting_rhai/Cargo.toml Unsupported file format
  crates/languages/bevy_mod_scripting_rhai/readme.md Unsupported file format
  crates/testing_crates/script_integration_test_harness/src/lib.rs  0% smaller
  docs/src/Summary/controlling-script-bindings.md Unsupported file format
  examples/docgen.rs  0% smaller
  xtask/templates/bindings_crate.toml.tera Unsupported file format

@makspll makspll changed the title feature: improved dynamic printing feat: improved dynamic printing Sep 8, 2025
@makspll makspll enabled auto-merge (squash) September 8, 2025 00:27
@makspll makspll disabled auto-merge September 8, 2025 00:27
@makspll makspll changed the title feat: improved dynamic printing feat: improved dynamic printing, adds ReflectDisplayWithTypeInfo for overriding opaque type printing Sep 8, 2025
@makspll makspll enabled auto-merge (squash) September 8, 2025 00:28
Copy link
Contributor

github-actions bot commented Sep 8, 2025

🐰 Bencher Report

Branchfeature/improved-dynamic-printing
Testbedlinux-gha
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
component/access Lua📈 view plot
🚷 view threshold
3,564.50 ns
(-10.57%)Baseline: 3,985.92 ns
4,424.78 ns
(80.56%)
component/access Rhai📈 view plot
🚷 view threshold
5,417.00 ns
(-8.04%)Baseline: 5,890.56 ns
6,411.05 ns
(84.49%)
component/get Lua📈 view plot
🚷 view threshold
2,186.10 ns
(-9.19%)Baseline: 2,407.30 ns
2,700.68 ns
(80.95%)
component/get Rhai📈 view plot
🚷 view threshold
4,170.10 ns
(-5.63%)Baseline: 4,418.92 ns
4,875.70 ns
(85.53%)
conversions/Mut::from📈 view plot
🚷 view threshold
81.13 ns
(-6.06%)Baseline: 86.37 ns
93.31 ns
(86.95%)
conversions/Ref::from📈 view plot
🚷 view threshold
74.65 ns
(-10.86%)Baseline: 83.75 ns
93.02 ns
(80.25%)
conversions/ScriptValue::List📈 view plot
🚷 view threshold
372.42 ns
(+21.73%)Baseline: 305.94 ns
412.43 ns
(90.30%)
conversions/ScriptValue::Map📈 view plot
🚷 view threshold
1,023.30 ns
(-7.63%)Baseline: 1,107.78 ns
1,432.05 ns
(71.46%)
conversions/ScriptValue::Reference::from_into📈 view plot
🚷 view threshold
24.86 ns
(-1.50%)Baseline: 25.24 ns
30.48 ns
(81.56%)
conversions/Val::from_into📈 view plot
🚷 view threshold
317.30 ns
(+4.72%)Baseline: 303.01 ns
352.38 ns
(90.05%)
function/call 4 args Lua📈 view plot
🚷 view threshold
1,559.40 ns
(-16.18%)Baseline: 1,860.52 ns
2,177.10 ns
(71.63%)
function/call 4 args Rhai📈 view plot
🚷 view threshold
1,352.40 ns
(-11.47%)Baseline: 1,527.54 ns
1,751.65 ns
(77.21%)
function/call Lua📈 view plot
🚷 view threshold
227.94 ns
(-6.18%)Baseline: 242.96 ns
270.33 ns
(84.32%)
function/call Rhai📈 view plot
🚷 view threshold
485.34 ns
(+2.25%)Baseline: 474.67 ns
527.36 ns
(92.03%)
loading/empty Lua📈 view plot
🚷 view threshold
52,190.00 ns
(-18.00%)Baseline: 63,644.30 ns
74,852.92 ns
(69.72%)
loading/empty Rhai📈 view plot
🚷 view threshold
380,070.00 ns
(-3.19%)Baseline: 392,603.00 ns
453,853.16 ns
(83.74%)
math/vec mat ops Lua📈 view plot
🚷 view threshold
6,972.60 ns
(-12.17%)Baseline: 7,938.65 ns
9,356.32 ns
(74.52%)
math/vec mat ops Rhai📈 view plot
🚷 view threshold
6,293.40 ns
(-5.81%)Baseline: 6,681.46 ns
7,331.58 ns
(85.84%)
query/10 entities Lua📈 view plot
🚷 view threshold
17,929.00 ns
(-12.43%)Baseline: 20,474.70 ns
23,127.25 ns
(77.52%)
query/10 entities Rhai📈 view plot
🚷 view threshold
18,770.00 ns
(-8.80%)Baseline: 20,580.70 ns
22,553.78 ns
(83.22%)
query/100 entities Lua📈 view plot
🚷 view threshold
38,381.00 ns
(-9.43%)Baseline: 42,375.30 ns
46,410.92 ns
(82.70%)
query/100 entities Rhai📈 view plot
🚷 view threshold
31,200.00 ns
(-6.84%)Baseline: 33,492.20 ns
37,057.30 ns
(84.19%)
query/1000 entities Lua📈 view plot
🚷 view threshold
250,480.00 ns
(-8.98%)Baseline: 275,190.00 ns
303,358.12 ns
(82.57%)
query/1000 entities Rhai📈 view plot
🚷 view threshold
166,400.00 ns
(-1.36%)Baseline: 168,697.00 ns
179,599.86 ns
(92.65%)
reflection/10 Lua📈 view plot
🚷 view threshold
5,560.60 ns
(-10.46%)Baseline: 6,210.21 ns
6,919.95 ns
(80.36%)
reflection/10 Rhai📈 view plot
🚷 view threshold
14,603.00 ns
(-7.54%)Baseline: 15,793.10 ns
16,979.72 ns
(86.00%)
reflection/100 Lua📈 view plot
🚷 view threshold
48,961.00 ns
(-5.40%)Baseline: 51,755.90 ns
56,870.73 ns
(86.09%)
reflection/100 Rhai📈 view plot
🚷 view threshold
726,820.00 ns
(-5.58%)Baseline: 769,802.00 ns
847,964.90 ns
(85.71%)
resource/access Lua📈 view plot
🚷 view threshold
3,111.50 ns
(-12.21%)Baseline: 3,544.25 ns
3,992.30 ns
(77.94%)
resource/access Rhai📈 view plot
🚷 view threshold
4,845.40 ns
(-9.17%)Baseline: 5,334.78 ns
5,869.48 ns
(82.55%)
resource/get Lua📈 view plot
🚷 view threshold
1,783.80 ns
(-12.14%)Baseline: 2,030.32 ns
2,303.47 ns
(77.44%)
resource/get Rhai📈 view plot
🚷 view threshold
3,707.10 ns
(-5.78%)Baseline: 3,934.56 ns
4,336.19 ns
(85.49%)
🐰 View full continuous benchmarking report in Bencher

@makspll makspll merged commit 72388fa into main Sep 8, 2025
22 checks passed
@makspll makspll deleted the feature/improved-dynamic-printing branch September 8, 2025 09:02
@github-actions github-actions bot mentioned this pull request Sep 8, 2025
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