boost::int128 review starts today (July 22 - July 31)
Announced officially on the [Boost mailing list](https://lists.boost.org/archives/list/[email protected]/thread/GLZALH3WRHSICP6ZYOFDOPWUQTJUKOM5/)
**Introduction**
The formal review of Matt Borland's `boost::int128` for inclusion in the Boost libraries, starts today.
Int128 is a portable C++14 implementation of signed and unsigned 128-bit integers. It has no dependencies, is header-only, and can be consumed as a module in C++20. It serves as a practical solution to the partial (resp. absent) support of 128-bit integers by gcc/clang (resp. msvc), and as a lightweight alternative to heavier projects.
You can find the library and its documentation here:
\- [https://github.com/cppalliance/int128/tree/boost\_review](https://github.com/cppalliance/int128/tree/boost_review)
\- [https://develop.int128.cpp.al/overview.html](https://develop.int128.cpp.al/overview.html)
\- Compiler Explorer: [https://godbolt.org/z/5aM6K9b4r](https://godbolt.org/z/5aM6K9b4r)
Although possibly not faithful to Matt's implementation, this CE link will be handy if you are in a rush but want to play with the library.
Anyone is welcome to post a review and/or take part in subsequent discussions in the mailing list.
**Review guidelines**
Please provide feedback on the following general topics:
* What is your evaluation of the design?
* What is your evaluation of the implementation?
* What is your evaluation of the documentation?
* What is your evaluation of the potential usefulness of the library?
* Did you try to use the library? With which compiler(s)? Did you have any problems?
* How much effort did you put into your evaluation? A glance? A quick reading? In-depth study?
* Are you knowledgeable about the problem domain?
Ensure to explicitly include with your review: ACCEPT, REJECT, or CONDITIONAL ACCEPT (with acceptance conditions).
Thank you for your time making our OSS ecosystem better. Happy to start the discussions!
Arnaud Becheler (Review Manager)
https://redd.it/1v3duby
@r_cpp
Announced officially on the [Boost mailing list](https://lists.boost.org/archives/list/[email protected]/thread/GLZALH3WRHSICP6ZYOFDOPWUQTJUKOM5/)
**Introduction**
The formal review of Matt Borland's `boost::int128` for inclusion in the Boost libraries, starts today.
Int128 is a portable C++14 implementation of signed and unsigned 128-bit integers. It has no dependencies, is header-only, and can be consumed as a module in C++20. It serves as a practical solution to the partial (resp. absent) support of 128-bit integers by gcc/clang (resp. msvc), and as a lightweight alternative to heavier projects.
You can find the library and its documentation here:
\- [https://github.com/cppalliance/int128/tree/boost\_review](https://github.com/cppalliance/int128/tree/boost_review)
\- [https://develop.int128.cpp.al/overview.html](https://develop.int128.cpp.al/overview.html)
\- Compiler Explorer: [https://godbolt.org/z/5aM6K9b4r](https://godbolt.org/z/5aM6K9b4r)
Although possibly not faithful to Matt's implementation, this CE link will be handy if you are in a rush but want to play with the library.
Anyone is welcome to post a review and/or take part in subsequent discussions in the mailing list.
**Review guidelines**
Please provide feedback on the following general topics:
* What is your evaluation of the design?
* What is your evaluation of the implementation?
* What is your evaluation of the documentation?
* What is your evaluation of the potential usefulness of the library?
* Did you try to use the library? With which compiler(s)? Did you have any problems?
* How much effort did you put into your evaluation? A glance? A quick reading? In-depth study?
* Are you knowledgeable about the problem domain?
Ensure to explicitly include with your review: ACCEPT, REJECT, or CONDITIONAL ACCEPT (with acceptance conditions).
Thank you for your time making our OSS ecosystem better. Happy to start the discussions!
Arnaud Becheler (Review Manager)
https://redd.it/1v3duby
@r_cpp
I implemented Smart Pointers from scratch in C++ (UniquePtr, SharedPtr & WeakPtr)
I’ve been trying to spend more time building things from scratch instead of just reading about them.
My latest project was implementing UniquePtr, SharedPtr, and WeakPtr in C++ with reference counting.
It ended up being much more interesting than I expected. Small mistakes in reference counting quickly turned into bugs like memory leaks, double-free, and use-after-free, which made me appreciate the standard library implementation even more.
Current status:
UniquePtr
SharedPtr
WeakPtr
Reference counting
18/18 test cases passing
Repository:
https://github.com/574-jayeshSh/smart-pointer-library
I’d love to hear feedback from people who’ve implemented something similar or suggestions on what I should improve next.
https://redd.it/1v3m5k5
@r_cpp
I’ve been trying to spend more time building things from scratch instead of just reading about them.
My latest project was implementing UniquePtr, SharedPtr, and WeakPtr in C++ with reference counting.
It ended up being much more interesting than I expected. Small mistakes in reference counting quickly turned into bugs like memory leaks, double-free, and use-after-free, which made me appreciate the standard library implementation even more.
Current status:
UniquePtr
SharedPtr
WeakPtr
Reference counting
18/18 test cases passing
Repository:
https://github.com/574-jayeshSh/smart-pointer-library
I’d love to hear feedback from people who’ve implemented something similar or suggestions on what I should improve next.
https://redd.it/1v3m5k5
@r_cpp
GitHub
GitHub - 574-jayeshSh/smart-pointer-library
Contribute to 574-jayeshSh/smart-pointer-library development by creating an account on GitHub.
Pure Virtual C++ Videos Are Now Available
https://devblogs.microsoft.com/cppblog/pure-virtual-c-2026-is-a-wrap/
https://redd.it/1v3myfh
@r_cpp
https://devblogs.microsoft.com/cppblog/pure-virtual-c-2026-is-a-wrap/
https://redd.it/1v3myfh
@r_cpp
Microsoft News
Pure Virtual C++ 2026 Is a Wrap
Pure Virtual C++ 2026 is a wrap. Every featured and on-demand session is now available on YouTube — catch up on C++/Rust interop, AI-driven tooling, build performance, and more.
Project A backend-agnostic C++17 document intelligence pipeline with measurable OCR, layout and table stages
I have been working on an early-stage open-source document intelligence engine in C++17.
The goal is not to own every OCR or layout model. The core keeps typed pipeline boundaries and normalizes PDF text, OCR, layout blocks, tables, reading order, coordinates, confidence and provenance into a stable document model.
Current components include:
\- PDFium rendering and native text
\- PaddleOCR ONNX and optional Tesseract
\- RF-DETR DocLayNet and Paddle PP-DocLayoutV3
\- Table Transformer detection and structure recognition
\- JSON/Markdown/HTML output
\- small public regression datasets
\- an optional FastAPI/Redis Streams/persistent C++ Worker/React inspection platform
It is still an alpha. The current small benchmark subsets are regression checks, not production accuracy claims.
I am looking for contributors interested in C++ architecture, ONNX session reuse, OCR/CV evaluation, Redis Streams recovery, reading order, or Web-based bounding-box diagnostics.
Repository:
https://github.com/ChNanAn/technical-doc-parser
https://redd.it/1v41u7b
@r_cpp
I have been working on an early-stage open-source document intelligence engine in C++17.
The goal is not to own every OCR or layout model. The core keeps typed pipeline boundaries and normalizes PDF text, OCR, layout blocks, tables, reading order, coordinates, confidence and provenance into a stable document model.
Current components include:
\- PDFium rendering and native text
\- PaddleOCR ONNX and optional Tesseract
\- RF-DETR DocLayNet and Paddle PP-DocLayoutV3
\- Table Transformer detection and structure recognition
\- JSON/Markdown/HTML output
\- small public regression datasets
\- an optional FastAPI/Redis Streams/persistent C++ Worker/React inspection platform
It is still an alpha. The current small benchmark subsets are regression checks, not production accuracy claims.
I am looking for contributors interested in C++ architecture, ONNX session reuse, OCR/CV evaluation, Redis Streams recovery, reading order, or Web-based bounding-box diagnostics.
Repository:
https://github.com/ChNanAn/technical-doc-parser
https://redd.it/1v41u7b
@r_cpp
GitHub
GitHub - ChNanAn/technical-doc-parser: C++ native, backend-agnostic document intelligence engine for traceable structured document…
C++ native, backend-agnostic document intelligence engine for traceable structured document parsing. - ChNanAn/technical-doc-parser
Fil-C: Garbage In, Memory Safety Out! - Filip Pizlo | SSW 2026
https://www.youtube.com/watch?v=5F-2Y1LPRek
https://redd.it/1v4nw0k
@r_cpp
https://www.youtube.com/watch?v=5F-2Y1LPRek
https://redd.it/1v4nw0k
@r_cpp
YouTube
Fil-C: Garbage In, Memory Safety Out! - Filip Pizlo | SSW 2026
Abstract: Conventional wisdom has it that C and C++ are not memory safe programming languages. A simple bug in one part of a C program can be used to achieve remote code execution even in the presence of sophisticated mitigations. The problem is severe enough…
The portable way to extract date and time from a file's mtime in C++
https://sandordargo.com/blog/2026/07/22/extracting-datetime-from-mtime
https://redd.it/1v4w4h3
@r_cpp
https://sandordargo.com/blog/2026/07/22/extracting-datetime-from-mtime
https://redd.it/1v4w4h3
@r_cpp
Sandor Dargo’s Blog
The Portable Way to Extract Date and Time from a File’s mtime in C++
After I finished my Time in C++ series, a reader asked a seemingly simple question: “What is the portable way to extract the year, month, day, hour, minute, and second from a file’s modification time? I tried, and I couldn’t get it to work reliably on macOS…
State of "moved-from" objects
Hi, I recently decided to try writing a C++ blog.
I often see the popular claim that moved-from objects are in a "valid but otherwise unspecified state", but I don't think that statement is entirely precise, and my blog post is about that.
I would really appreciate any feedback!
Article: https://www.laminowany.dev/p/the-state-of-moved-from-objects-in-c/
https://redd.it/1v4r2gb
@r_cpp
Hi, I recently decided to try writing a C++ blog.
I often see the popular claim that moved-from objects are in a "valid but otherwise unspecified state", but I don't think that statement is entirely precise, and my blog post is about that.
I would really appreciate any feedback!
Article: https://www.laminowany.dev/p/the-state-of-moved-from-objects-in-c/
https://redd.it/1v4r2gb
@r_cpp
laminowany.dev
The State Of `moved-from` Objects In C++
What can you do with `moved-from` objects
Binding int from variant to reference in Foo.
Hello guys, my friend had a problem where he couldn't bind an int to int reference in Foo struct held in variant:
struct Foo {
int &abc;
};
std::variant<Foo, std::string> v;
// You can't!
v = Foo {
.abc = ...
}
So I developed a way to do that, it's pretty simple:
#include <cstdint>
#include <functional>
#include <iostream>
#include <string>
#include <variant>
#include <meta>
#include <ranges>
struct __attribute__((packed)) Foo {
int& abc;
~Foo() {
static_assert(sizeof(void*) == 8, "Use modern CPU.");
static_assert([]() consteval {
auto members = std::meta::nonstatic_data_members_of(
^^Foo,
std::meta::access_context::current()
);
for (auto member : members) {
auto type_info = std::meta::type_of(member);
std::size_t layout_size = std::meta::is_reference_type(type_info)
? sizeof(void*)
: std::meta::size_of(type_info);
if (layout_size != 8) {
return false;
}
}
return true;
}(), "All non-static data members of Foo must occupy 8 bytes in layout!");
if (reinterpret_cast<uintptr_t>(&abc) & 0x1) {
delete reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(&abc) &
~uintptr_t(0x1));
}
}
};
int main(void) {
std::variant<int, Foo> v;
v.emplace<0>(420);
v.emplace<1>(([&]() -> int& {
int* x = new int;
*x = std::get<0>(v);
x = reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(x) | 0x1);
return *x;
})());
std::cout << *reinterpret_cast<int*>(
reinterpret_cast<uintptr_t>(&std::get<1>(v).abc) &
~uintptr_t(0x1))
<< std::endl;
return 0;
}
[https://godbolt.org/z/91rcbEdG5](https://godbolt.org/z/91rcbEdG5)
It's also memory safe.
Cheers.
https://redd.it/1v58tj3
@r_cpp
Hello guys, my friend had a problem where he couldn't bind an int to int reference in Foo struct held in variant:
struct Foo {
int &abc;
};
std::variant<Foo, std::string> v;
// You can't!
v = Foo {
.abc = ...
}
So I developed a way to do that, it's pretty simple:
#include <cstdint>
#include <functional>
#include <iostream>
#include <string>
#include <variant>
#include <meta>
#include <ranges>
struct __attribute__((packed)) Foo {
int& abc;
~Foo() {
static_assert(sizeof(void*) == 8, "Use modern CPU.");
static_assert([]() consteval {
auto members = std::meta::nonstatic_data_members_of(
^^Foo,
std::meta::access_context::current()
);
for (auto member : members) {
auto type_info = std::meta::type_of(member);
std::size_t layout_size = std::meta::is_reference_type(type_info)
? sizeof(void*)
: std::meta::size_of(type_info);
if (layout_size != 8) {
return false;
}
}
return true;
}(), "All non-static data members of Foo must occupy 8 bytes in layout!");
if (reinterpret_cast<uintptr_t>(&abc) & 0x1) {
delete reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(&abc) &
~uintptr_t(0x1));
}
}
};
int main(void) {
std::variant<int, Foo> v;
v.emplace<0>(420);
v.emplace<1>(([&]() -> int& {
int* x = new int;
*x = std::get<0>(v);
x = reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(x) | 0x1);
return *x;
})());
std::cout << *reinterpret_cast<int*>(
reinterpret_cast<uintptr_t>(&std::get<1>(v).abc) &
~uintptr_t(0x1))
<< std::endl;
return 0;
}
[https://godbolt.org/z/91rcbEdG5](https://godbolt.org/z/91rcbEdG5)
It's also memory safe.
Cheers.
https://redd.it/1v58tj3
@r_cpp
godbolt.org
Compiler Explorer - C++ (x86-64 gcc 16.1)
struct __attribute__((packed)) Foo {
int& abc;
~Foo() {
static_assert(sizeof(void*) == 8, "Use modern CPU.");
static_assert([]() consteval {
auto members = std::meta::nonstatic_data_members_of(
^^Foo,…
int& abc;
~Foo() {
static_assert(sizeof(void*) == 8, "Use modern CPU.");
static_assert([]() consteval {
auto members = std::meta::nonstatic_data_members_of(
^^Foo,…
Some practical refactoring of bloated generated code
https://pvs-studio.com/en/blog/posts/cpp/1395/
https://redd.it/1v5dhur
@r_cpp
https://pvs-studio.com/en/blog/posts/cpp/1395/
https://redd.it/1v5dhur
@r_cpp
PVS-Studio
Write, shorten, optimize
I stumble upon a C++ function that will be a really illustrative example of how refactoring can both shorten and optimize code. Today, we′ll need to dust off our human brains in the era of vibe...
mp-units: a design for logarithmic quantities and units (dB, dBm, Np, pH). We believe it is novel, and we need domain experts to tell us where we are wrong before we implement it
https://mpusz.github.io/mp-units/latest/blog/2026/07/24/introducing-logarithmic-quantities-and-units/
https://redd.it/1v5kdbi
@r_cpp
https://mpusz.github.io/mp-units/latest/blog/2026/07/24/introducing-logarithmic-quantities-and-units/
https://redd.it/1v5kdbi
@r_cpp
mpusz.github.io
Introducing Logarithmic Quantities and Units - mp-units
The quantities and units library for C++
Switching from Java to C++
Having grasped of Java SE I cannot completely write mechanical sympathy code from it. Can you suggest how should I start C++ language? I want to get ready with syntax first is there any critics or guide is so when i start my C++ journey I need to be clear of it.
IDE suggestion ? (VsCode | CLion)
https://redd.it/1v62buy
@r_cpp
Having grasped of Java SE I cannot completely write mechanical sympathy code from it. Can you suggest how should I start C++ language? I want to get ready with syntax first is there any critics or guide is so when i start my C++ journey I need to be clear of it.
IDE suggestion ? (VsCode | CLion)
https://redd.it/1v62buy
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
muopt: a C++17 micro-library for argument parsing
Hello! I wanted to share a project that I've been working on for the last few days, a small argument parsing library called muopt. It started from a quite popular Rust crate called lexopt that I use in one of my CLI Rust projects. I wanted something similar to lexopt and couldn't find it for C++, so I decided to write my own.
muopt is more of a tokenizer/lexer than it is a parser. It doesn't "connect" a value to its option and just views them as an argument. muopt is intended to be minimal and bare-bones. Below is a really simple example of muopt in action.
#include "muopt/muopt.hpp"
#include <iostream>
int main(int argc, char argv) {
muopt::Parser parser(argc, argv);
while (std::optional<muopt::Arg> arg = parser.next()) {
if (arg->islong("help"))
std::cout << "usage: example [--input FILE]\n";
if (arg->islong("input"))
std::cout << parser.argvalue().valueor("") << '\n';
}
}
The code above will match the arguments
muopt is still very early; it's not even released yet. I'm still debating on how to take on certain things, for example the
GitHub: https://github.com/secona/muopt
https://redd.it/1v6342h
@r_cpp
Hello! I wanted to share a project that I've been working on for the last few days, a small argument parsing library called muopt. It started from a quite popular Rust crate called lexopt that I use in one of my CLI Rust projects. I wanted something similar to lexopt and couldn't find it for C++, so I decided to write my own.
muopt is more of a tokenizer/lexer than it is a parser. It doesn't "connect" a value to its option and just views them as an argument. muopt is intended to be minimal and bare-bones. Below is a really simple example of muopt in action.
#include "muopt/muopt.hpp"
#include <iostream>
int main(int argc, char argv) {
muopt::Parser parser(argc, argv);
while (std::optional<muopt::Arg> arg = parser.next()) {
if (arg->islong("help"))
std::cout << "usage: example [--input FILE]\n";
if (arg->islong("input"))
std::cout << parser.argvalue().valueor("") << '\n';
}
}
The code above will match the arguments
--help and -h. Both will print out the usage message. It will also match --input=Hello or --input Hello and print out the value. The README has a deeper explanation on how muopt works and the repo has more examples.muopt is still very early; it's not even released yet. I'm still debating on how to take on certain things, for example the
arg_value() return type and how errors should be handled. Any suggestions are welcomed!GitHub: https://github.com/secona/muopt
https://redd.it/1v6342h
@r_cpp
GitHub
GitHub - secona/muopt: μopt - a C++17 micro-library for argument parsing
μopt - a C++17 micro-library for argument parsing. Contribute to secona/muopt development by creating an account on GitHub.
C++26: what is reflection and how to use it
https://techfortalk.co.uk/2026/07/25/c26-what-is-reflection-and-how-to-use-it/
https://redd.it/1v6a8az
@r_cpp
https://techfortalk.co.uk/2026/07/25/c26-what-is-reflection-and-how-to-use-it/
https://redd.it/1v6a8az
@r_cpp
Tech For Talk
C++26: what is reflection and how to use it
The author aims to explore C++26 progressively, focusing on its new features, particularly reflection. C++26 introduces the `enumerators_of()` function, allowing easy access to enum class members w…
Modern c++: operations on function pointers will break the constexpr function.
I'm on MSVC/c++23.
I used some trick to generate type id at compile time:
export template<typename... T> void typeid() {}
export using typeidt = void(*)();
//
typeidt oneid = typeid<int>;
I’ve found that whenever I try to cast a \`type\id` value to an integer or simply perform a magnitude comparison within a `constexpr` function (even when the call chain is entirely resolved at compile time), the function ceases to be `constexpr`, or MSVC simply ignores the relevant code.
template<typename A, typename B>
constexpr auto someconstexprfunction()
{
typeidt a = typeid<A>;
typeidt b = typeid<B>;
//Total if block will be ignored, and the function will not be constexpr anymore.
if (a < b)
{
//discard
}
else
{
//discard
}
//cast the pointer to sizet then the function will not be constexpr anymore.
return (sizet)a;
}
How to fixed the case?
Or another type id solution at compile time will be nice(I have try so many implementation, none of them work correctly in compile time).
https://redd.it/1v6clnl
@r_cpp
I'm on MSVC/c++23.
I used some trick to generate type id at compile time:
export template<typename... T> void typeid() {}
export using typeidt = void(*)();
//
typeidt oneid = typeid<int>;
I’ve found that whenever I try to cast a \`type\id` value to an integer or simply perform a magnitude comparison within a `constexpr` function (even when the call chain is entirely resolved at compile time), the function ceases to be `constexpr`, or MSVC simply ignores the relevant code.
template<typename A, typename B>
constexpr auto someconstexprfunction()
{
typeidt a = typeid<A>;
typeidt b = typeid<B>;
//Total if block will be ignored, and the function will not be constexpr anymore.
if (a < b)
{
//discard
}
else
{
//discard
}
//cast the pointer to sizet then the function will not be constexpr anymore.
return (sizet)a;
}
How to fixed the case?
Or another type id solution at compile time will be nice(I have try so many implementation, none of them work correctly in compile time).
https://redd.it/1v6clnl
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
SUCO – Lightweight Distributed C/C++ Compiler Grid with intelligent SSD cache (alternative to Icecream/distcc)
Hi everyone,
I'd like to share my open-source project **SUCO** (SUper COmpiler Grid).
It's a lightweight, zero-config distributed C/C++ compilation and caching system for local networks. Designed as a simpler and faster alternative to Icecream/distcc and proprietary tools like IncrediBuild.
**Key features:**
\- Automatic worker discovery via UDP
\- SHA-256 based SSD cache → warm rebuilds can be up to \~4× faster
\- Windows client can cross-compile to Linux MinGW workers
\- Load-aware scheduling + automatic failover
\- Live web dashboard + Prometheus metrics
\- Easy CMake & IDE integration
Cold builds are roughly on par with Icecream, but cache hits skip the expensive compiler phases completely.
GitHub: https://github.com/MicBur/suco
I'd really appreciate any feedback, criticism or suggestions!
https://redd.it/1v7ce8q
@r_cpp
Hi everyone,
I'd like to share my open-source project **SUCO** (SUper COmpiler Grid).
It's a lightweight, zero-config distributed C/C++ compilation and caching system for local networks. Designed as a simpler and faster alternative to Icecream/distcc and proprietary tools like IncrediBuild.
**Key features:**
\- Automatic worker discovery via UDP
\- SHA-256 based SSD cache → warm rebuilds can be up to \~4× faster
\- Windows client can cross-compile to Linux MinGW workers
\- Load-aware scheduling + automatic failover
\- Live web dashboard + Prometheus metrics
\- Easy CMake & IDE integration
Cold builds are roughly on par with Icecream, but cache hits skip the expensive compiler phases completely.
GitHub: https://github.com/MicBur/suco
I'd really appreciate any feedback, criticism or suggestions!
https://redd.it/1v7ce8q
@r_cpp
GitHub
GitHub - MicBur/suco: 🚀 Distributed C/C++ Compiler Grid & Windows-to-Linux Cross-Compilation Engine — Accelerating C++ builds up…
🚀 Distributed C/C++ Compiler Grid & Windows-to-Linux Cross-Compilation Engine — Accelerating C++ builds up to 4.21x across LAN clusters. - MicBur/suco
std::optional Satisfies view. Does Not Model view. C++26 Ships Anyway.
https://godbolt.org/z/8jWGG68G8
https://redd.it/1v7gp48
@r_cpp
https://godbolt.org/z/8jWGG68G8
https://redd.it/1v7gp48
@r_cpp
godbolt.org
Compiler Explorer - C++
void
passing_views_by_value_is_cheap_trust_me_bro(std::ranges::view auto v) {
std::println("fn .data {}", (void*)v->data());
}
int main() {
std::optional ov{std::vector<int>(123456)};
passing_views_by_value_is_cheap_trust_me_bro(ov);
…
passing_views_by_value_is_cheap_trust_me_bro(std::ranges::view auto v) {
std::println("fn .data {}", (void*)v->data());
}
int main() {
std::optional ov{std::vector<int>(123456)};
passing_views_by_value_is_cheap_trust_me_bro(ov);
…
Memory-level parallelism: AMD is the king
https://lemire.me/blog/2026/07/25/memory-level-parallelism-amd-is-the-king/
https://redd.it/1v7jh93
@r_cpp
https://lemire.me/blog/2026/07/25/memory-level-parallelism-amd-is-the-king/
https://redd.it/1v7jh93
@r_cpp
Daniel Lemire's blog
Memory-level parallelism: AMD is the king
When your program asks for memory that is not in cache, the processor has to go to RAM. That trip costs on the order of 100 nanoseconds. On a 3 GHz core, that is about 300 cycles of doing nothing. Memory latency has not improved in ten years. The 2016 Broadwell…
I built a C++ options execution and back testing engine with Black-Scholes. Looking for feedback on my concurrency model and memory layout.
Hi everyone,
I recently built a C++ options execution and backtesting engine utilizing Black-Scholes pricing, walk-forward optimization, and regime-based strategy selection. It's fully wired to execute paper/live trades via Alpaca.
I'm looking for harsh, constructive feedback on my architecture—specifically regarding my order ledger concurrency model and C++ memory layout.
Specific areas I'd love feedback on:
1. Concurrency in "Orderledger":
I opted for standard `std::mutex` and `std::atomic` flags rather than a lock-free queue for position state management. I'm prioritizing preventing "ghost fills" over sub-millisecond latency. Did I make the right trade-off here, and are there any glaring race conditions I missed?
2. Memory Layout:
I’m relying on standard containers (`std::vector`, `std::unordered_map`) but minimizing dynamic heap allocations on the critical path. Are there better patterns I should adopt to avoid OS allocator pauses during market hours?
3.
Black-Scholes Math Precision:
I used standard `double` precision and `std::erfc` rather than fast-math approximations to ensure numerical stability when calculating Greeks like Gamma on short-dated options.
Here is the repo: github.com/kdyn-ctrl/Nox
If you want to see the rationale behind my decisions, check out `docs/guides/DESIGN_THINKING.md` in the repository.
I also have journals of my work and guides if any other info is needed. I'm still quite novice so please be as harsh as you can I'm really trying to improve.
Thanks in advance for your time and feedback!
https://redd.it/1v7v4ev
@r_cpp
Hi everyone,
I recently built a C++ options execution and backtesting engine utilizing Black-Scholes pricing, walk-forward optimization, and regime-based strategy selection. It's fully wired to execute paper/live trades via Alpaca.
I'm looking for harsh, constructive feedback on my architecture—specifically regarding my order ledger concurrency model and C++ memory layout.
Specific areas I'd love feedback on:
1. Concurrency in "Orderledger":
I opted for standard `std::mutex` and `std::atomic` flags rather than a lock-free queue for position state management. I'm prioritizing preventing "ghost fills" over sub-millisecond latency. Did I make the right trade-off here, and are there any glaring race conditions I missed?
2. Memory Layout:
I’m relying on standard containers (`std::vector`, `std::unordered_map`) but minimizing dynamic heap allocations on the critical path. Are there better patterns I should adopt to avoid OS allocator pauses during market hours?
3.
Black-Scholes Math Precision:
I used standard `double` precision and `std::erfc` rather than fast-math approximations to ensure numerical stability when calculating Greeks like Gamma on short-dated options.
Here is the repo: github.com/kdyn-ctrl/Nox
If you want to see the rationale behind my decisions, check out `docs/guides/DESIGN_THINKING.md` in the repository.
I also have journals of my work and guides if any other info is needed. I'm still quite novice so please be as harsh as you can I'm really trying to improve.
Thanks in advance for your time and feedback!
https://redd.it/1v7v4ev
@r_cpp
GitHub
GitHub - kdyn-ctrl/Nox
Contribute to kdyn-ctrl/Nox development by creating an account on GitHub.
I built a 3D network router that "senses" attacks instead of just watching an alarm number
Built a 3D grid network simulator in C++. Packets move between nodes and reroute around traffic jams. On top of that, I built a controller that watches the overall behavior of the network — not just one alarm number — using 4 signals together: how full it is, how much is getting dropped, how fast it recovers after a spike, and how much room is left.
I compared it against a normal "alarm" style monitor — the kind most systems use, which only reacts once one number crosses a fixed line (here: more than 5% of traffic dropped, or the network more than 40% full)..
I threw 5 different fake attacks at both systems, across two network sizes, and added up the totals:
\\-Packets delivered:
my controller 1,091,830 vs normal monitor 613,472
(mine delivered 1.8x more)
\\-Average traffic lost, across ALL 5 attacks: mine (23% ) vs. normal monitor (28%)
(Quick note on those two percentages — some attacks are brutal and cause heavy loss no matter what, others are quiet and barely register. 23% and 28% are just the average across all of them combined. The real story is in the next part.)
Two of the five attacks — a slow quiet flood, and a sneaky targeted overload — never dropped more than 1% of traffic. That means the normal alarm-style monitor never noticed them at all, because it was only built to react once something gets loud, and these two stayed quiet on purpose.
My controller still caught both of them. Even though no single number spiked, the overall pattern still looked different from what normal traffic looks like — kind of like noticing something feels "off" about a room, even when nothing's visibly broken.
Code: https://github.com/Antriksh005/arena3d.
Been working on this for now some months , so Genuinely want criticism, especially on how I'm measuring "detection" — that part deserves scrutiny.
https://redd.it/1v7xg86
@r_cpp
Built a 3D grid network simulator in C++. Packets move between nodes and reroute around traffic jams. On top of that, I built a controller that watches the overall behavior of the network — not just one alarm number — using 4 signals together: how full it is, how much is getting dropped, how fast it recovers after a spike, and how much room is left.
I compared it against a normal "alarm" style monitor — the kind most systems use, which only reacts once one number crosses a fixed line (here: more than 5% of traffic dropped, or the network more than 40% full)..
I threw 5 different fake attacks at both systems, across two network sizes, and added up the totals:
\\-Packets delivered:
my controller 1,091,830 vs normal monitor 613,472
(mine delivered 1.8x more)
\\-Average traffic lost, across ALL 5 attacks: mine (23% ) vs. normal monitor (28%)
(Quick note on those two percentages — some attacks are brutal and cause heavy loss no matter what, others are quiet and barely register. 23% and 28% are just the average across all of them combined. The real story is in the next part.)
Two of the five attacks — a slow quiet flood, and a sneaky targeted overload — never dropped more than 1% of traffic. That means the normal alarm-style monitor never noticed them at all, because it was only built to react once something gets loud, and these two stayed quiet on purpose.
My controller still caught both of them. Even though no single number spiked, the overall pattern still looked different from what normal traffic looks like — kind of like noticing something feels "off" about a room, even when nothing's visibly broken.
Code: https://github.com/Antriksh005/arena3d.
Been working on this for now some months , so Genuinely want criticism, especially on how I'm measuring "detection" — that part deserves scrutiny.
https://redd.it/1v7xg86
@r_cpp
GitHub
GitHub - Antriksh005/arena3d
Contribute to Antriksh005/arena3d development by creating an account on GitHub.