cardal 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. cardal-0.0.1/.github/workflows/ci.yml +82 -0
  2. cardal-0.0.1/.gitignore +72 -0
  3. cardal-0.0.1/CHANGELOG.md +17 -0
  4. cardal-0.0.1/CITATION.cff +27 -0
  5. cardal-0.0.1/CMakeLists.txt +206 -0
  6. cardal-0.0.1/LICENSE +201 -0
  7. cardal-0.0.1/NOTICE +5 -0
  8. cardal-0.0.1/PKG-INFO +215 -0
  9. cardal-0.0.1/README.md +187 -0
  10. cardal-0.0.1/include/cardal.h +264 -0
  11. cardal-0.0.1/include/sdp_types.h +190 -0
  12. cardal-0.0.1/internal/batched_cone_ops.h +45 -0
  13. cardal-0.0.1/internal/cli_common.h +40 -0
  14. cardal-0.0.1/internal/distribution_solver.h +18 -0
  15. cardal-0.0.1/internal/distribution_utils.h +62 -0
  16. cardal-0.0.1/internal/generator.h +19 -0
  17. cardal-0.0.1/internal/inner_solvers.cuh +264 -0
  18. cardal-0.0.1/internal/internal_types.h +313 -0
  19. cardal-0.0.1/internal/npz_reader.h +47 -0
  20. cardal-0.0.1/internal/outer_loop.cuh +464 -0
  21. cardal-0.0.1/internal/parser.h +30 -0
  22. cardal-0.0.1/internal/preconditioner.h +20 -0
  23. cardal-0.0.1/internal/rank_lift.h +35 -0
  24. cardal-0.0.1/internal/sdp_op.h +98 -0
  25. cardal-0.0.1/internal/solver.h +18 -0
  26. cardal-0.0.1/internal/solver_core_op.cuh +1595 -0
  27. cardal-0.0.1/internal/solver_state.h +34 -0
  28. cardal-0.0.1/internal/utils.h +148 -0
  29. cardal-0.0.1/pyproject.toml +73 -0
  30. cardal-0.0.1/python/README.md +313 -0
  31. cardal-0.0.1/python/cardal/__init__.py +42 -0
  32. cardal-0.0.1/python/cardal/enums.py +32 -0
  33. cardal-0.0.1/python/cardal/model.py +424 -0
  34. cardal-0.0.1/python/cardal/result.py +141 -0
  35. cardal-0.0.1/python/tests/test_build_problem.py +145 -0
  36. cardal-0.0.1/python/tests/test_smoke.py +116 -0
  37. cardal-0.0.1/python_bindings/CMakeLists.txt +59 -0
  38. cardal-0.0.1/python_bindings/_core.cpp +507 -0
  39. cardal-0.0.1/qubo/qubo.c +894 -0
  40. cardal-0.0.1/qubo/qubo.h +78 -0
  41. cardal-0.0.1/qubo/qubo_cli.c +289 -0
  42. cardal-0.0.1/qubo/qubo_io.c +632 -0
  43. cardal-0.0.1/qubo/qubo_io.h +24 -0
  44. cardal-0.0.1/qubo/qubo_round.cu +585 -0
  45. cardal-0.0.1/qubo/qubo_runner.c +275 -0
  46. cardal-0.0.1/src/batched_cone_ops.cu +300 -0
  47. cardal-0.0.1/src/cardal_c_api.c +394 -0
  48. cardal-0.0.1/src/cli.c +479 -0
  49. cardal-0.0.1/src/cli_common.c +236 -0
  50. cardal-0.0.1/src/distribution_solver.cu +394 -0
  51. cardal-0.0.1/src/distribution_utils.cu +1288 -0
  52. cardal-0.0.1/src/mat_parser.c +785 -0
  53. cardal-0.0.1/src/maxcut_generator.c +126 -0
  54. cardal-0.0.1/src/npz_reader.c +435 -0
  55. cardal-0.0.1/src/parser.c +154 -0
  56. cardal-0.0.1/src/pdsdp_parser.c +338 -0
  57. cardal-0.0.1/src/precondition.c +664 -0
  58. cardal-0.0.1/src/quantum_order_generator.c +156 -0
  59. cardal-0.0.1/src/rank_lift.cu +1405 -0
  60. cardal-0.0.1/src/sdp_op.cu +961 -0
  61. cardal-0.0.1/src/sdpa_parser.c +281 -0
  62. cardal-0.0.1/src/snl_generator.c +245 -0
  63. cardal-0.0.1/src/solver.cu +84 -0
  64. cardal-0.0.1/src/solver_state.cu +1554 -0
  65. cardal-0.0.1/src/utils.cu +847 -0
@@ -0,0 +1,82 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ source-hygiene:
10
+ name: Source hygiene
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.11"
18
+
19
+ - name: Validate project metadata
20
+ run: |
21
+ python - <<'PY'
22
+ import pathlib
23
+ import tomllib
24
+
25
+ root = pathlib.Path(".")
26
+ data = tomllib.loads(root.joinpath("pyproject.toml").read_text())
27
+ project = data["project"]
28
+ assert project["name"] == "cardal"
29
+ assert project["license"] == "Apache-2.0"
30
+ assert root.joinpath("LICENSE").exists()
31
+ assert root.joinpath("CITATION.cff").exists()
32
+ for key in ("Homepage", "Repository", "Issues", "Documentation"):
33
+ assert key in project["urls"], key
34
+ PY
35
+
36
+ - name: Compile Python sources
37
+ run: python -m compileall -q python/cardal
38
+
39
+ - name: Check for stale private paths
40
+ run: |
41
+ python - <<'PY'
42
+ import pathlib
43
+ import re
44
+ import sys
45
+
46
+ pattern = re.compile(r"/home/sevan|/data0|/data1|loralm")
47
+ skipped_dirs = {".git", "build", ".pytest_cache", "__pycache__"}
48
+ hits = []
49
+ for path in pathlib.Path(".").rglob("*"):
50
+ if not path.is_file():
51
+ continue
52
+ if any(part in skipped_dirs for part in path.parts):
53
+ continue
54
+ if path == pathlib.Path(".github/workflows/ci.yml"):
55
+ continue
56
+ try:
57
+ text = path.read_text(errors="ignore")
58
+ except Exception:
59
+ continue
60
+ for lineno, line in enumerate(text.splitlines(), 1):
61
+ if pattern.search(line):
62
+ hits.append(f"{path}:{lineno}: {line}")
63
+ if hits:
64
+ print("\n".join(hits))
65
+ sys.exit(1)
66
+ PY
67
+
68
+ cuda-smoke:
69
+ name: CUDA smoke build
70
+ if: github.event_name == 'workflow_dispatch'
71
+ runs-on: [self-hosted, linux, x64, cuda]
72
+ steps:
73
+ - uses: actions/checkout@v4
74
+
75
+ - name: Configure single-GPU build
76
+ run: cmake -S . -B build -DENABLE_MPI=OFF -DCARDAL_BUILD_QUBO=OFF
77
+
78
+ - name: Build
79
+ run: cmake --build build -j
80
+
81
+ - name: Run generated MaxCut smoke test
82
+ run: ./build/cardal -g maxcut,100,1e-2 -T 30 -v 1
@@ -0,0 +1,72 @@
1
+ # Prerequisites
2
+ *.d
3
+
4
+ # Object files
5
+ *.o
6
+ *.ko
7
+ *.obj
8
+ *.elf
9
+
10
+ # Linker output
11
+ *.ilk
12
+ *.map
13
+ *.exp
14
+
15
+ # Precompiled Headers
16
+ *.gch
17
+ *.pch
18
+
19
+ # Libraries
20
+ *.lib
21
+ *.a
22
+ *.la
23
+ *.lo
24
+
25
+ # Shared objects (inc. Windows DLLs)
26
+ *.dll
27
+ *.so
28
+ *.so.*
29
+ *.dylib
30
+
31
+ # Executables
32
+ *.exe
33
+ *.out
34
+ *.app
35
+ *.i*86
36
+ *.x86_64
37
+ *.hex
38
+
39
+ # Debug files
40
+ *.dSYM/
41
+ *.su
42
+ *.idb
43
+ *.pdb
44
+ Testing/*
45
+
46
+ # Kernel Module Compile Results
47
+ *.mod*
48
+ *.cmd
49
+ .tmp_versions/
50
+ modules.order
51
+ Module.symvers
52
+ Mkfile.old
53
+ dkms.conf
54
+
55
+ # debug information files
56
+ *.dwo
57
+
58
+ # ignored files
59
+ build/*
60
+ /dist/
61
+ test/*
62
+ /.vscode
63
+ /.venv
64
+ /_b
65
+ *.whl
66
+ *.pyc
67
+ known_bugs/*
68
+ bench_out/*
69
+ docs/*
70
+ logs/*
71
+ scripts/*
72
+ __pycache__/
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ All notable changes to CARDAL will be documented in this file.
4
+
5
+ The format is inspired by Keep a Changelog, and this project uses semantic
6
+ versioning once public releases begin.
7
+
8
+ ## [Unreleased]
9
+
10
+ - Replaced the shared feasibility tolerance with independent primal and dual
11
+ residual tolerances across the CLI, C API, and Python API.
12
+ - Prepared repository metadata, CI, and community documents for public release.
13
+ - Added Apache-2.0 source headers across tracked source files.
14
+
15
+ ## [0.0.1] - 2026-07-14
16
+
17
+ - Initial public source snapshot of CARDAL.
@@ -0,0 +1,27 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use CARDAL in academic work, please cite the companion paper below."
3
+ title: "CARDAL: A Curvature-Aware Rank-Adaptive Distributed Augmented-Lagrangian Solver for Large-Scale SDPs"
4
+ authors:
5
+ - family-names: Li
6
+ given-names: Hongpei
7
+ email: ishongpeili@gmail.com
8
+ version: 0.0.1
9
+ date-released: 2026-07-14
10
+ license: Apache-2.0
11
+ repository-code: "https://github.com/Lhongpei/CARDAL"
12
+ url: "https://github.com/Lhongpei/CARDAL"
13
+ preferred-citation:
14
+ type: article
15
+ title: "A Curvature-Aware Rank-Adaptive Distributed Augmented-Lagrangian Solver for Large-Scale SDPs"
16
+ authors:
17
+ - family-names: Li
18
+ given-names: Hongpei
19
+ - family-names: Liu
20
+ given-names: Huikang
21
+ - family-names: Ge
22
+ given-names: Dongdong
23
+ - family-names: Ye
24
+ given-names: Yinyu
25
+ year: 2026
26
+ doi: "10.48550/arXiv.2607.17933"
27
+ url: "https://arxiv.org/abs/2607.17933"
@@ -0,0 +1,206 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright 2026 Hongpei Li
3
+
4
+ cmake_minimum_required(VERSION 3.20)
5
+ option(ENABLE_MPI "Enable distributed computing with MPI" ON)
6
+ option(CARDAL_BUILD_PYTHON "Build the CARDAL pybind11 module" OFF)
7
+ option(CARDAL_BUILD_CLI "Build the cardal CLI" ON)
8
+ option(CARDAL_BUILD_QUBO "Build the QUBO auxiliary library + CLI" ON)
9
+
10
+ project(cardal VERSION 0.0.1 LANGUAGES C CXX CUDA)
11
+
12
+ set(CMAKE_CXX_STANDARD 17)
13
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
14
+ set(CMAKE_CUDA_STANDARD 17)
15
+ set(CMAKE_CUDA_STANDARD_REQUIRED ON)
16
+
17
+ if(NOT CMAKE_BUILD_TYPE)
18
+ set(CMAKE_BUILD_TYPE Release)
19
+ endif()
20
+
21
+ if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
22
+ set(CMAKE_CUDA_ARCHITECTURES 70 75 80 86 89 90)
23
+ endif()
24
+
25
+ find_package(CUDAToolkit REQUIRED)
26
+ find_package(ZLIB REQUIRED)
27
+
28
+ set(CUDA_LIBS
29
+ CUDA::cudart
30
+ CUDA::cublas
31
+ CUDA::cusparse
32
+ CUDA::curand
33
+ )
34
+
35
+ set(CORE_LINK_LIBS
36
+ ZLIB::ZLIB
37
+ )
38
+ option(ENABLE_MATIO "Enable .mat file parsing via libmatio" ON)
39
+
40
+ if(ENABLE_MATIO)
41
+ find_path(MATIO_INCLUDE_DIR NAMES matio.h)
42
+ find_library(MATIO_LIBRARY NAMES matio)
43
+
44
+ if(MATIO_INCLUDE_DIR AND MATIO_LIBRARY)
45
+ message(STATUS "Found system matio header: ${MATIO_INCLUDE_DIR}")
46
+ message(STATUS "Found system matio library: ${MATIO_LIBRARY}")
47
+ list(APPEND CORE_LINK_LIBS ${MATIO_LIBRARY})
48
+
49
+ set(MATIO_EXTRA_DEFS USE_MATIO)
50
+ set(MATIO_EXTRA_INCLUDES ${MATIO_INCLUDE_DIR})
51
+ else()
52
+ message(STATUS "System matio not found. Auto-downloading and building libmatio from source...")
53
+
54
+ include(FetchContent)
55
+ set(MATIO_SHARED OFF CACHE BOOL "Build static libmatio" FORCE)
56
+ set(MATIO_MAT73 OFF CACHE BOOL "Disable MAT73" FORCE)
57
+ set(MATIO_WITH_ZLIB ON CACHE BOOL "Enable ZLIB" FORCE)
58
+ set(MATIO_PIC ON CACHE BOOL "Enable PIC" FORCE)
59
+
60
+ FetchContent_Declare(
61
+ matio
62
+ GIT_REPOSITORY https://github.com/tbeu/matio.git
63
+ GIT_TAG v1.5.23
64
+ GIT_SHALLOW TRUE
65
+ GIT_SUBMODULES ""
66
+ GIT_SUBMODULES_RECURSE FALSE
67
+ )
68
+ FetchContent_MakeAvailable(matio)
69
+
70
+ list(APPEND CORE_LINK_LIBS matio)
71
+
72
+ set(MATIO_EXTRA_DEFS USE_MATIO)
73
+ set(MATIO_EXTRA_INCLUDES ${matio_SOURCE_DIR}/src ${matio_BINARY_DIR})
74
+ endif()
75
+ else()
76
+ message(STATUS "matio is DISABLED.")
77
+ endif()
78
+
79
+ if(ENABLE_MPI)
80
+ find_package(MPI REQUIRED)
81
+ message(STATUS "MPI is ENABLED")
82
+ list(APPEND CORE_LINK_LIBS MPI::MPI_C)
83
+
84
+ list(APPEND CORE_LINK_LIBS MPI::MPI_CXX)
85
+
86
+ find_library(NCCL_LIB NAMES nccl
87
+ PATHS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}
88
+ $ENV{NCCL_ROOT}/lib
89
+ /usr/local/cuda/lib64
90
+ /usr/lib/x86_64-linux-gnu)
91
+
92
+ if(NCCL_LIB)
93
+ message(STATUS "Found NCCL: ${NCCL_LIB}")
94
+ list(APPEND CORE_LINK_LIBS ${NCCL_LIB})
95
+ else()
96
+ message(WARNING "NCCL library not found explicitly, falling back to -lnccl")
97
+ list(APPEND CORE_LINK_LIBS nccl)
98
+ endif()
99
+ else()
100
+ message(STATUS "MPI is DISABLED (Single Node Mode)")
101
+ endif()
102
+
103
+ file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
104
+ "${CMAKE_CURRENT_SOURCE_DIR}/src/*.c"
105
+ "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cu"
106
+ )
107
+
108
+ list(FILTER SRC_FILES EXCLUDE REGEX "src/(main|cli)\\.c$")
109
+
110
+ # Distributed (MPI+NCCL) source files — exclude when MPI is off so the
111
+ # non-distributed build produces a lean, single-GPU-only library.
112
+ if(NOT ENABLE_MPI)
113
+ list(FILTER SRC_FILES EXCLUDE REGEX "src/distribution_(solver|utils)\\.cu$")
114
+ endif()
115
+
116
+ add_library(sdp_core STATIC ${SRC_FILES})
117
+
118
+ target_compile_definitions(sdp_core PRIVATE
119
+ CARDAL_VERSION="${PROJECT_VERSION}"
120
+ )
121
+
122
+ target_link_libraries(sdp_core
123
+ PRIVATE ${CUDA_LIBS}
124
+ PUBLIC ${CORE_LINK_LIBS}
125
+ )
126
+
127
+ target_include_directories(sdp_core PUBLIC
128
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
129
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/internal>
130
+ ${CUDAToolkit_INCLUDE_DIRS}
131
+ )
132
+
133
+ if(ENABLE_MPI)
134
+ target_compile_definitions(sdp_core PUBLIC USE_MPI)
135
+ endif()
136
+
137
+ if(MATIO_EXTRA_DEFS)
138
+ target_compile_definitions(sdp_core PUBLIC ${MATIO_EXTRA_DEFS})
139
+ endif()
140
+ if(MATIO_EXTRA_INCLUDES)
141
+ target_include_directories(sdp_core PUBLIC ${MATIO_EXTRA_INCLUDES})
142
+ endif()
143
+
144
+ target_compile_options(sdp_core PRIVATE
145
+ $<$<COMPILE_LANGUAGE:C,CXX>:-O3 -Wall -Wextra -fPIC>
146
+ $<$<COMPILE_LANGUAGE:CUDA>:-O3 -Xcompiler=-Wall,-Wextra,-fPIC>
147
+ )
148
+
149
+ set_target_properties(sdp_core PROPERTIES
150
+ CUDA_SEPARABLE_COMPILATION ON
151
+ CUDA_RESOLVE_DEVICE_SYMBOLS ON
152
+ )
153
+
154
+ file(GLOB_RECURSE QUBO_SRC_FILES CONFIGURE_DEPENDS
155
+ "${CMAKE_CURRENT_SOURCE_DIR}/qubo/*.c"
156
+ "${CMAKE_CURRENT_SOURCE_DIR}/qubo/*.cu"
157
+ )
158
+ list(FILTER QUBO_SRC_FILES EXCLUDE REGEX "qubo/qubo_cli\\.c$")
159
+
160
+ if(CARDAL_BUILD_QUBO AND QUBO_SRC_FILES)
161
+ add_library(sdp_qubo STATIC ${QUBO_SRC_FILES})
162
+ target_link_libraries(sdp_qubo
163
+ PUBLIC sdp_core
164
+ PRIVATE ${CUDA_LIBS}
165
+ )
166
+ target_include_directories(sdp_qubo PUBLIC
167
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/qubo>
168
+ )
169
+ target_compile_options(sdp_qubo PRIVATE
170
+ $<$<COMPILE_LANGUAGE:C,CXX>:-O3 -Wall -Wextra -fPIC>
171
+ $<$<COMPILE_LANGUAGE:CUDA>:-O3 -Xcompiler=-Wall,-Wextra,-fPIC>
172
+ )
173
+ set_target_properties(sdp_qubo PROPERTIES
174
+ CUDA_SEPARABLE_COMPILATION ON
175
+ CUDA_RESOLVE_DEVICE_SYMBOLS ON
176
+ )
177
+ endif()
178
+
179
+ if(CARDAL_BUILD_CLI AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/cli.c")
180
+ add_executable(cardal src/cli.c)
181
+ target_compile_definitions(cardal PRIVATE
182
+ CARDAL_VERSION="${PROJECT_VERSION}"
183
+ )
184
+ target_link_libraries(cardal PRIVATE sdp_core)
185
+ endif()
186
+
187
+ if(CARDAL_BUILD_QUBO AND TARGET sdp_qubo AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/qubo/qubo_cli.c")
188
+ add_executable(cardal_qubo qubo/qubo_cli.c)
189
+ target_link_libraries(cardal_qubo PRIVATE sdp_qubo)
190
+ endif()
191
+
192
+ if(CARDAL_BUILD_PYTHON)
193
+ add_subdirectory(python_bindings)
194
+ endif()
195
+
196
+ if(TARGET cardal)
197
+ install(TARGETS cardal RUNTIME DESTINATION bin)
198
+ endif()
199
+ if(TARGET cardal_qubo)
200
+ install(TARGETS cardal_qubo RUNTIME DESTINATION bin)
201
+ endif()
202
+ install(TARGETS sdp_core ARCHIVE DESTINATION lib)
203
+ if(TARGET sdp_qubo)
204
+ install(TARGETS sdp_qubo ARCHIVE DESTINATION lib)
205
+ endif()
206
+ install(DIRECTORY include/ DESTINATION include)
cardal-0.0.1/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may accept and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend,
172
+ and hold each Contributor harmless for any liability incurred by,
173
+ or claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Hongpei Li
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
200
+ implied. See the License for the specific language governing permissions
201
+ and limitations under the License.
cardal-0.0.1/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ CARDAL
2
+ Copyright 2026 Hongpei Li
3
+
4
+ This product is licensed under the Apache License, Version 2.0. See the
5
+ LICENSE file for details.