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

Propagate known. #2325

Merged
merged 41 commits into from
Jan 20, 2025
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
cce4375
Single step processor.
chriseth Dec 20, 2024
c54c0dd
Negative test.
chriseth Dec 20, 2024
a40a133
Merge remote-tracking branch 'origin/main' into single_step_simple
chriseth Jan 2, 2025
eb245ac
Apply suggestions from code review
chriseth Jan 2, 2025
1530cae
Merge branch 'single_step_simple' of ssh://github.com/powdr-labs/powd…
chriseth Jan 2, 2025
1588eb2
adjust tests.
chriseth Jan 2, 2025
cc70c19
Remove test function.
chriseth Jan 2, 2025
b13df2d
Merge branch 'remove_test_function' into single_step_simple
chriseth Jan 2, 2025
96d5506
Fix testing functions.
chriseth Jan 2, 2025
4fc4a2e
Merge branch 'single_step_simple'
chriseth Jan 3, 2025
64de47c
Provide completed identities and store `completed` inside witgen_infe…
chriseth Jan 13, 2025
f44e52b
fix
chriseth Jan 13, 2025
d8e7273
Merge remote-tracking branch 'origin/main' into provide_completed_ide…
chriseth Jan 14, 2025
f5c1f74
Simplify process summary.
chriseth Jan 14, 2025
2945d10
Cleanup
chriseth Jan 14, 2025
5423bb0
Apply suggestions from code review
chriseth Jan 15, 2025
64b622a
fix expectations
chriseth Jan 15, 2025
aedb50d
fix comment.
chriseth Jan 15, 2025
4477ea7
Merge remote-tracking branch 'origin/main' into provide_completed_ide…
chriseth Jan 15, 2025
1b1129b
Propagate known
chriseth Jan 14, 2025
917f677
Fix test.
chriseth Jan 14, 2025
1405bc0
cleanup
chriseth Jan 14, 2025
f937252
Refactor.
chriseth Jan 14, 2025
73c9d81
Better errors.
chriseth Jan 14, 2025
6ce7f65
Also print code generated so far.
chriseth Jan 14, 2025
cafd532
Compile-time check for covered offset.
chriseth Jan 14, 2025
5c9f1a5
Consider conflicting branches.
chriseth Jan 14, 2025
926c0ed
Check assignments.
chriseth Jan 14, 2025
80c376f
Better logging.
chriseth Jan 14, 2025
c90b819
Use BTreeSet for assignments.
chriseth Jan 14, 2025
0972be0
fmt
chriseth Jan 15, 2025
052216c
Merge branch 'provide_completed_identities'
chriseth Jan 16, 2025
4038131
Merge branch 'main' into propagate_known
chriseth Jan 16, 2025
08e897a
Merge remote-tracking branch 'origin/main' into propagate_known
chriseth Jan 16, 2025
a3dc813
fix
chriseth Jan 16, 2025
71032b5
Typos.
chriseth Jan 16, 2025
8840d7f
Extend docstring.
chriseth Jan 16, 2025
737c767
Simplify errors.
chriseth Jan 16, 2025
28f4e10
clippy
chriseth Jan 16, 2025
a007e2d
Merge remote-tracking branch 'origin/main' into propagate_known
chriseth Jan 20, 2025
f0e6582
Cleanup and test expectation updates.
chriseth Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove test function.
chriseth committed Jan 2, 2025
commit cc70c191b9aaa51da7cd9a3da42895d1a3df361f
14 changes: 0 additions & 14 deletions executor/src/witgen/data_structures/mutable_state.rs
Original file line number Diff line number Diff line change
@@ -42,20 +42,6 @@ impl<'a, T: FieldElement, Q: QueryCallback<T>> MutableState<'a, T, Q> {
}
}

#[cfg(test)]
pub fn get_machine(&self, substring: &str) -> &RefCell<KnownMachine<'a, T>> {
use itertools::Itertools;

self.machines
.iter()
.filter(|m| m.borrow().name().contains(substring))
.exactly_one()
.map_err(|e| {
format!("Expected exactly one machine with substring '{substring}', but found {e}.")
})
.unwrap()
}

/// Runs the first machine (unless there are no machines) end returns the generated columns.
/// The first machine might call other machines, which is handled automatically.
pub fn run(self) -> HashMap<String, Vec<T>> {
28 changes: 16 additions & 12 deletions executor/src/witgen/jit/block_machine_processor.rs
Original file line number Diff line number Diff line change
@@ -195,31 +195,35 @@ mod test {
let (fixed_data, retained_identities) =
global_constraints::set_global_constraints(fixed_data, &analyzed.identities);
let machines = MachineExtractor::new(&fixed_data).split_out_machines(retained_identities);
let mutable_state = MutableState::new(machines.into_iter(), &|_| {
Err("Query not implemented".to_string())
});

let machine = mutable_state.get_machine(machine_name);
let ((machine_parts, block_size, latch_row), connection_ids) = match *machine.borrow() {
KnownMachine::BlockMachine(ref m) => (m.machine_info(), m.identity_ids()),
_ => panic!("Expected a block machine"),
let [KnownMachine::BlockMachine(machine)] = machines
.iter()
.filter(|m| m.name().contains(machine_name))
.collect_vec()
.as_slice()
else {
panic!("Expected exactly one matching block machine")
};
assert_eq!(connection_ids.len(), 1);

let (machine_parts, block_size, latch_row) = machine.machine_info();
assert_eq!(machine_parts.connections.len(), 1);
let connection_id = *machine_parts.connections.keys().next().unwrap();
let processor = BlockMachineProcessor {
fixed_data: &fixed_data,
machine_parts,
machine_parts: machine_parts.clone(),
block_size,
latch_row,
};

let mutable_state = MutableState::new(machines.into_iter(), &|_| {
Err("Query not implemented".to_string())
});

let known_values = BitVec::from_iter(
(0..num_inputs)
.map(|_| true)
.chain((0..num_outputs).map(|_| false)),
);

processor.generate_code(&mutable_state, connection_ids[0], &known_values)
processor.generate_code(&mutable_state, connection_id, &known_values)
}

#[test]