Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-Framework #182

Merged
merged 56 commits into from
Jun 29, 2023
Merged

Re-Framework #182

merged 56 commits into from
Jun 29, 2023

Conversation

schmidma
Copy link
Member

@schmidma schmidma commented Apr 9, 2023

Introduced Changes

This refactors the existing framework parts of source analyzation and code generation.

  • introduction of framework.toml (crates/hulk/framework.toml)
  • rewrite of crates/source_analyzer
    • central Cyclers struct containing all info in a single tree
    • no bidirectional mappings
    • no code generation related information in source analyzation step
    • error handling using thiserror including span information
    • circular dependencies are identified and lead to errors
  • refactor code generation
    • improve readability
    • use quote!{ ... }
    • error handling using thiserror

ToDo / Known Issues

  • recheck the rerun-if-changed calls, it seems the binary is always recompiled
  • selection of different framework.toml configurations to allow for different run-configurations.
    • reintegration of the behavior simulator
  • Check allows

Ideas for Next Iterations (Not This PR)

  • Framework v2 #21
  • Ideas for next iteration #71
  • Errors have to be improved, when hitting them. I tried to test many of them, but definitely missed corner cases. Additionally, they are not shown in the rust analyzer diagnostics. I did not find a way to do that yet.
  • parameter as value not as reference by default
  • default should not be required for parameters

How to Test

./pepsi run (for webots)
./pepsi upload xx (to test the nao)
./pepsi analyze xxxxxx to query framework information

@knoellle knoellle self-assigned this Apr 9, 2023
@schmidma schmidma force-pushed the reframework branch 8 times, most recently from e879a17 to 00628cc Compare May 6, 2023 16:15
@schmidma schmidma enabled auto-merge May 6, 2023 16:38
@h3ndrk h3ndrk self-assigned this May 6, 2023
Cargo.toml Show resolved Hide resolved
crates/code_generation/src/accessor.rs Show resolved Hide resolved
crates/source_analyzer/src/cycler.rs Outdated Show resolved Hide resolved
crates/source_analyzer/src/cycler.rs Outdated Show resolved Hide resolved
crates/source_analyzer/src/cycler.rs Outdated Show resolved Hide resolved
crates/code_generation/src/accessor.rs Show resolved Hide resolved
crates/hulk_nao/Cargo.toml Outdated Show resolved Hide resolved
crates/hulk_webots/src/hardware_interface.rs Show resolved Hide resolved
crates/hulk_webots/src/hardware_interface.rs Outdated Show resolved Hide resolved
crates/hulk_webots/src/hardware_interface.rs Outdated Show resolved Hide resolved
crates/vision/src/camera_matrix_extractor.rs Show resolved Hide resolved
tests/behavior/golden_goal.lua Outdated Show resolved Hide resolved
tools/behavior_simulator/src/cycler.rs Outdated Show resolved Hide resolved
crates/control/src/hulk_message_filter.rs Outdated Show resolved Hide resolved
crates/source_analyzer/src/cycler.rs Outdated Show resolved Hide resolved
crates/source_analyzer/src/cycler.rs Outdated Show resolved Hide resolved
@schmidma schmidma force-pushed the reframework branch 2 times, most recently from ac8301e to 4e7000e Compare May 12, 2023 11:29
@knoellle
Copy link
Contributor

knoellle commented May 12, 2023

Tested recompilation times with the code generation extraction from 4e7000e.

Hot builds

Recompilation time when touching walking_engine.rs without changing the code.

pepsi build # --profile release
touch crates/control/src/motion/walking_engine.rs
pepsi build # --profile release
now previous commit main
release 18s 15.5s 17.5s
incremental 5.5s 15.5s 5.5s

Cold builds

Using a locally installed pepsi to prevent unfair reuse in incremental mode of crates already built for pepsi.

cargo clean
pepsi build # --profile release
now previous commit main
release 42s 49s 40s
incremental 45s 52.5s 44s

Edit: added measurements for main.

tools/pepsi/src/analyze.rs Outdated Show resolved Hide resolved
crates/source_analyzer/src/cycler.rs Outdated Show resolved Hide resolved
crates/source_analyzer/src/cycler.rs Outdated Show resolved Hide resolved
crates/source_analyzer/src/path.rs Outdated Show resolved Hide resolved
crates/hulk/src/lib.rs Show resolved Hide resolved
@knoellle
Copy link
Contributor

Rebased and resolved conflicts.
Had to downgrade the toml crate to make it compile because of toml-rs/toml#490.
We should undo this when removing toml parsing.

Cargo.toml Outdated Show resolved Hide resolved
crates/code_generation/src/perception_databases.rs Outdated Show resolved Hide resolved
crates/hulk/framework.toml Outdated Show resolved Hide resolved
crates/hulk/src/lib.rs Show resolved Hide resolved
crates/hulk_webots/src/hardware_interface.rs Outdated Show resolved Hide resolved
crates/source_analyzer/src/cyclers.rs Outdated Show resolved Hide resolved
crates/code_generation/src/accessor.rs Show resolved Hide resolved
crates/code_generation/src/run.rs Show resolved Hide resolved
crates/source_analyzer/src/cyclers.rs Outdated Show resolved Hide resolved
crates/source_analyzer/src/error.rs Outdated Show resolved Hide resolved
crates/source_analyzer/src/structs.rs Outdated Show resolved Hide resolved
crates/hulk/build.rs Outdated Show resolved Hide resolved
tools/pepsi/Cargo.toml Outdated Show resolved Hide resolved
@knoellle knoellle force-pushed the reframework branch 2 times, most recently from 728a9f2 to e508461 Compare June 23, 2023 23:02
@h3ndrk h3ndrk disabled auto-merge June 29, 2023 05:18
Copy link
Member

@h3ndrk h3ndrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @schmidma and @knoellle! 🎉

Let's test this once more and then feel free to merge @knoellle! 🤩

@schmidma schmidma enabled auto-merge June 29, 2023 07:11
@schmidma schmidma dismissed knoellle’s stale review June 29, 2023 07:12

merge merge merge

@schmidma schmidma added this pull request to the merge queue Jun 29, 2023
Merged via the queue into HULKs:main with commit a5aefaf Jun 29, 2023
15 checks passed
@schmidma schmidma deleted the reframework branch June 29, 2023 07:15
@knoellle knoellle mentioned this pull request Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants