Skip to content

Commit

Permalink
non-minimal walk enter for grouter boundedness check
Browse files Browse the repository at this point in the history
  • Loading branch information
dm0n3y committed Feb 10, 2025
1 parent 05830da commit 6a00014
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/core/material/Walker.re
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,23 @@ let enter_all =
});
let enter_all = (~from: Dir.t, nt) => enter_all((from, nt));

let enter_all_ = ((from: Dir.t, nt: Mtrl.NT.t)) => {
let q = Queue.create();
swing_all(~from, nt)
|> Index.filter(is_neq)
|> Index.iter((dst, w) => Queue.push((dst, w), q));
bfs(~from, q)
|> Index.filter(Walk.is_valid)
|> Index.fil(_ =>
fun
| [] => false
| _ => true
)
// todo: apply swings_profile filter here
|> Index.sort;
};
let enter_ = (~from, src, dst) => Index.find(dst, enter_all_((from, src)));

let walk_l_map = ref(End.Map.empty);
let walk_r_map = ref(End.Map.empty);
let enter_l_map = ref(Mtrl.NT.Map.empty);
Expand Down
2 changes: 1 addition & 1 deletion src/core/parser/Grouter.re
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module Cells = {
switch (face(~side=from, cs)) {
| None => Some(false)
| Some(t) =>
Walker.enter(~from, nt, Node(t.mtrl))
Walker.enter_(~from, nt, Node(t.mtrl))
|> Lists.hd
|> Option.map(w => Walk.height(w) > 1)
};
Expand Down

0 comments on commit 6a00014

Please sign in to comment.