support GenericMemory by making the storage type a parameter#52
support GenericMemory by making the storage type a parameter#52giordano merged 7 commits intoJuliaArrays:mainfrom nsajko:underlying_storage
GenericMemory by making the storage type a parameter#52Conversation
|
@oscardssmith what do you think about the design? It's supposed to minimally restrict future developments/changes to |
|
The tests are failing because of JuliaLang/julia#49978. |
|
The overall design looks pretty reasonable. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #52 +/- ##
==========================================
+ Coverage 98.26% 98.64% +0.37%
==========================================
Files 1 1
Lines 173 221 +48
==========================================
+ Hits 170 218 +48
Misses 3 3 ☔ View full report in Codecov by Sentry. |
|
The tests should pass now, as the no-alloc tests are now conditional on the value of an environment variable. Ideally we'd add new CI runs which would have the environment variable set to |
giordano
left a comment
There was a problem hiding this comment.
as the no-alloc tests are now conditional on the value of an environment variable.
I'm missing why that's the case. I don't see anything in the source code looking at that env var?
A code coverage-enabled build, as opposed to a production build, makes constant folding less reliable: JuliaLang/julia#49978. Thus the test suite needs to be able to tell whether the build is a production build or not. If not, the no-alloc tests are disabled.
It's only used from the test suite to disable the no-alloc tests. |
|
Then check diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml
index 3d3d222..4175491 100644
--- a/.github/workflows/UnitTests.yml
+++ b/.github/workflows/UnitTests.yml
@@ -28,6 +28,9 @@ jobs:
- ubuntu-latest
- macos-latest
- windows-latest
+ code_coverage:
+ - true
+ - false
runs-on: ${{ matrix.os }}
@@ -39,6 +42,8 @@ jobs:
version: ${{ matrix.julia_version }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-runtest@v1
+ with:
+ coverage: ${{ matrix.code_coverage }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:to test all configurations with code coverage both on and off. Alternatively, you can do diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml
index 3d3d222..adcf6c7 100644
--- a/.github/workflows/UnitTests.yml
+++ b/.github/workflows/UnitTests.yml
@@ -28,6 +28,13 @@ jobs:
- ubuntu-latest
- macos-latest
- windows-latest
+ code_coverage:
+ - true
+ include:
+ - julia_version: "~1.11.0-0"
+ julia_arch: x64
+ os: ubuntu-latest
+ code_coverage: false
runs-on: ${{ matrix.os }}
@@ -39,6 +46,8 @@ jobs:
version: ${{ matrix.julia_version }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-runtest@v1
+ with:
+ coverage: ${{ matrix.code_coverage }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:to add a single configuration with code coverage disabled (maybe doubling the number of CI jobs is a bit too much). |
|
I considered just using
|
|
I'm still confused by how |
|
It would be set in |
|
Yeah, but what are these certain jobs? |
|
I think only a single CI run with code coverage is necessary, no? So I think one of these two alternatives would be best:
The second option seems like the best because it seems very comprehensive, but it'd also shorten the total run time because testing with |
This approach isolates us from possible changes in the `GenericMemory` design while leaving open the possibility of supporting other underlying storage types in the future. Fixes #33
|
Wasn't able to set up local testing of Github actions properly, hoping this passes. NB: Although this PR allows constructing |
|
it does support setindex!, but only actual calls to setindex! since you also need to pass the type of atomic. we don't yet have a nice bracket syntax for that |
|
after JuliaLang/julia#54707 you could write |
|
Sadly your PR won't land in v1.11 as far as I understand, so I suppose we should merge this PR as it is. After I check that all tests are still passing for nightly Julia, I guess. |
|
No, it will not, but I'm thinking of forking this into functionality into a tiny package, that would allow this on 1.11 |
|
@nsajko anything else to do on this PR? |
|
@nsajko I'm inclined to merge this PR in a couple of days, if you don't have plans to make further changes. |
This approach isolates us from possible changes in the
GenericMemorydesign while leaving open the possibility of supporting other underlying storage types in the future.Fixes #33