Skip to content

Commit 107591d

Browse files
committed
updates documentation for the library
1 parent 8171db2 commit 107591d

39 files changed

Lines changed: 2740 additions & 591 deletions

.github/ISSUE_TEMPLATE.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,41 @@
1-
# Description
1+
---
2+
name: Bug report
3+
about: Report a bug or unexpected behavior
4+
---
25

3-
A short human-readable description of the bug.
6+
## Description
47

5-
# Versions and Configuration
8+
A clear description of the bug and what you expected to happen instead.
69

7-
Contents of `/etc/os-release`:
10+
## Environment
811

9-
Output of `cmake -L <build_dir>`:
12+
**OS** (`cat /etc/os-release` or `uname -a`):
1013

11-
Output of `git log -n 1 --oneline`:
14+
**GPU** (`nvidia-smi -L`):
1215

13-
GPU and CUDA:
16+
**CUDA version** (`nvcc --version`):
1417

15-
Output of `nvidia-smi -L`:
18+
**Compiler** (`gcc --version` or `clang --version`):
1619

17-
Output of `nvcc --version` (or CUDA runtime version):
20+
**CMake version** (`cmake --version`):
1821

19-
Please include the version information for the following dependencies if installed.
22+
**FZGPUModules version / commit** (`git log -n 1 --oneline`):
2023

21-
+ compiler (either `gcc` or `clang`)
22-
+ cmake
23-
+ Doxygen
24+
**CMake configuration** (`cmake -L <build_dir>` or the preset and flags you used):
2425

25-
# Steps to Reproduce the Bug
26+
## Steps to Reproduce
2627

27-
Please provide both:
28+
1.
29+
2.
30+
3.
2831

29-
+ a high level description of how to reproduce the bug including expected vs actual behavior
30-
+ a short script or Dockerfile to reproduce the bug starting at installing FZGPUModules and its dependencies where possible
32+
**Expected behavior:**
3133

32-
# Additional Information [Optional]
34+
**Actual behavior:**
35+
36+
A minimal self-contained reproducer (C++ snippet, test name, or script) is very helpful.
37+
38+
## Additional Context
39+
40+
Logs, stack traces, sanitizer output, or anything else relevant. If you ran under
41+
AddressSanitizer or Compute Sanitizer, include that output here.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
8888
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
8989
endif()
9090

91-
option(BUILD_TESTING "Build tests" ON)
91+
option(BUILD_TESTING "Build tests" OFF)
9292
if(BUILD_TESTING)
9393
add_subdirectory(third_party/googletest EXCLUDE_FROM_ALL)
9494
enable_testing()

CONTRIBUTE.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Contributing to FZGPUModules
2+
3+
Thanks for your interest in improving FZGPUModules. Contributions of all kinds
4+
are welcome: bug reports, documentation, examples, tests, and code changes.
5+
6+
---
7+
8+
## Ways to contribute
9+
10+
- **Bug reports** — file an issue with environment details and a minimal reproducer
11+
- **Documentation** — fix typos, clarify confusing sections, add usage examples
12+
- **Tests** — add regression tests for existing behavior or cover edge cases
13+
- **New stages** — see [How to Add a Stage](docs/how_to_add_a_stage.md)
14+
- **Bug fixes and features** — open an issue to discuss first for non-trivial changes
15+
16+
---
17+
18+
## Build and test
19+
20+
```bash
21+
# Clone with submodules (googletest)
22+
git clone https://github.com/szcompressor/FZGPUModules.git
23+
cd FZGPUModules
24+
git submodule update --init --recursive
25+
26+
# Build (tests disabled by default; enable explicitly)
27+
cmake --preset release -DBUILD_TESTING=ON
28+
cmake --build build/release -j$(nproc)
29+
```
30+
31+
Run the test suite:
32+
33+
```bash
34+
ctest --preset default # all tests
35+
ctest --preset stages # stage unit tests only
36+
ctest --preset pipeline # pipeline integration tests only
37+
```
38+
39+
Run with sanitizers before submitting:
40+
41+
```bash
42+
cmake --preset asan
43+
cmake --build --preset asan -j$(nproc)
44+
LD_PRELOAD=$(gcc --print-file-name=libasan.so) \
45+
ASAN_OPTIONS=detect_leaks=0:abort_on_error=0:protect_shadow_gap=0 \
46+
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=0 \
47+
ctest --preset asan
48+
```
49+
50+
See [Building from Source](docs/building.md) for preset details and sanitizer flags.
51+
52+
---
53+
54+
## Code style and conventions
55+
56+
- **C++17**, CUDA 11.2+. Match the style of nearby files.
57+
- **No bare printf/cout/cerr** in library code — use `FZ_LOG(LEVEL, ...)` or `FZ_PRINT(...)`.
58+
- **No `cudaDeviceSynchronize()`** inside `Stage::execute()` — enqueue all work on the provided `stream`.
59+
- **Public API only in user-facing code** — include `fzgpumodules.h`; do not include `cuda_check.h` or internal headers in examples.
60+
- **`connect()` argument order**`pipeline.connect(downstream, upstream, "port")`.
61+
- **Lorenzo downstream port** — connect to `"codes"`, not `"output"`.
62+
- **Template instantiations** — many stages are templates with explicit instantiations (e.g., `RLEStage<uint16_t>`). Check the stage's documentation (e.g., `docs/stages/rle.md`) for available types before using a template stage. Adding a new type requires adding an `extern template` declaration in the header and instantiation in the `.cu` file.
63+
64+
---
65+
66+
## Changelog
67+
68+
For any code change (fix, feature, refactor, removal), add a one-line entry to
69+
`CHANGELOG.md` under the appropriate `[Unreleased]` subsection (`Added`, `Changed`,
70+
`Fixed`, or `Removed`) before finishing the change. Documentation-only edits do
71+
not need a changelog entry.
72+
73+
---
74+
75+
## Adding a new stage
76+
77+
Use the scaffold script and follow the step-by-step guide:
78+
79+
```bash
80+
scripts/new_stage.sh MyStageName <category> # category: predictors, quantizers, coders, shufflers, transforms, fused
81+
```
82+
83+
Full instructions: [docs/how_to_add_a_stage.md](docs/how_to_add_a_stage.md)
84+
85+
Key requirements for any new stage:
86+
- All required `Stage` virtual methods implemented
87+
- `StageType` enum value chosen (unique integer, never reuse or renumber existing values)
88+
- Registered in `StageFactory`, `config.cpp` (TOML), and root `CMakeLists.txt`
89+
- Tests: ForwardRoundTrip, ZeroInput, SerializeDeserialize, PipelineIntegration, SaveRestoreState
90+
91+
---
92+
93+
## Submitting a pull request
94+
95+
1. Fork and create a branch from `main`.
96+
2. Make your changes and confirm tests pass (including sanitizers for code changes).
97+
3. Add a `CHANGELOG.md` entry for code changes.
98+
4. Open a PR against `main` with a clear description and rationale.
99+
5. Link any relevant issues; include reproduction steps for bug fixes.
100+
6. Mention any build flags or environment details required to validate the change.
101+
102+
For non-trivial new features or API additions, open an issue first to discuss the
103+
approach before writing code — this avoids wasted effort if the design needs revision.
104+
105+
---
106+
107+
## API compatibility
108+
109+
Avoid breaking public API unless the change warrants a major version bump. See
110+
[API Reference — Stability and Versioning](docs/api_reference.md#api_stability) for the full policy and a
111+
per-PR checklist.

Doxyfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# Project identity
77
#---------------------------------------------------------------------------
88
PROJECT_NAME = "FZGPUModules"
9-
PROJECT_NUMBER = "1.0"
10-
PROJECT_BRIEF = "GPU-accelerated modular compression pipeline"
9+
PROJECT_NUMBER = "2.0"
10+
PROJECT_BRIEF = "GPU-accelerated modular compression pipelines"
1111
OUTPUT_DIRECTORY = docs/doxygen
1212

1313
#---------------------------------------------------------------------------
@@ -16,6 +16,13 @@ OUTPUT_DIRECTORY = docs/doxygen
1616
INPUT = include/ \
1717
modules/ \
1818
docs/mainpage.md \
19+
docs/cli.md \
20+
docs/building.md \
21+
docs/config_file.md \
22+
docs/fzm_format.md \
23+
docs/architecture.md \
24+
docs/api_reference.md \
25+
docs/how_to_add_a_stage.md \
1926
docs/stages/
2027
RECURSIVE = YES
2128
FILE_PATTERNS = *.h *.md

0 commit comments

Comments
 (0)