Skip to content

Commit

Permalink
Limit bisect approach to NMG, where individual operations should be f…
Browse files Browse the repository at this point in the history
…ast (if they're going to work).
  • Loading branch information
starseeker committed Dec 5, 2023
1 parent bb191d9 commit a38066b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/libged/facetize/tri_booleval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ manifold_do_bool(
}

int
tess_exec(const char **tess_cmd, int tess_cmd_cnt, struct _ged_facetize_state *s)
tess_run(const char **tess_cmd, int tess_cmd_cnt, struct _ged_facetize_state *s)
{
int aborted = 0, timeout = 0;
int64_t start = bu_gettime();
Expand Down Expand Up @@ -399,7 +399,7 @@ bisect_run(std::vector<struct directory *> &bad_dps, std::vector<struct director
bu_log("%s\n", bu_vls_cstr(&cmd));
bu_vls_free(&cmd);

int ret = tess_exec(tess_cmd, cmd_cnt+inputs.size(), s);
int ret = tess_run(tess_cmd, cmd_cnt+inputs.size(), s);
if (ret) {
if (inputs.size() > 1) {
return bisect_failing_inputs(bad_dps, inputs, tess_cmd, cmd_cnt, s);
Expand Down Expand Up @@ -566,7 +566,19 @@ _ged_facetize_booleval(struct _ged_facetize_state *s, int argc, struct directory
// primitives
int err_cnt = 0;
while (tess_cmd[7]) {
err_cnt = bisect_run(bad_dps, dps, tess_cmd, cmd_fixed_cnt, s);
if (BU_STR_EQUAL(tess_cmd[7], "--nmg")) {
err_cnt = bisect_run(bad_dps, dps, tess_cmd, cmd_fixed_cnt, s);
} else {
// If we're in fallback territory, process individually rather
// than doing the bisect - at least for now, those methods are
// much more expensive and likely to fail as compared to NMG.
for (size_t i = 0; i < dps.size(); i++) {
tess_cmd[10] = dps[i]->d_namep;
int tess_ret = tess_run(tess_cmd, 11, s);
if (tess_ret)
bad_dps.push_back(dps[i]);
}
}
if (!err_cnt)
break;
tess_cmd[7] = method_opt(&method_flags);
Expand Down

0 comments on commit a38066b

Please sign in to comment.