detphys_debug.hdesync debugger (version 3, recording format DNDR 2, bundle DNDB 1)
Version 3 added recordings of 3D worlds (detphys3d.h); it only adds things.
reservedin the recording settingsdetphys_was renamed todebug_ config dimensions(0 or 2 = 2D, 3 = 3D; left at 0 everything works as before).- 3D recordings are written in format 2. 2D recordings are still format 1 and their bytes are the same as in version 2. Comparing a 2D recording with a 3D one returns
DETPHYS_.ERR_ FORMAT - 3D sessions (
detphys_,rt_ create3d detphys_) acceptturn_ create_ rule3d detphys_/rt_ set_ debug detphys_too (the rt and turn versions did not change, so checkturn_ set_ debug detphys_).debug_ abi_ version() >= 3 - In 3D,
box2d_hash,box2d_first_tickandDETPHYS_hold Box3D's state hash (the same value asDEBUG_ REC_ BOX2D_ HASH detphys3d_). The names are kept from 2D.world_ engine_ hash
Recording
| Function | Description |
|---|---|
detphys_debug_abi_version | This header's versionUsage: Desyncs › Turning the desync debugger on |
detphys_debug_config_default | Default recording settings (600 ticks, 256 bodies, 32 input words, 16 state words, deep hash and types / shapes)Usage: Desyncs › Recording 3D without a session |
detphys_debug_recorder_size | Buffer size needed for a recorderUsage: Desyncs › Recording without a session |
detphys_debug_recorder_init | Uses a caller buffer as a recorderUsage: Desyncs › Recording without a session |
detphys_debug_record | Records the world's current state (with inputs and state words)Usage: Desyncs › Recording without a session |
detphys_debug_record3d | Records a 3D world's current state (into a recorder created with dimensions = 3; the recorded hash equals detphys3d_). Version 3Usage: Desyncs › Recording 3D without a session |
detphys_debug_recorder_clear | Drops all recorded ticks |
detphys_debug_recorder_stats_get | Recorder statistics |
detphys_debug_export | Writes a range of ticks as DNDR bytesUsage: Desyncs › Recording without a session |
Reading and comparing
| Function | Description |
|---|---|
detphys_debug_file_info_get | Reads a recording (DNDR) headerUsage: Desyncs › Comparing recordings again |
detphys_debug_file_tick | Reads the tick at an index |
detphys_debug_file_find_tick | Finds the index of a tick number |
detphys_debug_file_bodies | Reads the bodies of a tick (2D recordings only; 3D recordings return DETPHYS_) |
detphys_debug_file_bodies3d | Reads the bodies of a tick of a 3D recording (2D recordings return DETPHYS_). Version 3Usage: Desyncs › Recording 3D without a session |
detphys_debug_compare | Compares two recordings (first diverging tick, body, field, ULPs, cause, spread)Usage: Desyncs › Comparing recordings again |
detphys_debug_field_name | Field name ("x", "vx", "qw", …) |
detphys_debug_cause_name | Cause name ("input", "physics", …) |
Built into sessions
| Function | Description |
|---|---|
detphys_debug_session_config_default | Default session debug settings (off, 30-tick range, 4 reports, 10000 ms) |
detphys_debug_bundle_info_get | Reads a bundle (DNDB) header and the positions of its two recordingsUsage: Desyncs › Comparing recordings again |
detphys_debug_write_file | Writes bytes to a file (UTF-8 path) |
| Struct | Description |
|---|---|
detphys_debug_config | Recording settings (dimensions 2 / 3; renamed from reserved in version 3) |
detphys_debug_recorder_stats | Recorder statistics |
detphys_debug_file_info | Recording header (format_version 1 = 2D, 2 = 3D; 3D recordings have DETPHYS_ in flags)Usage: Desyncs › 3D worlds and sessions |
detphys_debug_tick | One tick's header (hash, deep hash [Box3D's in 3D], body count, word counts) |
detphys_debug_body | One body in a 2D recording (raw bits of x, y, cos, sin, vx, vy, w) |
detphys_debug_body3d | One body in a 3D recording (raw bits of x, y, z, qx, qy, qz, qw, vx, vy, vz, wx, wy, wz; hull = hull index; 136 B). Version 3Usage: Desyncs › Recording 3D without a session |
detphys_debug_report | Comparison result (cause, first diverging tick, first tick per kind, counts) |
detphys_debug_diff | One differing field (body, field, values in A and B, ULPs)Usage: Desyncs › 3D worlds and sessions |
detphys_debug_session_config | Session debug settingsUsage: Desyncs › Turning the desync debugger on |
detphys_debug_session_report | One desync report (status, range, bytes, report, first difference) |
detphys_debug_session_stats | Session debug counters |
detphys_debug_bundle_info | Bundle header |
Constants: fields DETPHYS_ (2D: X, Y, COS, SIN, VX, VY, W = 0–6, EXISTS, TYPE, SHAPE, AWAKE, TAG = 7–11. 3D: X, Y, VX, VY keep their numbers and Z, QX, QY, QZ, QW, VZ, WX, WY, WZ = 12–20; COS, SIN and W are not used in 3D), DETPHYS_ (0x100).