Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proving draft #347

Draft
wants to merge 76 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
3d5bec3
Checkpoint.
fchirica Feb 23, 2023
5c47b24
Add cmake modules.
fchirica Feb 23, 2023
9000c65
Fix cache.
fchirica Feb 27, 2023
1515223
Keep backward compatibility.
fchirica Feb 27, 2023
888042f
Add numa.
fchirica Feb 27, 2023
c5bbe24
Numa.
fchirica Feb 27, 2023
b9728ff
Try to fix test.
fchirica Feb 27, 2023
a93cb7c
Try libnuma.
fchirica Feb 28, 2023
6de5152
typo.
fchirica Feb 28, 2023
2901538
Try install from source.
fchirica Feb 28, 2023
fe9e991
curl.
fchirica Feb 28, 2023
561e5b5
Libnuma.
fchirica Feb 28, 2023
14cc88a
Build.
fchirica Feb 28, 2023
093f00c
Numa.
fchirica Feb 28, 2023
3cd25c8
Try with yum.
fchirica Feb 28, 2023
f23424a
Remove bladebit.
fchirica Mar 1, 2023
9ce5f86
Fix CI.
fchirica Mar 2, 2023
863bc32
Fix version.
fchirica Mar 2, 2023
f0b525a
Tag.
fchirica Mar 2, 2023
ac59d6f
Tag
fchirica Mar 2, 2023
188b1a7
tag.
fchirica Mar 2, 2023
704b2e6
Tag.
fchirica Mar 3, 2023
054760c
Update CMakeLists.txt
fchirica Mar 3, 2023
ed55f31
Update build-wheels.yml
fchirica Mar 3, 2023
5743546
Update build-wheels.yml
fchirica Mar 3, 2023
3b92f96
Update build-wheels.yml
fchirica Mar 3, 2023
4d76621
Update CMakeLists.txt
fchirica Mar 3, 2023
f200d67
Update CMakeLists.txt
fchirica Mar 3, 2023
7e67267
Update CMakeLists.txt
fchirica Mar 3, 2023
c6633ed
Update CMakeLists.txt
fchirica Mar 3, 2023
7b85620
Update CMakeLists.txt
fchirica Mar 3, 2023
e8a3648
Update CMakeLists.txt
fchirica Mar 3, 2023
9228750
Update CMakeLists.txt
fchirica Mar 3, 2023
e5921cc
Update CMakeLists.txt
fchirica Mar 3, 2023
e6adab4
Update CMakeLists.txt
fchirica Mar 6, 2023
f010035
Fixes.
fchirica Mar 6, 2023
a0f0453
Update CMakeLists.txt
fchirica Mar 6, 2023
d976e7c
First attempt qualities.
fchirica Mar 6, 2023
518cc8f
Update prover_disk.hpp
fchirica Mar 6, 2023
3a948e2
Update prover_disk.hpp
fchirica Mar 6, 2023
12c8bc0
Update build-wheels.yml
fchirica Mar 7, 2023
e4b7fa7
Initial commit decompresser queue.
fchirica Mar 8, 2023
6b37ab7
Typo.
fchirica Mar 8, 2023
8dd5857
Compile error.
fchirica Mar 8, 2023
cd46bee
Compile error.
fchirica Mar 8, 2023
2b73630
Fix bug.
fchirica Mar 8, 2023
66eb3cd
Updating CI for prerelease
wallentx Mar 9, 2023
c1971af
Disable on setjobenv on ARM
wallentx Mar 9, 2023
52bbdef
Change conditional on setjobenv
wallentx Mar 9, 2023
f1d6a7c
Change setjobenv target
wallentx Mar 9, 2023
2d35cf9
Add pybind for context queue.
fchirica Mar 9, 2023
a2ddeed
Updating publish conditional
wallentx Mar 9, 2023
9488fdb
setting matrix to continue
wallentx Mar 9, 2023
e28eefb
Adding job env to publish
wallentx Mar 9, 2023
089734f
Update CMakeLists.txt
fchirica Mar 10, 2023
d9e4159
Update CMakeLists.txt
fchirica Mar 10, 2023
114f6ba
Fixes race condition on prover_disk
harold-b Mar 11, 2023
7a1ad92
Simplify code.
fchirica Mar 11, 2023
d6c0165
Merge pull request #349 from Chia-Network/c-proving-queue-fixes
fchirica Mar 11, 2023
997acc7
Throw GRResult_NoProof separately.
fchirica Mar 13, 2023
5fc8cea
Updating CI to use setjobenv
wallentx Mar 13, 2023
79b2bdf
Adding explicit CI=1 to cibuildwheel
wallentx Mar 14, 2023
7ed2d91
Get compression level.
fchirica Mar 14, 2023
028db49
Merge branch 'main' into fc.proving
fchirica Mar 14, 2023
945aeb4
First attempt new API.
fchirica Mar 14, 2023
a64bef5
Fix code.
fchirica Mar 14, 2023
994b424
bumping bladebit commit hash
wallentx Mar 14, 2023
761e6fa
Update CMakeLists.txt
fchirica Mar 20, 2023
ea0564d
Fix Windows support.
AmineKhaldi Mar 21, 2023
480ed8b
Merge pull request #350 from AmineKhaldi/fc.proving_amine
fchirica Mar 21, 2023
efe213c
switch back action to main
wallentx Mar 22, 2023
83b041f
switch back action to main
wallentx Mar 22, 2023
965ea16
No explicit initialization for GR context queue
harold-b Apr 20, 2023
480495d
Prep for C9.
fchirica Apr 20, 2023
ad6dfd7
Update CMakeLists.txt
fchirica Apr 25, 2023
eae0c42
Update CMakeLists.txt
fchirica Apr 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 37 additions & 15 deletions .github/workflows/build-test-cplusplus.yml
Expand Up @@ -14,16 +14,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: cmake, RunTests, and valgrind on ubuntu-20.04
run: |
sudo apt update
sudo apt-get install valgrind -y
sudo apt-get install valgrind libnuma-dev -y
mkdir build
cd build
cmake ../
cmake --build . -- -j 6
ctest -j 6 --output-on-failure
valgrind --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all ctest -j 6 --output-on-failure
cmake --build . -- -j "$(nproc)"
ctest -j "$(nproc)" --output-on-failure
valgrind --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all ctest -j "$(nproc)" --output-on-failure

asan:
name: ASAN ubuntu
Expand All @@ -32,8 +37,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: cmake, RunTests with address- and undefined sanitizer on Ubuntu
run: |
sudo apt-get install libnuma-dev -y
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
Expand All @@ -42,7 +53,7 @@ jobs:
mkdir build-asan
cd build-asan
cmake -DCMAKE_BUILD_TYPE=ASAN ../
cmake --build . -- -j 6
cmake --build . -- -j "$(nproc)"
swapon -s
./RunTests

Expand All @@ -53,25 +64,36 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: cmake, RunTests with thread sanitizer on Ubuntu
run: |
sudo apt-get install libnuma-dev -y
mkdir build-tsan
cd build-tsan
cmake -DCMAKE_BUILD_TYPE=TSAN ../
cmake --build . -- -j 6
cmake --build . -- -j "$(nproc)"
TSAN_OPTIONS="memory_limit_mb=6000" ./RunTests

windows:
name: Windows Latest
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: cmake, RunTests with Windows
run: |
mkdir build-win
cd build-win
cmake ..
cmake --build . --config Release -j 6
ctest -C Release -j 6
- name: cmake, RunTests with Windows
run: |
mkdir build-win
cd build-win
cmake ..
cmake --build . --config Release -j "$(nproc)"
ctest -C Release -j "$(nproc)"
22 changes: 18 additions & 4 deletions .github/workflows/build-wheels.yml
Expand Up @@ -4,8 +4,8 @@ on:
push:
branches:
- main
tags:
- '**'
release:
types: [published]
pull_request:
branches:
- '**'
Expand All @@ -19,6 +19,7 @@ jobs:
build-wheels:
name: Wheel - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -112,6 +113,12 @@ jobs:
with:
fetch-depth: 0

- name: Set Env
if: env.RUNNER_ARCH != 'ARM64'
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}
Expand All @@ -122,6 +129,7 @@ jobs:

- name: Build and test
env:
CI: 1
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD_VERBOSITY_MACOS: 0
CIBW_BUILD_VERBOSITY_LINUX: 0
Expand All @@ -138,6 +146,7 @@ jobs:
&& which cmake
&& cmake --version
&& uname -a
&& yum install -y numactl-devel glibc-devel epel-release
CIBW_BEFORE_BUILD_LINUX: >
python -m pip install --upgrade pip
CIBW_ARCHS_MACOS: ${{ matrix.os.cibw-archs-macos[matrix.arch.matrix] }}
Expand Down Expand Up @@ -274,6 +283,11 @@ jobs:
with:
fetch-depth: 0

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}
Expand All @@ -298,15 +312,15 @@ jobs:
run: pip install twine

- name: Publish distribution to PyPI
if: startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET
if: env.RELEASE == 'true' && steps.check_secrets.outputs.HAS_SECRET
env:
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'

- name: Publish distribution to Test PyPI
if: steps.check_secrets.outputs.HAS_SECRET
if: env.PRE_RELEASE == 'true' && steps.check_secrets.outputs.HAS_SECRET
env:
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
TWINE_USERNAME: __token__
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/plot-k27-no-bitfield.yaml
Expand Up @@ -26,10 +26,11 @@ jobs:

- name: cmake, Plot k=27
run: |
sudo apt-get install libnuma-dev -y
mkdir build
cd build
cmake ../
cmake --build . -- -j 6
cmake --build . -- -j $(nproc)
mkdir plots
mkdir plots/temp
mkdir plots/final
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/plot-k27.yaml
Expand Up @@ -26,10 +26,11 @@ jobs:

- name: cmake, Plot k=27
run: |
sudo apt-get install libnuma-dev -y
mkdir build
cd build
cmake ../
cmake --build . -- -j 6
cmake --build . -- -j $(nproc)
mkdir plots
mkdir plots/temp
mkdir plots/final
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -25,3 +25,4 @@ build
.mypy_cache
*.whl
venv
build-tsan
39 changes: 25 additions & 14 deletions CMakeLists.txt
Expand Up @@ -34,6 +34,15 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(cxxopts)

FetchContent_Declare(
bladebit
GIT_REPOSITORY https://github.com/Chia-Network/bladebit.git
GIT_TAG 73b099185f0c473c4a4bb7ae7317adaa43e509de
)
set(BLADEBIT_ENABLE_TESTS "off" CACHE STRING "")
FetchContent_MakeAvailable(bladebit)


FetchContent_Declare(
gulrak
GIT_REPOSITORY https://github.com/gulrak/filesystem.git
Expand All @@ -57,6 +66,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../lib/FiniteStateEntropy/lib
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/test
${bladebit_SOURCE_DIR}/src
)

add_library(fse ${FSE_FILES})
Expand Down Expand Up @@ -165,7 +175,8 @@ target_link_libraries(RunTests
PRIVATE
fse
Threads::Threads
Catch2::Catch2
Catch2::Catch2WithMain
lib_bladebit
)

find_package(Threads REQUIRED)
Expand All @@ -175,26 +186,26 @@ target_include_directories(uint128 PUBLIC uint128_t)

target_compile_features(fse PUBLIC cxx_std_17)
target_compile_features(chiapos PUBLIC cxx_std_17)
target_compile_features(RunTests PUBLIC cxx_std_17)
# target_compile_features(RunTests PUBLIC cxx_std_17)

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(chiapos PRIVATE fse Threads::Threads)
target_link_libraries(ProofOfSpace fse Threads::Threads)
target_link_libraries(chiapos PRIVATE fse Threads::Threads lib_bladebit)
target_link_libraries(ProofOfSpace fse Threads::Threads lib_bladebit)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
target_link_libraries(chiapos PRIVATE fse Threads::Threads)
target_link_libraries(ProofOfSpace fse Threads::Threads)
target_link_libraries(chiapos PRIVATE fse Threads::Threads lib_bladebit)
target_link_libraries(ProofOfSpace fse Threads::Threads lib_bladebit)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(chiapos PRIVATE fse Threads::Threads)
target_link_libraries(ProofOfSpace fse Threads::Threads)
target_link_libraries(chiapos PRIVATE fse Threads::Threads lib_bladebit)
target_link_libraries(ProofOfSpace fse Threads::Threads lib_bladebit)
elseif (MSVC)
target_link_libraries(chiapos PRIVATE fse Threads::Threads uint128)
target_link_libraries(ProofOfSpace fse Threads::Threads uint128)
target_link_libraries(chiapos PRIVATE fse Threads::Threads uint128 lib_bladebit)
target_link_libraries(ProofOfSpace fse Threads::Threads uint128 lib_bladebit)
target_link_libraries(RunTests PRIVATE uint128)
else()
target_link_libraries(chiapos PRIVATE fse stdc++fs Threads::Threads)
target_link_libraries(ProofOfSpace fse stdc++fs Threads::Threads)
target_link_libraries(chiapos PRIVATE fse stdc++fs Threads::Threads lib_bladebit)
target_link_libraries(ProofOfSpace fse stdc++fs Threads::Threads lib_bladebit)
target_link_libraries(RunTests PRIVATE stdc++fs)
endif()

enable_testing()
add_test(NAME RunTests COMMAND RunTests)
#enable_testing()
#add_test(NAME RunTests COMMAND RunTests)
5 changes: 5 additions & 0 deletions python-bindings/chiapos.cpp
Expand Up @@ -105,6 +105,7 @@ PYBIND11_MODULE(chiapos, m)
return py::bytes(reinterpret_cast<const char*>(id.data()), id.size());
})
.def("get_size", [](DiskProver &dp) { return dp.GetSize(); })
.def("get_compresion_level", [](DiskProver &dp) { return dp.GetCompressionLevel(); })
.def("get_filename", [](DiskProver &dp) { return dp.GetFilename(); })
.def(
"get_qualities_for_challenge",
Expand Down Expand Up @@ -179,6 +180,10 @@ PYBIND11_MODULE(chiapos, m)
delete[] quality_buf;
return stdx::optional<py::bytes>(quality_py);
});

py::class_<ContextQueue>(m, "ContextQueue")
.def("init", &ContextQueue::init);
m.attr("decompresser_context_queue") = &decompresser_context_queue;
}

#endif // PYTHON_BINDINGS_PYTHON_BINDINGS_HPP_