16 Commits

Author SHA1 Message Date
iphydf
109752403e feat: Add Tox_Iterate_Options for granular control over tox_iterate.
Some checks failed
deploy / Prepare (push) Failing after -2s
deploy / Linux (aarch64) (push) Has been skipped
deploy / Linux (x86_64) (push) Has been skipped
deploy / macOS (arm64) (push) Has been skipped
deploy / macOS (x86_64) (push) Has been skipped
deploy / iOS (ios-arm64) (push) Has been skipped
deploy / iOS (ios-armv7) (push) Has been skipped
deploy / iOS (ios-armv7s) (push) Has been skipped
deploy / iOS (iphonesimulator-arm64) (push) Has been skipped
deploy / iOS (iphonesimulator-x86_64) (push) Has been skipped
deploy / Xcode Framework (push) Has been skipped
deploy / Android (x86) (push) Has been skipped
deploy / Android (x86_64) (push) Has been skipped
deploy / WebAssembly (push) Has been skipped
deploy / Single file (push) Has been skipped
deploy / Source tarball (push) Has been skipped
docker / docker-bootstrap-node (push) Failing after 15s
docker / docker-clusterfuzz (push) Failing after 26s
draft / release (push) Failing after -2s
docker / docker-windows-mingw (64) (push) Failing after 17s
deploy / Android (arm64-v8a) (push) Has been skipped
deploy / Android (armeabi-v7a) (push) Has been skipped
docker / docker-bootstrap-node-websocket (push) Has been skipped
docker / docker-fuzzer (push) Failing after 16s
docker / docker-windows-mingw (32) (push) Failing after 18s
docker / docker-esp32 (push) Failing after 22s
post-submit / build (alpine-s390x) (push) Successful in 33m10s
post-submit / docker-coverage (push) Failing after 21s
sonar-scan / sonar-scan (push) Failing after 16s
post-submit / build (freebsd) (push) Successful in 39m11s
ClusterFuzzLite batch fuzzing / BatchFuzzing (address) (push) Failing after 10s
ClusterFuzzLite batch fuzzing / BatchFuzzing (memory) (push) Failing after 15s
ClusterFuzzLite batch fuzzing / BatchFuzzing (undefined) (push) Failing after 10s
coverity-scan / latest (push) Failing after 22s
ClusterFuzzLite cron tasks / Pruning (push) Failing after 9s
ClusterFuzzLite cron tasks / Coverage (push) Failing after 8s
CodeQL / Analyze (cpp) (push) Failing after 8m47s
2026-02-12 22:50:25 +00:00
iphydf
ea597edff7 test: Improve simulation determinism and reliability.
Require explicit seeds for `Simulation` and `SimulatedEnvironment` to
ensure reproducible test results.

Also:
- Drop packets in `FakeUdpSocket` when the receive queue is full to
  prevent unbounded memory growth during stress tests.
- Improve synchronization in `Simulation::run_until` by adding a timeout
  to the barrier wait, preventing hangs if a runner is unregistered.
2026-02-09 09:34:26 +00:00
iphydf
40ce0bce66 cleanup: Use std::size_t in C++ to fix compilation errors.
On some stdlibs, `size_t` doesn't exist in the global namespace.

Fixes #3020.
2026-02-08 21:57:40 +00:00
iphydf
2f87ac67b0 feat: Add Event Loop abstraction (Ev).
- `Ev` interface in `toxcore/ev.h` and `toxcore/ev.c`.
- System-specific event loop backends (epoll, poll, win32) in
  `toxcore/os_event.c`.

Performance Benchmarks (epoll backend):

| Sockets (N) | Active (M) | Time (ns) | Time/Active (ns) |
|------------:|-----------:|----------:|-----------------:|
|           8 |          1 |       438 |              438 |
|          64 |          1 |       438 |              438 |
|         512 |          1 |       443 |              443 |
|        1024 |          1 |       442 |              442 |
|        1024 |         10 |       947 |               95 |
|        1024 |        100 |     6,268 |               63 |
|        1024 |       1024 |    61,875 |               60 |
2026-01-19 17:49:39 +00:00
iphydf
4962bdbb80 test: Improve TCP simulation and add tests
- `FakeTcpSocket` handles basic TCP state machine (SYN, ACK, RST, buffering).
- `NetworkUniverse` handles TCP routing and loopback.
- Add `TcpRelayChaining` test.
- Add LogFilter to Simulation.
2026-01-17 14:35:20 +00:00
iphydf
dd31362509 cleanup: Apply nullability qualifiers to C++ codebase. 2026-01-15 12:19:00 +00:00
iphydf
1849f70fca refactor: Extract low-level networking code to net and os_network.
Move core networking types and the Network interface to net, and the
standard OS socket implementation to os_network. Update network to use
these new abstractions.
2026-01-14 23:44:18 +00:00
iphydf
8fec754218 refactor: Delete tox_random, align on rng and os_random. 2026-01-14 15:15:40 +00:00
iphydf
a03ae8051e refactor: Delete tox_memory, align on mem and os_memory.
os_memory will be os_mem later.
2026-01-14 10:19:05 +00:00
iphydf
4c88fed2c9 refactor: Use std:: prefixes more consistently in C++ code. 2026-01-14 02:10:10 +00:00
iphydf
72452f2aeb test: Add some more tests for onion and shared key cache.
Also some other cleanups.
2026-01-13 23:43:56 +00:00
iphydf
b6f5b9fc56 test: Add some benchmarks for various high level things. 2026-01-12 14:37:27 +00:00
iphydf
8a8d02785e test(support): Introduce threaded Tox runner and simulation barrier
- Add `MpscQueue` for thread-safe task scheduling.
- Add `ToxRunner` to execute Tox instances in dedicated threads.
- Update `Simulation` to coordinate time steps across multiple runners using a synchronization barrier.
- Refactor `FakeMemory` and `FakeClock` to be thread-safe.
- Update `tox_network` helpers and tests to utilize the threaded runner infrastructure.
2026-01-11 22:51:59 +00:00
iphydf
4f6d4546b2 test: Improve the fake network library.
Some bugfixes, and getting ready for benchmark support code.
2026-01-11 12:32:44 +00:00
iphydf
695b6417aa test: Add some more simulated network support.
We'll need this for future tests (coming soon).
2026-01-08 18:50:34 +00:00
iphydf
9c22e79cc8 test(support): add SimulatedEnvironment for deterministic testing
Introduces a new testing support library 'testing/support' that provides
a clean, modular, and fully deterministic environment for testing
toxcore components.
2026-01-07 13:06:18 +00:00