Skip to content

[DRAFT] Rewrite DragonRunner in Rust? - #21

Open
JustinMeimar wants to merge 70 commits into
mainfrom
justin/rust-rewrite
Open

[DRAFT] Rewrite DragonRunner in Rust?#21
JustinMeimar wants to merge 70 commits into
mainfrom
justin/rust-rewrite

Conversation

@JustinMeimar

@JustinMeimar JustinMeimar commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator

Motivations:

  1. Deploying dragon-runner on the lab machines had some issues.
    • Ancient python version (3.8) we had to conform to.
    • Error pronechmod in the CMPUT415 users' local python packages to get
      the binary to unlock (now we have a single statically linked executable.)
  2. Fuses gazbolt into this project.
  3. Opus 4.6 let me drive this in a few hours.

Refactors:

  • Full rewrite of dragon-runner from python to rust driven by Claude Opus 4.6
  • Simplified toolchain config json (exe/args instead of stepName/executablePath/arguments/output).
    The lingering config files on the lab machines will need to be updated (along with the executable.)
  • proc-macro logging system replacing scattered print statements
  • Toolchain runner rewritten as try_fold pipeline rather than imperative hair ball.
  • Updated README to reflect changes.

Fixes:

  • memcheck mode is now decoupled from valgrind-specific configs. This was a hazard last year,
    running memcheck w/o the specific config gave false positives.
  • All grading scripts now driven from a single key system. We can fill out once with each students
    information at the beginning of a semester, then automatically drive cloning, building, testfile
    pruning, config synthesis, etc, which require some alignment with student info.

Features:

  • Parallel test execution within subpackages.
  • Serve mode for producing a compiler explorer for any config, using a light-weigt HTML and JS single
    files in lieu of "Gazbolt" (not sure if we want to bring a svelte dependecy into this project.)
  • SKIP directive for skipping individual test files. (closes [FEAT] Explicit Skip Rule #18)
  • --full-path flag to log absolute test paths on failure. (closes [FEAT] Print full failing test paths #19)

Todo:

  • Sleep on it... I'm probably forgetting something.

also attach missing run_tests.sh script from many changes ago
Comment thread src/config.rs
Comment on lines +73 to +77
impl Validate for SubPackage {
fn validate(&self) -> Vec<DragonError> {
self.tests.iter().flat_map(|t| t.validate()).collect()
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this ensure that there are matching .test/.out files? Could be nice to emit the warning here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This recurses into validations for individual test files, and no it does not validate that any expected output is supplied. If there is neither a CHECK: nor CHECK_FILE then the test assumes no output is expected.

Comment thread src/harness.rs
/// Implemented by any `TestHarness` which makes a single, sequential iteration
/// over the tests in each package and subpackage. Applies to all except for
/// the `TournamentHarness`, which iterates in a cross product.
pub trait SequentialTestHarness {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is nice, I think this will make multithreading quite easy to implement.

@Sir-NoChill

Sir-NoChill commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

...... merge time @JustinMeimar ? ......

@JustinMeimar

Copy link
Copy Markdown
Collaborator Author

@Sir-NoChill Yes, sorry I should have allocated a bit more time to get this across the finish line.

Have you been able to test the Gazprea implementation with this version of dragon-runner? If it works for your daily needs then my confidence would be much higher.

@Sir-NoChill

Sir-NoChill commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Lol, silly question, should we maybe just port the original to mojo? it might... like.... just run.....

The whole bloody toolchain is installable via pip... we can even install globally in cmput415 for people to use

@JustinMeimar

Copy link
Copy Markdown
Collaborator Author

Porting to Mojo would be easy. Though from my experience last year, it is actually the pip installations which are finicky. Under the group permissions model 415-resources uses, re-installations overwrite the r-x perms of python libraries and require manually chmod'ing them back. It is a bit of a pain.

I've also fixed a number of bugs in this rewrite, and added some of the features you mentioned. However, if you're keen on trying Mojo it wouldn't be too difficult to re-implement the features atop the original runner. I'll let today be my final day to work on this PR, then it can be entirely up to you.

@JustinMeimar

JustinMeimar commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

Final thoughts:

  • Grading abstractions are the worst part of the code. There is alot of
    coupling to the competitive testing format: coherence points, offensive
    points, defensive points, performance testing, etc. The relative weights
    are all parameterizable through a grading config, however larger changes
    could easily break. The good part is, this is not student facing.

  • The dragon-runner serve command works nicely on my end. It is super
    simple and easy to maintain. Any dragon-runner config can be used as
    a compiler explorer.

  • cargo test should instill some confidence dragon-runner does what is
    expected of it: we have lots of internal tests for memcheck, package
    filtering, failing tests, skipping tests, inline and out of line directives,
    tournament configurations, etc. Whether all of these assertions continue
    to line up with the expected use, especially in the grading setting, is
    less certain.

  • The JSON config API remained the same. All of the generator, scalc
    (rip), vcalc and Gazprea configs should work, but I haven't tested them.

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.

[FEAT] Print full failing test paths [FEAT] Explicit Skip Rule

2 participants