-
Notifications
You must be signed in to change notification settings - Fork 52
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
Queues: binary heap #2074
Merged
Merged
Queues: binary heap #2074
Conversation
This file contains 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
ethanuppal
added a commit
that referenced
this pull request
Jun 6, 2024
* [fud2] Rhai Plugins (#2078) * initial implementation of rhai based plugin system * cleanup EmitSetup trait situation + appease clippy * fix tests by emitting everything to an intermediate buffer first * use thread_local + once_cell::Lazy to avoid constructing the engine over and over * remove unused import * DriverBuilder::find_state + define plugins in fud2.toml * try building more complicated plugins * unused annotation for add_file * nicer errors for rhai * remove unused imports * clean reporting code slightly * create a new emitter for each rhai function * RhaiEmitter::with to simplifies buffering + unbuffering the emitter * separate plugins.rs into multiple files + rename things * fix lib.rs * error reporting for setup_refs * small string change * change Into to From * [fud2] Make plugins optional (#2082) Very minor fix: #2078 added plugins, controlled by a `plugins` key in `fud2.toml`. However, it inadvertently made this option required, i.e., fud2 would crash if this option was not present. Now it's optional! So we just silently proceed with no plugins if none are configured. * Queues: binary heap (#2074) * Some sketching * Quick fixed to make it generate * Tuplify * Untuplify * Tidy * Stash * More component-based approach * Swap group * Checking in aspirational yx file * Thrashing. Need comb components * Baby data file * Attempt at CombComponent in ast * Attempt to add comb comp to builder * Test comb groups with tuplify * Testing for comb comp * Stray assert * Fix slice helper, use correctly * Stray change from merge * Use HI instead of 1 * Smaller, tidier, py file * Two values * Smaller queue * Add rudimentary cmp component * Add three elements, no swaps * Make cmp a comb component * Trying to actually run algorithm. Wrong * Little tinkering * Parent, child indices * Comb mem all over * Aha. Just find_parent is wrong * Minimize issue * Move to seq mem * fix * Working thanks to #2071 * Tidy some helpers * Move to mem of length 15 * Bubbling up works, insert works * Simplify interface * One more push that does not trigger a swap * Put back the well-formedness pass I had removed * Simplify parent-finding routine * Tinkering * Update runt.toml * Tidy docstring --------- Co-authored-by: Caleb <[email protected]> Co-authored-by: calebmkim <[email protected]> * [fud2] Refactor plugin script loading (#2083) * [fud2] Make plugins optional Very minor fix: #2078 added plugins, controlled by a `plugins` key in `fud2.toml`. However, it inadvertently made this option required, i.e., fud2 would crash if this option was not present. Now it's optional! So we just silently proceed with no plugins if none are configured. * Fix a doc typo * Start refactoring plugin loading * Start refactoring builder functions * Refactor the rest of the functions * Gather up a `register` function * Use a fresh engine for each plugin?? Maybe this is wasteful, but it simplifies things a lot. * Run one script at a time * Refector script contexts * Refactor runner struct * Further beef up the runner * Further simplify interface * Fix a borrow that lasts too long * Fix a method name Clippy was thrown for a loop because of the `to_*` name. * Move plugin loading to DriverBuilder? Now the top-level thing is in the builder itself... no need for an extra trait? Not sure this is a good idea. * [Profiling] Sample values at clock falling edges and accommodate single-enable control blocks/par arms (#2081) * [WIP] Saving scratch work. Most likely want to switch to VCDVCD streaming like Kevin's example * Very rough first pass at sampling FSM values * Some cleanup * Add start and end times for each group * Small bug fix * Add documentation * Get TDCC to emit different information for parallel arms that only have one group * Finagle with documentation * [WIP] Setting up signal ID mapping from signal names * [WIP] Read single value groups. Need to fix the FSMs * Add FSM entry for "END" * Fixed up most of fsm0 (language-tutorial-iterate) profiling. * Emit JSON when the control only consists of one group * Remove resolved TODO * Documentation and struct name changes * Fix bug where FSM values of main's startup time didn't get profiled * Rename tools/vcd-parsing to tools/profiler * Fix up documentation * Pass Reorder Option (#2075) * reorder pass options * interp bug * clippy * clippy again * some more erros * redo this * Fix multiple paths doc link (#2094) * Fix a link to Python source code (#2095) * [fud2] Unique fud2 directories and version gating `ninja --quiet` (#2092) * attempt to create a unique directory for each fud2 execution * version checking for --quiet * trigger CI again * Use a stable directory name when `--keep` * Remove an unnecessary `into` Now that we are cloning the working directory anyway. * Factor out ninja_supports_quiet --------- Co-authored-by: Adrian Sampson <[email protected]> * [fud2] Migrate operations into Rhai (#2084) * [fud2] Make plugins optional Very minor fix: #2078 added plugins, controlled by a `plugins` key in `fud2.toml`. However, it inadvertently made this option required, i.e., fud2 would crash if this option was not present. Now it's optional! So we just silently proceed with no plugins if none are configured. * Fix a doc typo * Start refactoring plugin loading * Start refactoring builder functions * Refactor the rest of the functions * Gather up a `register` function * Use a fresh engine for each plugin?? Maybe this is wasteful, but it simplifies things a lot. * Run one script at a time * Refector script contexts * Refactor runner struct * Further beef up the runner * Further simplify interface * Fix a borrow that lasts too long * Fix a method name Clippy was thrown for a loop because of the `to_*` name. * Move plugin loading to DriverBuilder? Now the top-level thing is in the builder itself... no need for an extra trait? Not sure this is a good idea. * translate a bulk of operations into rhai * use single engine to module resolution caching, enabling imports * switched all plugins to use import system * include plugins in debug build * we can now load scripts embedded in the binary * if a module fails once, don't retry it * sort states and operations in list mode * migrate entirely to plugins * gate migration behind a feature * move sorting to when we run files * rename plugins to scripts internally * refactored to have more things live in the resolver * rename plugins/ to scripts/ --------- Co-authored-by: Adrian Sampson <[email protected]> * Improve some `from_ast` errors (#2102) * fix a missing papercut test * slightly improved handlig of ast errors * formatting * Revert "fix a missing papercut test" This reverts commit c155487. * Initial calyx-pass * Update calyx-pass * Update README.md * Add image to README * Implement custom scroll buffer * Update formatting * Update formatting (take 2) * Make clippy happy * Make clippy happy (take 2) * Make clippy happy (take 3) * Better error message for when calyx executable isn't found * Fix pass application errors Calyx IR is not deserializable so I worked around that --------- Co-authored-by: Samuel Thomas <[email protected]> Co-authored-by: Adrian Sampson <[email protected]> Co-authored-by: Anshuman Mohan <[email protected]> Co-authored-by: Caleb <[email protected]> Co-authored-by: calebmkim <[email protected]> Co-authored-by: Ayaka Yorihiro <[email protected]> Co-authored-by: Nathaniel Navarro <[email protected]> Co-authored-by: Adrian Sampson <[email protected]>
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.
This PR makes progress towards #2067. I have started implementing a binary heap. It just has the
push
function. It does not yet implement our universal queue interface, has not been tested very rigorously, and does not have documentation.Importantly, it just accepts and stores 64-bit values, ordering them by those values' magnitudes. Eventually we'll want to accept a 32-bit value and a 32-bit rank, and push the (value, rank) tuple ordered by the magnitude of the rank.
I'm hoping to leave those tasks for my amazing BURE undergrads!