Skip to content

refactor testing! - #21

Merged
Modertool999 merged 2 commits into
mainfrom
testing-refactor
Jul 23, 2026
Merged

refactor testing!#21
Modertool999 merged 2 commits into
mainfrom
testing-refactor

Conversation

@Modertool999

Copy link
Copy Markdown
Collaborator

No description provided.

@sampsyo sampsyo left a comment

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.

Looks great!! It is fantastic that we get to use the same set of programs to test everything we want to do so far. Nice work getting this stimulus-generator script to do the right thing!!


# just for fun: use path name as random seed!
# (not necessary AT ALL but I think it's cool)
rng = Random(aag_path.name)

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.

It is pretty cool. 😃

# just for fun: use path name as random seed!
# (not necessary AT ALL but I think it's cool)
rng = Random(aag_path.name)
clock_cycles = 1 if L == 0 else 2**L + 1

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.

I don't totally understand why 2^L+1 is the right number of cycles, but choosing something that is somehow related to the number of latches seems perfectly reasonable, I suppose.

Comment thread scripts/make_aiger_stimulus_inputs.py Outdated

stim_path = aag_path.with_suffix(".stim")

stim_path.write_text("\n".join([*input_rows, "."]) + "\n")

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.

FWIW, this might be slightly more readable/maintainable as a loop. Something like this:

with open(stim_path, 'w') as f:
    for row in input_rows:
        print(row, file=f)
    print('.', file=f)

Comment thread src/main.rs
values_to_bits(&step.inputs),
values_to_bits(&step.outputs),
values_to_bits(&step.next_state),
values_to_bits(&step.state),

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.

No action required here; just noting that this is the weird place where we think the C AIGER implementation probably has a bug.

@Modertool999
Modertool999 merged commit 1f3dc1c into main Jul 23, 2026
2 checks passed
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.

2 participants