Skip to content

refactor: Arc attribute cache, const fn, let-chain cleanup#373

Merged
AviAvni merged 3 commits intomainfrom
code-quality-fixes
Apr 14, 2026
Merged

refactor: Arc attribute cache, const fn, let-chain cleanup#373
AviAvni merged 3 commits intomainfrom
code-quality-fixes

Conversation

@AviAvni
Copy link
Copy Markdown
Contributor

@AviAvni AviAvni commented Apr 14, 2026

Summary

Split from #359.

  • Wrap AttributeCache entries in Arc<Vec> for O(1) clone on cache get (avoids full Vec heap allocation per lookup)
  • Update AttributeStore, Graph, and reply.rs callers for new Arc<Vec> return type
  • Use std::mem::size_of_val in rs_array_new for correctness
  • Flatten nested if-let into let-chains in utilize_index and index/mod
  • Mark int_loses_f64_precision and is_indexable as const fn
  • Use is_none_or instead of map_or(true, ...) in node_by_index_scan

Test plan

  • cargo check passes
  • cargo test -p graph passes
  • Flow tests pass (no behavioral changes, only internal type change)

- Wrap AttributeCache entries in Arc<Vec> for O(1) clone on cache get
- Update AttributeStore and callers for Arc<Vec> return type
- Use std::mem::size_of_val in rs_array_new for correctness
- Flatten nested if-let into let-chains in utilize_index and index/mod
- Mark int_loses_f64_precision and is_indexable as const fn
- Use is_none_or instead of map_or(true, ...) in node_by_index_scan

Split from #359.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 14, 2026

Warning

Rate limit exceeded

@AviAvni has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 48 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 14 minutes and 48 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b9ad54e9-5596-495d-a595-504fd9cb6ccf

📥 Commits

Reviewing files that changed from the base of the PR and between a5ffccd and 5d218d6.

📒 Files selected for processing (7)
  • graph/src/graph/attribute_cache.rs
  • graph/src/graph/attribute_store.rs
  • graph/src/graph/graph.rs
  • graph/src/index/mod.rs
  • graph/src/planner/optimizer/utilize_index.rs
  • graph/src/runtime/ops/node_by_index_scan.rs
  • src/reply.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch code-quality-fixes

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 90.42553% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.13%. Comparing base (b464eb2) to head (5d218d6).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
graph/src/graph/attribute_store.rs 83.87% 5 Missing ⚠️
graph/src/graph/attribute_cache.rs 66.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #373      +/-   ##
==========================================
- Coverage   84.14%   84.13%   -0.01%     
==========================================
  Files         110      110              
  Lines       28954    28963       +9     
==========================================
+ Hits        24362    24368       +6     
- Misses       4592     4595       +3     
Flag Coverage Δ
fuzz 41.86% <16.25%> (-0.34%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@AviAvni AviAvni merged commit d51f96e into main Apr 14, 2026
15 of 16 checks passed
@AviAvni AviAvni deleted the code-quality-fixes branch April 14, 2026 12:45
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.

1 participant