oxidecomputer / oxidecomputer/steno

Add explicit parallel tracking to PrintOrderer

Open
#33 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
170
Forks
15
PR merge metrics
No merged PRs in 30d

Description

TLDR

By adding aPrintOrderEntry::ParallelEnd variant to be output from PrintOrderer::print_order, we can drastically simplify our property_indents_are_correct test method.

Details

The PrintOrderer code from #29 only writes when parallel entries start to the ordering output from PrintOrderer::print_order. The ending of parallelism is implicitly specified by the indent level decreasing in a subsequent PrintOrderEntry::Node. This doesn't make printing any harder, as there is no need to print when parallel nodes end. However, not having this information does make the property based testing code more complicated. Instead of ensuring that the indent level in the PrintOrderEntry matches the expected depth of the indent stack, we have to check if the indent level is exactly one less than the number of entries on the stack, which indicates that parallelism has ended. This occurs in multiple match clauses and makes the test harder to read.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with PrintOrderEntry and PrintOrderer::print_order, then inspect the property_indents_are_correct test. Add explicit ParallelEnd output when parallelism ends, and update the test so it can use that marker instead of inferring the end from a decreased indent level.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
distributed-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.