summary refs log tree commit diff stats
path: root/results/scraper/box64/2511
diff options
context:
space:
mode:
Diffstat (limited to 'results/scraper/box64/2511')
-rw-r--r--results/scraper/box64/251155
1 files changed, 55 insertions, 0 deletions
diff --git a/results/scraper/box64/2511 b/results/scraper/box64/2511
new file mode 100644
index 000000000..e085fefc2
--- /dev/null
+++ b/results/scraper/box64/2511
@@ -0,0 +1,55 @@
+Clarification on the Usage and Purpose of the `dynamap` Red-Black Tree in Box64
+While examining Box64's memory management system, particularly the usage of `rbtree`, I observed unusual behavior involving the `dynamap` tree. By running Box64 combined with Wine64 on a Windows 64-bit chess game, I noticed that the `dynamap` tree significantly outnumbers other trees in node count. However, despite the high node usage, nodes from `dynamap` were rarely (if ever) actively accessed during execution (`rb_get`, `rb_get_64`, `rb_get_end`, `rb_get_end_64`, `rb_get_right` or `rb_get_left` calls).
+
+![Image](https://github.com/user-attachments/assets/ca2db267-dd9d-48e3-8ced-8b0d6b1d6220)
+
+Additionally, I collected detailed statistics on node creation and usage:
+A total of 54,306 rbtree nodes were created during execution.
+Only 17,886 nodes were released before the process terminated.
+
+Among the released nodes, the breakdown of unused nodes (i.e., created but never accessed) is as follows:
+1. `blockstree`: 0 unused nodes
+2. `db_sizes`: 52 unused nodes
+3. `dynamap`: 16,697 unused nodes (100% of released `dynamap` nodes were unused)
+4. `envmap`: 1 unused node
+5. `mapallmem`: 158 unused nodes
+6. `mapmem`: 105 unused nodes
+7. `memprot`: 873 unused nodes
+8. `rbt_dynmem`: 0 unused nodes
+
+To further verify this observation, I experimentally disabled the usage of dynamap within the Box64 codebase and repeated my tests. Surprisingly, the system functioned perfectly without noticeable issues.
+```c
+int rb_set_64(rbtree_t *tree, uintptr_t start, uintptr_t end, uint64_t data) {
+    if(!strcmp(“dynamap”, tree->name))
+        return 0;
+    //--skip--//
+}
+```
+
+![Image](https://github.com/user-attachments/assets/1f5b9b48-e7db-4275-b62e-ec2315112006)
+
+Given these observations, I seek clarification on the following points:
+
+1. **Intended Purpose**: What was the initial purpose behind implementing the `dynamap` tree within Box64's memory management system?
+
+2. **Node Utilization**: Why does `dynamap` contain so many nodes if these nodes are rarely (or never) accessed during regular operations?
+
+3. **Impact of Removal**: Considering that disabling `dynamap` had no observable negative impact in my tests, could removing or optimizing `dynamap` improve memory efficiency or overall performance?
+
+
+Experimental Environment:
+1. Box64 Version: v0.3.5 d3d3fa25 on apr 7
+2. Wine64 Version: wine-9.22
+3. Host System: Raspberry Pi 400 running `Linux Debian 6.12.3-arm64 #1 SMP Debian 6.12.3-1 (2024-12-07) aarch64 GNU/Linux`
+4. Game Tested: [chess](https://win7games.com/)
+5. Build Configuration:
+```shell
+cmake \
+    -G Ninja \
+    -D RPI4ARM64=1 -D ARM_DYNAREC=ON \
+    -D CMAKE_BUILD_TYPE=RelWithDebInfo \
+    -D CMAKE_C_COMPILER=aarch64-none-linux-gnu-gcc \
+    ..
+ninja
+```
+