1. tasks

1.1. core

Archived entries from file /home/ellis/comp/org/plan/tasks/core.org

1.1.1. DONE dot 0.1 [1/1]   lisp dot

  • implemented in dat/dot.lisp
  1. NOPE PARSE-SPECIALIZER-USING-CLASS
    • experimental SB-MOP generic, may be useful in places where we would typically use (eql OBJECT) as a specializer for GRAPH.

1.1.2. DONE migrate to sb-grovel [9/9]   lisp ffi

:ID: bb365025-e5e7-4407-acba-32e30d1a245a

lisp/ffi/

  1. DONE blake3

    :ID: 656c2683-8780-407c-b955-3defc4959595

  2. DONE bqn

    :ID: b4757746-525b-49e4-b8ac-677375867d8f

  3. DONE btrfs

    :ID: b3b411fe-6b2d-4338-9e23-83536336a487

  4. DONE k

    :ID: 8a463084-efa0-4535-8239-b1c4955bde4c

  5. DONE rocksdb

    :ID: 2d4d70af-228f-424c-8374-9fc8ed5c6f92

  6. DONE tree-sitter

    :ID: 0cdf3412-cb00-4069-8e1b-b49c736377cf

  7. DONE uring

    :ID: 45a52407-ccaf-4ea1-99c4-d6f7ba0b2731

  8. DONE zstd

    :ID: 6ade8dd8-83b1-470d-a0da-a352ce4c2d06

  9. DONE xkb

    :ID: af778a5f-4834-4f0c-ae53-36d35cb98d8c

1.1.4. DONE logger

1.1.5. DONE merge-operator callbacks   rocksdb

1.1.6. DONE compactionfilter callbacks   rocksdb

https://github.com/facebook/rocksdb/wiki/Compaction-Filter

(rocksdb-compactionfilterfactory-create nil (alien-sap (alien-callable-function 'rocksdb-destructor))
                                        (alien-sap (alien-callable-function 'rocksdb-create-compaction-filter-never))
                                        (alien-sap (alien-callable-function 'rocksdb-name)))

1.1.7. DONE comparator callbacks   rocksdb

1.1.8. DONE associative-merge implementation

  • need to figure out what delete-value requires
    • simply passes state + value and value-length to a function
    • when the value is null it doesn't exist in db (noop) ?
    • unclear when the merge op actually runs in relation to deletion op - before or after?
  • https://docs.rs/rocks/latest/rocks/merge_operator/index.html
  1. DONE concat-merge
  2. DONE index-merge

1.1.9. DONE incf/decf-merge

1.1.10. DONE define-merge-operator   macro

  • define macro which eases the process of making custom merge operators
(define-merge-operator :incf nil
  :full nil
  :partial nil)
(create-incf-mergeoperator)
#<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #X75D288000C30 :TYPE (*
                                                            (SB-ALIEN:STRUCT
                                                             ROCKSDB::ROCKSDB-MERGEOPERATOR-T))>

1.1.11. DONE zstd

  1. DONE zstd cstream tests
    • v2 api
  2. DONE zdict
    • A few structs that we can't grovel
    • A bunch of functions for pre-training a dictionary

1.1.13. DONE retire x.lisp   lisp skel

with skel taking on more responsibility we no longer need a dedicated build tool.

  • migrate all functionality to skelfile
  • cleanup readme with installation instructions (with and without infra)
  • easy to break the skel binary and overwrite a LKG version, preventing future builds.
    • just be more careful
    • sanity checks
    • repurpose x.lisp to recover from situations like these specifically

1.1.14. DONE implement globals *cli* *opts* *args* etc

1.1.15. DONE opt/arg parsing

  • do not need to handle multiple commands
    • what do we want to do about subcommands?
  • do not need to support 'global' option for commands
  • use cli-parse to test.

1.1.16. DONE multipoint-images   lisp bin sys

  • multiple entrypoint lisp images
  • create multiple links to core lisp image
  • support multiple low-level methods?
    • naive implementation is a single entry point with a switch dispatched on arg0.
    • could also create a thin shim in Rust/Zig and call the appropriate entrypoint after loading the core.
  • for now let's put this in lib/cli so that we can use defmain

1.1.17. DONE make-sql-data-frame

  • finish implementation

1.1.18. DONE git   vc git

1.1.19. DONE hg   vc hg

1.1.20. DONE eval rules from CLI

  • need new command or flag for rules
  • evaluate forms instead of looking in skelfile

1.1.21. DONE refactor system definition

  • remove package-inferred
  • minimize number of systems
  • use pkg.lisp files

1.1.22. DONE cleanup fu

1.1.23. DONE CLTL2 impl

1.1.24. DONE list-package-symbols, etc

1.1.25. DONE std/tests refactor

  • a bit too large, time to shake it up
  • need separation of concerns (files) for task-pool/threaded tests in particular

1.1.26. DONE tasks

1.1.27. DONE more sb-alien utils   ffi

1.1.28. NOPE uri   net

  • mostly just need the tests and to finish porting the Franz implementation

1.1.29. DONE db   db

[2024-09-16 Mon 14:41] <- org graph edges

  • ported from XDB2

1.1.30. DONE aggregate physical plan

1.1.31. DONE Physical Expressions

1.1.32. DONE crew   proto

1.1.33. DONE http   proto

1.1.34. DONE dns   proto

1.1.35. DONE tlv   codec

1.1.36. DONE osc   codec

1.1.37. DONE Woo/+

1.1.38. DONE fixture api

1.1.39. DONE temporary files and directories

1.1.40. DONE org graph edges

  • list of links between other headings
    • <= links to this item
    • => links from this item
    • == siblings
    • ^= parent
    • v= child
  • how should it look when exported?
  • org-graph-link-use-timestamp
  • org-graph-link properties? edge properties?
    • keyvals :key val - should probably align with whatever we use for CONSTRAINTS, for now read as sxp
  • EXPORTEDGES property?
* example
:PROPERTIES:
:ID:       id1
:CUSTOM_ID: demo
:END:
:EDGES:
<- bar
[2024-09-14 Sat 22:37] <- bar
[2024-09-14 Sat 22:50] :key val :foo (bar baz) <- bar
[2024-09-14 Sat 22:37] -> foo
[2024-09-14 Sat 22:39] -- sibling
[2024-09-14 Sat 22:39] >> parent
[2024-09-14 Sat 22:39] << child
:END:

1.1.41. DONE org-follow-location   org

  • follow LOCATION property of heading at point
  • respect parent LOCATION, buffer local settings, etc

1.1.42. DONE org-set-location

similar to org-set-effort, to be called automatically on capture.

  • should prompt for directory then file - skip file with C-u or with RET
    • simpler to just prompt for value with completion using org-read-property-value

1.1.43. DONE flate [0/0]

1.1.44. DONE review GNU stow API

homepage 'symlink farm manager' rust impl: https://github.com/qboileau/rstow

1.1.45. DONE consolidate with skel   skel

1.1.46. DONE cli tests crashing

1.1.47. DONE :scripts regression   infra

1.1.48. NOPE readline   cli

1.1.49. DONE impl rocksdb/slicetransform callbacks

1.1.50. DONE OCI projects [4/4]   pod packy skel

  1. DONE oras
  2. DONE skopeo
  3. DONE zot
  4. DONE sigstore

1.1.51. DONE PMem.io

  • consider use cases in Lisp images - pre-loading and coordinating shared fasls and core images
  • no longer maintained by intel

1.1.54. DONE DPDK

Home - DPDK GitHub - DPDK/dpdk: Data Plane Development Kit

By leveraging DPDK libraries, developers can create optimized packet processing paths, manage timers for executing functions asynchronously, and utilize a wide range of drivers and libraries tailored for fast packet processing.

librteeal – Environment Abstraction Layer: Provides the foundational API for DPDK, facilitating access to hardware resources such as memory, timers, and logs.

librtemempool – Memory Pool Manager: Manages memory pools for efficient and speedy packet handling.

librtering – Ring Buffer Manager: Implements lock-free FIFO queues, enabling high-speed communication between various DPDK components.

librtembuf – Packet Buffer Management: Handles packet buffers, which are crucial for packet transmission and reception.

librteethdev – Ethernet Device API: Offers an API for configuring and querying Ethernet devices. It supports various operations, including sending and receiving packets.

librtenet – Network Helper Library: Provides helper APIs for dealing with network protocols.

librteipfrag – IP Fragmentation and Reassembly: Handles fragmentation and reassembly of IP packets, supporting both IPv4 and IPv6.

librtekni – Kernel Network Interface: Facilitates communication between DPDK applications and the Linux kernel networking stack, primarily used for debugging or interfacing with existing Linux network services.

1.1.56. DONE batman-adv   net

1.1.57. NOPE libyear   lisp skel

Not that useful in our current environment (NIH)

1.1.58. DONE Level 1

1.1.59. DONE Level 2

1.1.60. DONE Level 3

1.1.61. DONE LAPACK (f77blas.h)

1.1.62. DONE LAPACK codegen

lapack.h is massive and impractical to attempt lisp bindings from scratch.

instead, our current approach is based on tree-sitter:

(tree-sitter:load-tree-sitter)
(tree-sitter:load-tree-sitter-alien)
(tree-sitter:load-tree-sitter-c)
#P"/usr/local/lib/libtree-sitter-c.so"
(syn/ts::ts-file-query :c #p"/usr/include/openblas/lapack.h" "(declaration)")
#<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #X71384C005800 :TYPE (*
                                                            (SB-ALIEN:STRUCT
                                                             TREE-SITTER:TS-QUERY-CURSOR))>

this segfaults:

(in-package :syn/ts)
(sb-alien:with-alien ((m (* tree-sitter::ts-query-match) (sb-alien:make-alien tree-sitter::ts-query-match)))
  (sb-sys::with-pinned-objects (m)
    (tree-sitter::ts-query-cursor-next-match
     (syn/ts::ts-file-query :c #p"/usr/include/openblas/lapack.h" "(declaration)") m)))

(let ((tree (flatten (syn/ts::parse-file :c #p"/usr/include/openblas/lapack.h")))
      (dx 0)
      (ret))
  (loop with dx = 0
        for di = (print (position :declaration tree :start dx))
        if (null di) 
        do (return ret)
        else
        do (progn
             (setf dx (incf di))
             (let ((ei (print (position :declaration tree :start dx))))
               (push (subseq tree di ei) ret)))))
(setq 
 *lapack*
 (let* ((str (read-file #p"/usr/include/openblas/lapack.h"))
        (tree (flatten (syn/ts::parse-string :c str :consume t :produce-cst nil)))
        (dx 0)
        (ret))
   (setq *lapack.h* str)
   (loop with dx = 0
         for di = (position :declaration tree :start dx)
         if (null di) 
         do (return ret)
         else
         do (progn
              (setf dx di)
              (incf dx)
              (let ((ei (position :declaration tree :start dx)))
                (push (subseq tree di ei) ret))))))
(list (length *lapack*) (length *lapack.h*))
1332 747544
(labels ((lastr (x start end)
           (apply 'subseq *lapack.h* (subseq x start end)))
         (lasym (str) (symbolicate (string-upcase (substitute #\- #\_ str))))
         (lasym* (str)
           (let ((len (length str)))
             (list '* (lasym (subseq str 0 
                                     (if (char= (char str (1- len)) #\*)
                                         (1- len)
                                         len))))))
         (lasyms (x start end)
           (symbolicate (string-upcase (substitute #\- #\_ (lastr x start end)))))
         (laparm (str)
           (let ((a (nreverse (split-sequence #\space str))))
             (list (if (string-equal (first a) "T")
                       (gensym "T")
                       (lasym (first a)))
                   (if (third a)
                       ;; type param (could be X const* or const X*)
                       (if (string-equal (third a) "const")
                           (lasym* (second a))
                           (lasym* (third a)))
                       (when (second a)
                         (lasym* (second a)))))))
         (gen-lapack-args (p x)
           (let* ((pa (position :parameter-list x)) ;; param start
                  (pb (position :preproc-ifdef x)) ;; param end
                  (params (subseq x pa pb)))
             (loop with p1 = 0
                   for pos = (position :parameter-declaration params :start p1)
                   while pos
                   do (setf p1 (1+ pos))
                   collect (laparm (lastr params (+ pos 1) (+ pos 3)))))))
  (setq *code*
        (mapcar
         (lambda (x)
           (let ((p (position :function-declarator x)))
             (list* 'deflapack
                    ;; routine name
                    (lasyms x (+ p 5) (+ p 7))
                    ;; return-type
                    (lasyms x (- p 3) (- p 1))
                    ;; list of function parameters (NAME TYPE)
                    (remove-if (lambda (x) (eql (car x) 'fortran-strlen)) (gen-lapack-args p x)))))
         *lapack*)))
(length *code*)
1332
(with-output-to-file (f file) 
  (write-line ";;; lapack-ffi.lisp --- LAPACK Alien Routines -*- buffer-read-only:t -*-" f)
  (write-line "(in-package :lapack)" f)
  (mapc (lambda (x) (write x :stream f :case :downcase) (terpri f)) *code*))

1.1.63. DONE linedit path completion

currently segfaults - should be easy to fix

1.1.64. DONE sxp 0.2   lisp sxp

  1. NOPE WRAP-OBJECT   skel
    • use to replace LOAD-AST for sk-project and friends
    • requires mop
    • take a look at UNWRAP-OBJECT too, may need rewrite for a better API
    1. NOPE sxp standard methods
      • hash-table
      • classoid
      • vector
      • boolean
      • obj/
        • color
        • uri

1.1.65. DONE toml impl

the toml parser on quicklisp is based on esrap, make a comparable one using our parser module.

1.1.66. DONE split out skel rules

  • core/rule.lisp

1.1.67. DONE fix obj/query stack overflow on compile

Control stack exhausted (no more space for function call frames).
This is probably due to heavily nested or infinitely recursive function
calls, or a tail call that SBCL cannot or has not optimized away.

PROCEED WITH CAUTION.
   [Condition of type SB-KERNEL::CONTROL-STACK-EXHAUSTED]

 849: ((:METHOD SB-PCL::COMPUTE-EFFECTIVE-SLOT-DEFINITION-INITARGS (SB-PCL::SLOT-CLASS T)) #<STANDARD-CLASS OBJ/QUERY:LOGICAL-QUERY-PLAN> (#<STANDARD-DIRECT-SLOT-DEFINITION OBJ/AST:AST> #<STANDARD-DIRECT-SL..
      Locals:
	SB-PCL::ALLOCATION = :INSTANCE
	SB-PCL::ALLOCATION-CLASS = #<STANDARD-CLASS OBJ/QUERY:LOGICAL-QUERY-PLAN>
	SB-PCL::ALLOCP = T
	CLASS = #<STANDARD-CLASS OBJ/QUERY:LOGICAL-QUERY-PLAN>
	SB-PCL::DIRECT-SLOTDS = (#<STANDARD-DIRECT-SLOT-DEFINITION OBJ/AST:AST> #<STANDARD-DIRECT-SLOT-DEFINITION OBJ/AST:AST> #<STANDARD-DIRECT-SLOT-DEFINITION OBJ/AST:AST>)
	DOCUMENTATION = NIL
	SB-PCL::DOCUMENTATIONP = NIL
	SB-PCL::INITARGS = (:AST)
	SB-PCL::INITFORM = NIL
	SB-PCL::INITFUNCTION = NIL
	SB-PCL::INITP = NIL
	SB-PCL::NAME = OBJ/AST:AST
	SB-PCL::NAMEP = T

 855: (SB-THREAD::CALL-WITH-RECURSIVE-LOCK #<FUNCTION (FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-PCL::UPDATE-CLASS) {739064260D1B}> #<MUTEX "PCL global mutex" taken owner=main thread>)
      Locals:
	GOT-IT = NIL
	MUTEX = #<MUTEX "PCL global mutex" taken owner=main thread>
	SB-C::THING = #<FUNCTION (FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-PCL::UPDATE-CLASS) {739064260D1B}>

1.1.68. DONE exfil from obj

  • things lib/math will need from obj:
    • plan
    • store
    • graph
    • srv?
    • schema?
  • may go to std

1.1.69. DONE Ecosystem

1.1.70. DONE refactor libs into math

  • obj should NOT depend on math
    • math depends on obj for tensor
  • accumulators? hmm..
    • need to be in math but also used by queries which is in obj
    • may need to split out obj/query to Q
      • done
    • moved to std/seq
  • math depends on ffi, depended on by dsp,net,apps,etc
  • should probably have the most tests of all libs
  • we want OBJ/TENSOR - see tensor

1.1.71. DONE symbol cleanup

delete unbound non-anaphoric symbols

(let ((ret))
  (do-external-symbols (s :std ret)
    (when (not (or (boundp s) (fboundp s) (cadr (multiple-value-list (typexpand s))) (find-class s nil)))
      (push s ret))))
TIME-REMAINING PID-T TIMESPEC IT LOFF-T STAGES %P TASK GID-T .I %THREAD %A MAYBE-INLINE JOBS TASKS TIMEVAL WINSIZE UID-T

1.1.72. DONE review previous state of std/tasks

We were doing some things right - like our semaphore worker waking

  • already added this to BROADCAST-WORK (comment suggestion by lmj)
  • mailbox stuff not as useful (speed is a concern over more primitive cas queues and spinlocks)

1.1.73. DONE explain   doc

  • generic done
  • maybe simple version in std/fmt

1.1.74. DONE explore   doc

  • generic done

1.1.75. DONE define-alien-struct

  • convenience for defining alien structs, especially with the same name as lisp type

1.1.76. DONE remove makefile

1.2. infra

1.2.1. DONE dictd

1.2.2. DONE reintegrate pod and box   vc

  • [X] pod
  • [X] box
  • [X] .hgsub

1.2.3. DONE deploy [4/4]   lisp

  • [X] collect artifacts
  • [X] pack
  • [X] send output to DIST
  • [X] Adapt to skel deploy
  • assumptions
    • host is qualified builder
    • all dependendencies installed on system (not in stash)
    • current user has access to DIST
  • done in org skelfile

1.2.4. DONE publish [4/4]   lisp emacs

  • done in org skelfile
  • [X] load dependencies (htmlize,default.el,babel.org)
  • [X] load publish.el
  • [X] set publish-directory
  • [X] eval publish

1.2.5. DONE tree-sitter-pack

  • pull-tree-sitter-langs.sh
  • install-tree-sitter-langs.sh (OG, calls pull)
  • make dist/tree-sitter

1.3. demo

2. roadmap

3. product