Use allocation proposal in mergesort: unsafe make replaced with safe allocScratch #43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and test lh-array-sort in linear mode | |
| # See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. | |
| concurrency: | |
| group: ${{ github.ref }}-${{ github.workflow }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| paths-ignore: | |
| - "**/README.md" | |
| branches: | |
| - main | |
| pull_request: | |
| paths-ignore: | |
| - "**/README.md" | |
| workflow_dispatch: | |
| env: | |
| CABAL_DIR: '/cabal-dir' | |
| jobs: | |
| test-mutable-arrays: | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/ulysses4ever/lh-array-sort | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # See the following link for a breakdown of the following step | |
| # https://github.com/haskell/actions/issues/7#issuecomment-745697160 | |
| - uses: actions/cache@v4 | |
| with: | |
| # validate.sh uses a special build dir | |
| path: | | |
| ${{ steps.setup-haskell.outputs.cabal-store }} | |
| dist-* | |
| key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} | |
| restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- | |
| - name: Configure | |
| run: cabal configure --enable-tests -f-liquid-checks | |
| - name: Build in linear mode with mutable arrays | |
| run: cabal build lh-array-sort -fmutable-arrays | |
| - name: Run tests in linear mode with mutable arrays | |
| run: cabal test -fmutable-arrays | |
| test-prim-mutable-arrays: | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/ulysses4ever/lh-array-sort | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ steps.setup-haskell.outputs.cabal-store }} | |
| dist-* | |
| key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} | |
| restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- | |
| - name: Configure | |
| run: cabal configure --enable-tests -f-liquid-checks | |
| - name: Build in linear mode with primitive mutable arrays | |
| run: cabal build lh-array-sort -fprim-mutable-arrays | |
| - name: Run tests in linear mode with primitive mutable arrays | |
| run: cabal test -fprim-mutable-arrays | |
| test-pure-arrays: | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/ulysses4ever/lh-array-sort | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ steps.setup-haskell.outputs.cabal-store }} | |
| dist-* | |
| key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} | |
| restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- | |
| - name: Configure | |
| run: cabal configure --enable-tests -f-liquid-checks | |
| - name: Build in linear mode with pure arrays | |
| run: cabal build lh-array-sort | |
| - name: Run tests in linear mode with pure arrays | |
| run: cabal test | |
| #optional --flag=verbose-tests for printing additional debug information when running tests | |
| run-benchrunner: | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/ulysses4ever/lh-array-sort | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ steps.setup-haskell.outputs.cabal-store }} | |
| dist-* | |
| key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} | |
| restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- | |
| - name: Configure | |
| run: cabal configure -f-liquid-checks -fmutable-arrays # (benchrunner must use mutable arrays) | |
| - name: Make sure benchrunner builds and runs | |
| run: | | |
| cabal build benchrunner | |
| cabal run benchrunner -- 5 Insertionsort Seq 1000 | |
| cabal run benchrunner -- 5 Quicksort Seq 1000 | |
| cabal run benchrunner -- 5 Mergesort Seq 1000 | |
| cabal run benchrunner -- 5 Mergesort Par 1000 +RTS -N1 | |
| cabal run benchrunner -- 5 Mergesort Par 1000 +RTS -N2 | |
| cabal run benchrunner -- 5 "VectorSort Insertionsort" Seq 1000 | |
| cabal run benchrunner -- 5 "VectorSort Mergesort" Seq 1000 | |
| cabal run benchrunner -- 5 "VectorSort Quicksort" Seq 1000 | |
| cabal run benchrunner -- 5 "CSort Insertionsort" Seq 1000 | |
| cabal run benchrunner -- 5 "CSort Mergesort" Seq 1000 | |
| cabal run benchrunner -- 5 "CSort Quicksort" Seq 1000 |