Skip to content

Conversation

@joka921
Copy link
Member

@joka921 joka921 commented Dec 4, 2025

This will be used for reading the updateTriples and serialized cached results.

Signed-off-by: Johannes Kalmbach <[email protected]>
…out providing any unit tests yet.

Signed-off-by: Johannes Kalmbach <[email protected]>
@joka921 joka921 marked this pull request as ready for review December 5, 2025 10:07
@joka921 joka921 requested a review from RobinTF December 5, 2025 10:07
@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 94.20290% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.20%. Comparing base (6c4c294) to head (312094a).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/util/BlankNodeManager.cpp 93.61% 1 Missing and 5 partials ⚠️
src/engine/LocalVocab.h 0.00% 1 Missing ⚠️
src/util/Synchronized.h 95.23% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2574      +/-   ##
==========================================
+ Coverage   91.14%   91.20%   +0.06%     
==========================================
  Files         469      473       +4     
  Lines       40181    40338     +157     
  Branches     5376     5390      +14     
==========================================
+ Hits        36622    36791     +169     
+ Misses       2021     2009      -12     
  Partials     1538     1538              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@RobinTF RobinTF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started a first review. I still don't quite understand all the quirks.

// is assigned a UUID. This map keeps track of the currently active sets,
// but does not participate in their (shared) ownership, hence the
// `weak_ptr`.
std::unordered_map<boost::uuids::uuid, std::weak_ptr<Blocks>, UuidHash>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not a adu::HashMap?

Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
@joka921 joka921 requested a review from RobinTF December 5, 2025 16:35
Copy link
Collaborator

@RobinTF RobinTF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're getting there. Didn't have an in depth look at the individual tests in test/BlankNodeManagerTest.cpp, but they all look reasonable.


// _____________________________________________________________________________
auto LocalVocab::getOwnedLocalBlankNodeBlocks() const
-> std::vector<LocalBlankNodeManager::OwnedBlocksEntry> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason why the auto -> syntax is used instead of a directly specified return type?

Comment on lines 143 to 144
// We unfortunately cannot make this an `AD_CORRECTNESS_CHECK`, because then
// we might have a deadlock wrt the `Blocks` destructor.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why? Doesn't AD_CORRECTNESS_CHECK also just throw an exception?

Comment on lines 195 to 196
auto ptr = isNew ? std::shared_ptr<Blocks>() : it->second.lock();
if (isNew || ptr == nullptr) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two lines are confusing. Would it be incorrect to just do

Suggested change
auto ptr = isNew ? std::shared_ptr<Blocks>() : it->second.lock();
if (isNew || ptr == nullptr) {
auto ptr = it->second.lock();
if (ptr == nullptr)

in particular, I find it really hard to reason about this since the value of ptr also depends on isNew

return lbnm;
}

// Helper to perform a round-trip serialization/deserialization
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add full stops to all of these.

// Helper to verify all IDs are contained in the LocalBlankNodeManager
static void verifyIdsContained(
const BlankNodeManager::LocalBlankNodeManager& lbnm,
const std::vector<uint64_t>& ids) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a source location + location trace here. Same for all the other functions containing EXPECT/ASSERT.

// Verify new IDs can still be allocated and don't conflict
auto newId = lbnm2->getId();
EXPECT_TRUE(lbnm2->containsBlankNodeIndex(newId));
// The new ID should be in a new block (primary blocks now has 1 block)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here with full stops.

auto originalIds = allocateIdsAcrossBlocks(*lbnm, 3);
ASSERT_EQ(getPrimaryBlocks(*lbnm).size(), 3);

// Serialize
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duh. :D

Signed-off-by: Johannes Kalmbach <[email protected]>
Copy link
Collaborator

@RobinTF RobinTF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your automatic changes went a bit too far.

BlankNodeManager::LocalBlankNodeManager::OwnedBlocksEntry>& entries) {
BlankNodeManager::LocalBlankNodeManager::OwnedBlocksEntry>& entries,
ad_utility::source_location loc = AD_CURRENT_SOURCE_LOC()) {
auto t = generateLocationTrace(loc);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

BlankNodeManager* bnm,
const BlankNodeManager::LocalBlankNodeManager& source,
ad_utility::source_location loc = AD_CURRENT_SOURCE_LOC()) {
auto t = generateLocationTrace(loc);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Signed-off-by: Johannes Kalmbach <[email protected]>
@joka921 joka921 requested a review from RobinTF December 8, 2025 09:34
Copy link
Collaborator

@RobinTF RobinTF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the remaining comment (and consider the reference) then this is good to go 👍🏼

Comment on lines 167 to 168
//[[maybe_unused]] uint64_t id = lbnm.getId();
// EXPECT_EQ(bnm.state_.rlock()->usedBlocksSet_.size(), 1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this comment.

Comment on lines 310 to 313
ptr_type s() const {
AD_CORRECTNESS_CHECK(s_ != nullptr);
return s_;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider at one point to return a reference here?

Signed-off-by: Johannes Kalmbach <[email protected]>
Copy link
Collaborator

@RobinTF RobinTF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@sparql-conformance
Copy link

Overview

Number of Tests Passed ✅ Intended ✅ Failed ❌ Not tested
525 379 67 79 0

Conformance check passed ✅

No test result changes.

Details: https://qlever.dev/sparql-conformance-ui?cur=312094a43c80757d808d229a0aaec0e68fb8c3cb&prev=50d08bc03a4c1fe7495d4209a3542c90ce36b997

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 8, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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