From 69310c3cf3d291a2eef5144c2a3a0a01cacd5188 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Sat, 23 Aug 2025 13:37:01 -0400 Subject: [PATCH] Refer to style.md more in design.md --- design.md | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/design.md b/design.md index ea5f390..949e0b9 100644 --- a/design.md +++ b/design.md @@ -32,7 +32,7 @@ WeaselDB is a high-performance write-side database component designed for system ### Build System -Use CMake with C++20 and **always use ninja** (preferred over make): +Use CMake with C++20 and **always use ninja** (see [style.md](style.md) for build details): ```bash mkdir -p build && cd build @@ -271,12 +271,7 @@ This write-side component is designed to integrate with: ### Code Style & Conventions -- **C++ Style**: Modern C++20 with RAII and move semantics -- **Memory Management**: Prefer arena allocation over standard allocators -- **String Handling**: Use `std::string_view` for zero-copy operations -- **Error Handling**: Return error codes or use exceptions appropriately -- **Naming**: snake_case for variables/functions, PascalCase for classes -- **Performance**: Always consider allocation patterns and cache locality +See [style.md](style.md) for comprehensive C++ coding standards and conventions. ### Critical Implementation Rules @@ -327,18 +322,8 @@ This write-side component is designed to integrate with: - **Configuration**: All configuration is TOML-based using `config.toml` (see `config.md`) - **Testing Strategy**: Run unit tests, benchmarks, and debug tools before submitting changes -- **Test Design**: Prefer testing through public interfaces rather than implementation details (see `style.md` for detailed testing guidelines) -- **Build System**: CMake generates gperf hash tables at build time; always use ninja -- **Test Synchronization**: - - **ABSOLUTELY NEVER use sleep(), std::this_thread::sleep_for(), or any timeout-based waiting in tests** - - **NEVER use condition_variable.wait_for() or other timeout variants** - - Use deterministic synchronization only: - - **Blocking I/O** (blocking read/write calls that naturally wait) - - **condition_variable.wait()** with no timeout (waits indefinitely until condition is met) - - **std::latch, std::barrier, futures/promises** for coordination - - **RAII guards and resource management** for cleanup - - Tests should either pass (correct) or hang forever (indicates real bug to investigate) - - No timeouts, no flaky behavior, no false positives/negatives +- **Build System**: CMake generates gperf hash tables at build time +- **Testing Guidelines**: See [style.md](style.md) for comprehensive testing standards including synchronization rules --- @@ -546,7 +531,4 @@ ParseResult parse_commit_request(const char* json, CommitRequest& out); ### Build Notes -- **Always use ninja** - faster and more reliable than make -- Build from project root: `mkdir -p build && cd build && cmake .. -G Ninja && ninja` -- For specific targets: `ninja ` (e.g., `ninja load_tester`) -- Always build with `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` \ No newline at end of file +See [style.md](style.md) for comprehensive build configuration and CMake integration details. \ No newline at end of file