Conversation
PR SummaryHigh Risk Overview Extends the raw slice API with Replaces workspace-level in-language test execution with a per-project runner ( Reviewed by Cursor Bugbot for commit 00ff960. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
👍 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 00ff960. Configure here.
| while i < NUM_OF_ELEMENTS { | ||
| expected_after_insertions.push(expected_values.get(i).unwrap()); | ||
| i += 1; | ||
| } |
There was a problem hiding this comment.
Test verification uses wrong split point for expected sequence
Low Severity
The expected sequence construction in assert_insert_impl uses middle_index (which is an index into the vector after front insertion) as a split point into expected_values. After the front insert, original elements are shifted right by one, so vec[6] holds ev[5]. The loop while i < middle_index pushes ev[0] through ev[5], then inserted_middle, then ev[6] onward. But the actual vector has inserted_middle at position 6 and ev[5] at position 7. The test passes only because inserted_middle = expected_values.get(NUM_OF_ELEMENTS / 2) = ev[5], which is identical to the displaced element. The correct split should be middle_index - 1 elements from expected_values before inserted_middle.
Reviewed by Cursor Bugbot for commit 00ff960. Configure here.
StorageVecStorageVec


Description
This PR is an additional step in implementing #7560. It implements
StorageVec<V>for dynamic storage.Additionally the PR:
StorageVecin the form of in-language tests. Existing SDK harness tests are deleted in favor of new in-language tests. This is aligned with the agreed strategy to migrate SDK harness tests to in-language tests.StorageVec::insert()does not work with nested storage types #6040 by properly documenting the semantics of zero-sized types in relation to storage. EveryStorageVec<V>methods that does not work with zero-sized types, which are assumed to be nested storage types, is now documented for limitations.When running in-language tests using
forc teston the whole workspace two blocking issues occur:assert_eqcalls make compiler panic with too big data section #7612forc testprocess gets killed when run on a workspace with a large number of projects #7613Workarounds for those issues are commented in code and linked to the issues.
Additional in-language tests for other storage types will be added in a separate PR.
Breaking Changes
Existing
StorageVec<V>methods in the quads-based implementation that cannot be used with nested storage types, e.g.,swapnow consistently reverts ifVis a nested storage type.Previously, those methods:
Consistently reverting can be a breaking change if some existing code called these methods and they were not reverting. Note that such calls represent invalid usage of the storage API (although it was up to now not clearly documented as such) and reverting will actually point to bugs in existing callers code.
Checklist
Breaking*orNew Featurelabels where relevant.