Skip to content

Conversation

@highperformancecoder
Copy link
Owner

@highperformancecoder highperformancecoder commented Jan 21, 2026

This change is Reviewable

Summary by CodeRabbit

  • Chores

    • Updated recorded submodule references to track latest upstream commits.
  • Refactor

    • Removed internal synchronization primitives across several components to simplify concurrency handling.
  • Tests

    • Adjusted test formatting and indentation with no behavioral changes.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings January 21, 2026 07:08
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Removed the Ravel class's internal mutex and all locking constructs; updated two submodule commit pointers; minor whitespace adjustments in a test file.

Changes

Cohort / File(s) Summary
Submodule References
RavelCAPI, ecolab
Updated recorded subproject commit hashes; no code logic changes.
Mutex Synchronization Removal
model/ravelWrap.h, model/ravelWrap.cc
Deleted private updateMutex (std::shared_mutex) and removed all lock_guard / shared_lock usage across rendering, event handlers, state queries/mutations, CSV export, and lock-group flows.
Test Formatting
test/testTensorOps.cc
Adjusted indentation/whitespace in for-loops only; no functional change.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Poem

🐇 I nudged a mutex, set it free,
Threads now hop without a key,
Submodules nudged, a tidy sweep,
Tests still snug in quiet sleep,
A lighter Ravel — nimble and cheery.

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.76% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Bugfix 1900' is vague and does not clearly communicate what the bugfix addresses, providing no meaningful context about the changeset. Revise the title to describe the specific issue being fixed, such as 'Remove mutex synchronization from Ravel methods' or reference the bug tracker with a clear description of the fix.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses bugfix 1900 by fixing test assertions to properly handle sparse tensor indices and updating the version to 3.21.0-beta.4.

Changes:

  • Fixed test assertions in testTensorOps.cc to use sorted indices when validating sparse tensor data
  • Updated version strings across multiple files from 3.20.0 to 3.21.0-beta.4
  • Enabled OpenMP by default (except on Darwin/macOS) and improved build configuration

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/testTensorOps.cc Fixed test assertions to properly handle unsorted sparse tensor indices by sorting before comparison
test/Makefile Commented out OPENMP conditional compilation flags
resetRavel.py Changed output to print basename instead of full path
model/ravelWrap.h Added shared_mutex include
model/ravelWrap.cc Reformatted function bodies and fixed indentation
minskyVersion.h Updated version to 3.21.0-beta.4
gui-js/package.json Updated version to 3.21.0-beta.4
gui-js/libs/shared/src/lib/constants/version.ts Updated version to 3.21.0-beta.4
gui-js/libs/shared/src/lib/backend/minsky.ts Removed unused Image method
engine/minskyTensorOps.cc Refactored conditional logic to reduce nesting
ecolab Updated subproject commit
doc/version.tex Updated version to 3.21.0-beta.4
RavelCAPI Updated subproject commit
Makefile Enabled OpenMP by default except on Darwin, added CPUPROFILE support, and added libgomp-1 to Windows dependencies
Doxyversion Updated version to 3.21.0-beta.4
Files not reviewed (1)
  • gui-js/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

for (size_t _i=0; _i<9; ++_i) EXPECT_EQ(expected[_i], (*chain.back())[_i]);
index=chain.back()->index();
sortedIdx=vector<size_t>(index.begin(),index.end()); sort(sortedIdx.begin(),sortedIdx.end());
for (size_t _i=0; _i<9; ++_i) EXPECT_EQ(expected[_i], chain.back()->atHCIndex(sortedIdx[_i]));
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Inconsistent indentation: this line has an extra leading space compared to the identical patterns on lines 1201, 1215, and 1222. All similar for-loop statements should have consistent indentation.

Suggested change
for (size_t _i=0; _i<9; ++_i) EXPECT_EQ(expected[_i], chain.back()->atHCIndex(sortedIdx[_i]));
for (size_t _i=0; _i<9; ++_i) EXPECT_EQ(expected[_i], chain.back()->atHCIndex(sortedIdx[_i]));

Copilot uses AI. Check for mistakes.
for (size_t _i=0; _i<5; ++_i) EXPECT_EQ(expectedf[_i], (*chain.back())[_i]);
index=chain.back()->index();
sortedIdx=vector<size_t>(index.begin(),index.end()); sort(sortedIdx.begin(),sortedIdx.end());
for (size_t _i=0; _i<5; ++_i) EXPECT_EQ(expectedf[_i], chain.back()->atHCIndex(sortedIdx[_i]));
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Trailing whitespace detected at the end of this line. Remove the trailing space for consistency with the codebase.

Suggested change
for (size_t _i=0; _i<5; ++_i) EXPECT_EQ(expectedf[_i], chain.back()->atHCIndex(sortedIdx[_i]));
for (size_t _i=0; _i<5; ++_i) EXPECT_EQ(expectedf[_i], chain.back()->atHCIndex(sortedIdx[_i]));

Copilot uses AI. Check for mistakes.
endif

MAKEOVERRIDES+=FPIC=1 CLASSDESC=$(shell pwd)/ecolab/classdesc/classdesc EXTRA_FLAGS="$(EXTRA_FLAGS)" CPLUSPLUS="$(CPLUSPLUS)" GCOV=$(GCOV) OPENMP=1
$(warning $(MAKEOVERRIDES))
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Debug warning statement left in production code. This warning output should be removed or commented out before merging to avoid cluttering build logs.

Suggested change
$(warning $(MAKEOVERRIDES))
# $(warning $(MAKEOVERRIDES))

Copilot uses AI. Check for mistakes.
@highperformancecoder highperformancecoder changed the base branch from master to develop January 21, 2026 07:15
@highperformancecoder
Copy link
Owner Author

@CodeRabbit review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@highperformancecoder
Copy link
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@highperformancecoder
Copy link
Owner Author

@coderabbitai help

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

CodeRabbit commands

These commands are invoked using PR/Issue comments.

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
    • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
    • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai generate configuration to create a PR that adds the current resolved configuration as .coderabbit.yaml (or show it if already present).
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit configuration file (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, support, documentation and community

  • Visit our status page to check the current availability of CodeRabbit.
  • Create a ticket on our support page for assistance with any issues or questions.
  • Visit our documentation site for detailed information on how to use CodeRabbit.
  • Join our Discord community to connect with other users and get help from the community.
  • Follow us on X/Twitter for updates and announcements.

@highperformancecoder
Copy link
Owner Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

✅ Actions performed

Full review triggered.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@RavelCAPI`:
- Line 1: Remove the unused include by deleting the line '#include
<shared_mutex>' from ravelWrap.h (and ensure ravelWrap.cc does not require it),
and run a build to confirm no compile errors; then verify the RavelCAPI
submodule pointer update is intentional—if there are no threading/mutex changes
referenced in ravelWrap.h or ravelWrap.cc, revert the submodule update or add a
commit message documenting why the pointer bump is needed.

@@ -1 +1 @@
Subproject commit 8282d1b91ec193f3b0e4d6102eaa9873814d3994
Subproject commit b6974785f1e168028805e15527d3843f07b84fbf
Copy link
Contributor

@coderabbitai coderabbitai bot Jan 21, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if RavelCAPI submodule exists and is initialized
if [ -d "RavelCAPI" ]; then
  echo "=== RavelCAPI submodule directory exists ==="
  ls -la RavelCAPI/.git 2>/dev/null && echo "Submodule is initialized" || echo "Submodule not initialized"
  
  # Try to retrieve information about the submodule
  echo ""
  echo "=== Current submodule status ==="
  git config --file .gitmodules --get-regexp path | grep -i ravel
  
  # Check the submodule HEAD
  echo ""
  echo "=== Current commit in RavelCAPI ==="
  cd RavelCAPI && git rev-parse HEAD 2>/dev/null || echo "Cannot determine current commit"
  cd - > /dev/null
else
  echo "RavelCAPI directory does not exist"
fi

# Check main repository changes related to mutex
echo ""
echo "=== Files changed in main PR (looking for ravelWrap) ==="
git diff --name-only HEAD~1 HEAD 2>/dev/null | grep -i ravel || echo "Cannot determine changed files"

# Try to see if there's information about this change in git index
echo ""
echo "=== Checking git index for submodule change ==="
git ls-files --stage | grep RavelCAPI

Repository: highperformancecoder/minsky

Length of output: 486


🏁 Script executed:

#!/bin/bash
# Check the current directory structure
echo "=== Repository structure ==="
git ls-files | head -20

# Look for ravelWrap files mentioned in the review context
echo ""
echo "=== Searching for ravelWrap files ==="
find . -name "*ravelWrap*" -type f 2>/dev/null

# Check if there are any mutex-related changes in the current commit
echo ""
echo "=== Looking for mutex-related changes ==="
git diff HEAD~1 HEAD 2>/dev/null | grep -i -E "(mutex|lock|sync)" | head -20 || echo "Cannot retrieve diffs or no mutex changes found"

Repository: highperformancecoder/minsky

Length of output: 639


🏁 Script executed:

#!/bin/bash
# Check the size of ravelWrap files first
echo "=== File sizes ==="
wc -l ./model/ravelWrap.cc ./model/ravelWrap.h

echo ""
echo "=== Searching for mutex in ravelWrap.cc ==="
grep -n "mutex" ./model/ravelWrap.cc | head -20

echo ""
echo "=== Searching for mutex in ravelWrap.h ==="
grep -n "mutex" ./model/ravelWrap.h | head -20

echo ""
echo "=== Checking git status ==="
git status

echo ""
echo "=== Checking git log for recent commits ==="
git log --oneline -10

Repository: highperformancecoder/minsky

Length of output: 453


🏁 Script executed:

#!/bin/bash
# Check if we can see staged changes
echo "=== Staged changes ==="
git diff --cached --name-only

echo ""
echo "=== All changes (staged and unstaged) ==="
git diff HEAD --name-only 2>/dev/null | head -20

echo ""
echo "=== Check if there's a diff in the working tree ==="
git status -s

echo ""
echo "=== Try to get commit message ==="
git log -1 --pretty=format:"%B"

Repository: highperformancecoder/minsky

Length of output: 258


🏁 Script executed:

#!/bin/bash
# Let's examine the actual content of ravelWrap files
echo "=== Content of ravelWrap.h ==="
cat -n ./model/ravelWrap.h

echo ""
echo "=== Content of ravelWrap.cc ==="
cat -n ./model/ravelWrap.cc

Repository: highperformancecoder/minsky

Length of output: 48965


🏁 Script executed:

#!/bin/bash
# Check .gitmodules to understand the submodule setup
echo "=== .gitmodules content ==="
cat .gitmodules

echo ""
echo "=== Check if there's a remote URL for the submodule ==="
git config --file .gitmodules --get submodule.RavelCAPI.url

echo ""
echo "=== Check git log to understand recent commits ==="
git log --oneline -20 | head -20

echo ""
echo "=== Look for any reference to RavelCAPI in recent commits ==="
git log --oneline --all | grep -i ravel | head -10

Repository: highperformancecoder/minsky

Length of output: 667


Remove the unused #include <shared_mutex> from ravelWrap.h and verify the RavelCAPI submodule update is intentional.

The header includes <shared_mutex> but it is never used in either ravelWrap.h or ravelWrap.cc. Additionally, clarify the purpose of updating the RavelCAPI submodule pointer since there are no active mutex synchronization changes in the main codebase to justify this update as part of a threading-related fix.

🤖 Prompt for AI Agents
In `@RavelCAPI` at line 1, Remove the unused include by deleting the line
'#include <shared_mutex>' from ravelWrap.h (and ensure ravelWrap.cc does not
require it), and run a build to confirm no compile errors; then verify the
RavelCAPI submodule pointer update is intentional—if there are no
threading/mutex changes referenced in ravelWrap.h or ravelWrap.cc, revert the
submodule update or add a commit message documenting why the pointer bump is
needed.

Copy link
Owner Author

@highperformancecoder highperformancecoder Jan 21, 2026

Choose a reason for hiding this comment

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

@coderabbitai The updated RavelCAPI reference contains mutex syncronisation changes??

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the RavelCAPI submodule changes between the old and new commits
echo "=== Checking RavelCAPI submodule change details ==="

# Initialize and update submodule if needed
git submodule update --init RavelCAPI 2>/dev/null || echo "Submodule already initialized"

cd RavelCAPI

echo ""
echo "=== Current commit in RavelCAPI ==="
git rev-parse HEAD

echo ""
echo "=== Log between old and new commit ==="
git log --oneline 8282d1b91ec193f3b0e4d6102eaa9873814d3994..b6974785f1e168028805e15527d3843f07b84fbf 2>/dev/null || \
git log --oneline 8282d1b..b6974785 2>/dev/null || \
echo "Could not retrieve log"

echo ""
echo "=== Checking for mutex-related changes in RavelCAPI ==="
git diff 8282d1b91ec193f3b0e4d6102eaa9873814d3994..b6974785f1e168028805e15527d3843f07b84fbf --stat 2>/dev/null | head -20 || \
git diff 8282d1b..b6974785 --stat 2>/dev/null | head -20 || \
echo "Could not retrieve diff stats"

echo ""
echo "=== Searching for mutex in the diff ==="
git diff 8282d1b91ec193f3b0e4d6102eaa9873814d3994..b6974785f1e168028805e15527d3843f07b84fbf 2>/dev/null | grep -i -C 3 "mutex" | head -50 || \
git diff 8282d1b..b6974785 2>/dev/null | grep -i -C 3 "mutex" | head -50 || \
echo "Could not search for mutex changes"

echo ""
echo "=== List all files in RavelCAPI ==="
ls -la

Length of output: 3772


@highperformancecoder, you're absolutely right, and I apologize for the confusion. The RavelCAPI submodule update does indeed contain mutex synchronization changes:

Commit b697478: "Add a shared_mutex around calls to RavelCAPI to make ravelCAPI::Ravel and ravelCAPI::Database thread-safe. For Minsky #1900"

The submodule adds an updateMutex (shared_lock and lock_guard) to numerous methods in dynamicRavelCAPI.cc, including:

  • render(), clear(), rescale(), radius(), rank(), description()
  • Mouse event handlers: onMouseDown(), onMouseUp(), onMouseMotion(), onMouseOver(), onMouseLeave()

This refactoring moves the thread safety from the Minsky wrapper layer (where updateMutex was removed from ravelWrap.h/.cc) into the RavelCAPI library itself. This is a cleaner design since the synchronization is now encapsulated within RavelCAPI rather than being the responsibility of the wrapper.

My original review comment was incorrect. The submodule update is intentional and directly addresses the threading issues in bug #1900.

@highperformancecoder highperformancecoder merged commit 1986874 into develop Jan 21, 2026
5 checks passed
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