diff options
| -rw-r--r-- | _log/2d-geometry-kernel.md | 35 | ||||
| -rw-r--r-- | _log/bumblebee.md | 13 | ||||
| -rw-r--r-- | _log/vcs-1.md | 38 |
3 files changed, 43 insertions, 43 deletions
diff --git a/_log/2d-geometry-kernel.md b/_log/2d-geometry-kernel.md index 60d76af..385df18 100644 --- a/_log/2d-geometry-kernel.md +++ b/_log/2d-geometry-kernel.md @@ -6,33 +6,32 @@ layout: post Written in 2026, backdated to 2022. -Joined the real estate firm mid-migration (C# to Java). The Java building -design system lacked a geometry kernel; project had stalled. +Joined real estate firm mid-migration (C# to Java). Java version lacked a +geometry kernel; project stalled. -Small geometries (hundreds of points)—mostly 2D. No frame budget or low-latency -requirements. Architects and structural engineers supplied the test cases. -Numerical parity with Rhino was mandatory. +Geometries were small, mostly 2D—no frame budget or low-latency constraints. +Architects supplied test cases and tolerances; numerical parity with Rhino was +mandatory. Implemented polygon clipping with Sutherland–Hodgman. No drama. -Polygon offsets had always been problematic. Architects flagged two Z and -H-shaped floor plans where offsets produced self-intersections that tripped -Rhino. Instead of straight skeletons, implemented a custom solver that fixed -invalid loops by backtracking. - Fortune's algorithm for Voronoi diagrams was a missed opportunity. Implemented the beach line with an array (O(N<sup>2</sup>)). Didn't pursue the balanced binary tree (O(N log N))—ran out of time. -Finding the largest inscribed rectangle was messier; no solution covered both -convex and concave polygons. Found a paper on the convex case but couldn't -bridge the gap from theory to implementation. Fell back to a brute-force grid -search: 12% gain over the existing approach, but not the true optimum. +Polygon offsets had always been problematic. Two Z and H-shaped floor plans +produced self-intersections that tripped Rhino. Straight skeletons had too many +edge cases we didn't need—hard to get right under time pressure. Implemented a +custom solver that fixed invalid loops by backtracking. + +Finding the largest inscribed rectangle was messy. No single algorithm covered +both convex and concave shapes. Found a paper on the convex case, but couldn't +translate the math to code. Fell back to a brute-force grid search: 12% gain, +but not the true optimum. -Rhino uses points, vectors, planes, and linear algebra (via BLAS). Java system -used Binary Space Partitioning. The two were numerically incompatible. Replaced -BSP trees with vector-based structures. JBLAS aligned the linear algebra with -Rhino's. +Rhino's BLAS-based linear algebra and Java's Binary Space Partitioning were +numerically incompatible. Replaced BSP trees with vector-based structures. +JBLAS reconciled most floating-point issues. Migration resumed. No regressions in the building layouts. diff --git a/_log/bumblebee.md b/_log/bumblebee.md index a5e761d..f3598ff 100644 --- a/_log/bumblebee.md +++ b/_log/bumblebee.md @@ -6,10 +6,10 @@ project: true thumbnail: thumb_sm.png --- -One year at the trading firm. Scripts are saturating CPUs, stalling servers; +One year at trading firm. Scripts are saturating CPUs, stalling servers. Forced to restart them. -2025-02: Built a tool to record browser sessions and synthesize better scripts. +2025-02: Built tool to record browser sessions and synthesize better scripts. <video style="max-width:100%; margin-bottom: 10px" controls="" poster="poster.png"> <source src="bee.mp4" type="video/mp4"> @@ -22,11 +22,12 @@ convert them to Selenium code. Optimizer squashes multiple events into single commands (e.g., calendar clicks → text input), uses heuristics to improve DOM addressing (xpath, id, element). -Two linear lists store events and code—no ASTs. Mid-session manual edits desync -lists, block optimizer. Workaround: only edit scripts at the end of recording. +Two linear lists store events and code—no time for ASTs. Mid-session manual +edits desync lists, block optimizer. Workaround: only edit script after +recording. -2025-03: Shipped the first iteration. Began work on key optimization: bypass -the browser, grab data files directly. +2025-03: Shipped first iteration. Began work on key optimization: bypass the +browser, grab data files directly. 2025-04: Abandoned project. Left the firm. diff --git a/_log/vcs-1.md b/_log/vcs-1.md index 93e842b..d11b342 100644 --- a/_log/vcs-1.md +++ b/_log/vcs-1.md @@ -4,30 +4,29 @@ date: 2026-05-01 layout: post --- -Implemented init, status, add, commit, log, show, and diff commands using Perl -and OpenBSD base-system tools. Didn't bother with collaborative workflows. +Implemented init, status, add, commit, log, show, and diff using Perl and +OpenBSD base-system tools. Didn't bother with collaborative workflows. -Initial design mirrored the work tree using symlinks. Using filesystem as a -database felt clever, but walking directories on every command and the inode -churn were untenable. Replaced the symlink architecture with a path-sorted -index. +Initial design mirrored the work tree with symlinks. Using filesystem as a +database felt clever, but walking directories on every command was untenable. +Replaced the symlink architecture with a path-sorted index. The index tracks path, mtime, size, and SHA-1 hashes of staged, committed, and -base files. Only entries whose mtime and size changed, or share the same mtime -as the index are hashed. +base files. Only entries whose mtime and size changed (or has the same mtime as +the index to mitigate races caused by mtime precision) are hashed. Implemented directory scans as a two-finger walk with the index; linear index -access trades random-access speed for sequential IO and keeps memory footprint -low. +access trades random-access speed for sequential IO and keeps the memory +footprint low. Commits save staged files, trees, and deltas to a content-addressable object -store. Bundled deltas into tarballs to conserve inodes. Gzipped objects larger -than 512 bytes. The threshold was arbitrary. Did not tune further. +store. Deltas are bundled into tarballs to conserve inodes. Objects larger than +512 bytes are gzipped. The threshold was arbitrary. Did not tune further. Deltas, computed using diff, target the original file. Subsequent versions are reconstructed via a single patch—no chains. Diff output is bloated but -compresses well, so rebase threshold is set to 1.4, assuming a 30-40% -compression ratio. When the delta exceeds that, the file becomes the new base. +compresses well. Rebase threshold is set to 1.4, assuming a 30-40% compression +ratio. When the delta exceeds the threshold, the file becomes the new base. Commands run in memory, using text streams and pipes wherever possible. Left MEM_LIMIT configurable to fall back to disk for large repositories: @@ -53,7 +52,8 @@ if ((!$use_disk && $tot_size > MEM_LIMIT) || } ``` -Benchmarked against Git v2.51.0 on a T490 (i7-10510U, OpenBSD 7.8): +Benchmarked against Git v2.51.0 on a T490 (i7-10510U, OpenBSD 7.8). Measured +with `/usr/bin/time -l sh -c`. Max RSS excludes child processes: <pre class="pre-no-style"> ============================================================= @@ -104,15 +104,15 @@ Final Inodes | 1462 | 41 TOTAL URN REBASES: 0 </pre> -Git is 10x times faster. +Git is 10x faster. On storage, Urn shows promise. Git wrote 12 MB to track a 17 MB repository; Urn -wrote 9 MB. Over 80 commits, Git's inode consumption grew by 562. Urn's crept -from 1,300 to 1,462. +wrote 9 MB. Over 80 commits, Git's inode consumption grew by 562, while Urn's +crept from 1,300 to 1,462. Then fell the GC hammer. Inodes: 41. Space recovered: 8.4 MB. -Precise impact on TBW and write amplification is not yet known. +Precise impact on TBW and write amplification is unknown. Commit: <a href="https://git.asciimx.com/urn/commit/?id=ff98b5711ae91d5cafd75764be192c0be5e592cf" |
