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

Add additional optimization passes and rework I/O considerations #123

Closed
wants to merge 18 commits into from

Conversation

Paul1365972
Copy link
Contributor

@Paul1365972 Paul1365972 commented Aug 9, 2023

Continuation of #120.
Adds two new optimization passes, gives finer control over what MCHPRS considers to be inputs/outputs and some QoL changes to commands.
Hope the huge scope of this PR is acceptable, as it was too difficult to properly decouple everything and create separate PR's for each change.

Changes:

  • Add /toggleioonly command that ensures only I/O blocks are visually updated, even in "development mode" (without active redpiler)
    • Also implies io-only on compiles
  • Reworked what components are considered to be inputs or outputs. Now defined in the core crates build script (useful for builds with non standard output components)
    • Optimization passes in the redpiler now ensure these components are never optimized away
  • Experimental addition of a now Buffer component that can be used to coalesce multiple components
  • Added PruneOrphans pass, removes all nodes that do not contribute to output components
  • Added TailCoalesce pass, replaces lines of comparators, that only connect to outputs, with the new Buffer component
  • Added dot file output when compiling with the export flag
  • Improved warning message when compiling while there are still active ticks
  • Added autocompletion info for some commands
  • Adds a playground crate to to run experiments (Should possibly be removed or better commented?)

Checks:

  • No performance regressions on the chungus benchmark
  • Note: Node in direct.rs now contains exactly 128 bytes

Open improvements and considerations:

  • Consider using unions and bitfields in the future in case Node ever needs to hold more state
  • Improve documentation on the new "magic" build script?
  • tail_coalesce pass can theoretically optimize more cases according to the results of the playgrounds experiments
  • Delete entirely or improve documentation of new playground crate and its current binaries
  • Linear subgraph search algorithm can be extracted and also used to delete comparator lines that more than 15 signal strength falloff

@Paul1365972 Paul1365972 marked this pull request as draft December 4, 2023 00:42
@Paul1365972
Copy link
Contributor Author

This PR is superseded by #139

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