Skip to content

Commit

Permalink
Handle missing profile stats gracefully instead of asserting.
Browse files Browse the repository at this point in the history
There is a bug souffle-lang#2426, which causes an assertion in the
SelingerProfileSipsMetric::getReordering. There is no need to assert,
since we can handle the problem gracefully by not reordering atoms.
  • Loading branch information
strRM committed Nov 13, 2024
1 parent 73edcf3 commit d3368cf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ast2ram/utility/SipsMetric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ std::vector<std::size_t> SelingerProfileSipsMetric::getReordering(
auto sccAtoms = filter(ast::getBodyLiterals<ast::Atom>(*clause),
[&](auto* atom) { return contains(sccRelations, program.getRelation(*atom)); });

assert(profileUseAnalysis->hasAutoSchedulerStats() && "Must have stats in order to auto-schedule!");
if (!profileUseAnalysis->hasAutoSchedulerStats()) {
std::vector<std::size_t> res;
res.resize(atoms.size());
std::iota(res.begin(), res.end(), 0);
return res;
}

auto* prof = profileUseAnalysis;
auto getJoinSize = [&prof](bool isRecursive, const std::string& rel, std::set<std::size_t> joinKeys,
Expand Down

0 comments on commit d3368cf

Please sign in to comment.