Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
c9e55cc
Add $table-copy inside rsc.scm
leo-ard Mar 16, 2026
38a7436
Replace log by an integer version: floor-log
leo-ard Mar 16, 2026
ccc3f5b
Add make-vector-with-default for portability
leo-ard Mar 16, 2026
1b7d8f6
Fix indentation
leo-ard Mar 16, 2026
9c96a12
Fix table-copy
leo-ard Mar 16, 2026
72369f8
Fix symbol ordering relying on the implementation of table->list
leo-ard Mar 16, 2026
4543c29
Fix C23 already defining bool type
leo-ard Mar 16, 2026
aa1005e
Remove default input for rvm.c
leo-ard Mar 16, 2026
e3efba0
Add debugging information for arity check inside C host
leo-ard Mar 16, 2026
0c1e7ef
More debugging options for rvm.c
leo-ard Mar 16, 2026
fc375ed
Fix c-rib representation in Ribbit
leo-ard Mar 17, 2026
b2d6308
Remove -e original for bootstrap (too slow)
leo-ard Mar 18, 2026
2151c90
Add checks when heap is full for stop-and-copy gc in C host
leo-ard Mar 18, 2026
0ec358d
Add scripts to script directory
leo-ard Mar 19, 2026
58ab923
Add vscode to gitignore
leo-ard Mar 19, 2026
34ea1fe
Rename unchecked-table-ref to checked-table-ref and move it to more r…
leo-ard Mar 19, 2026
010ee55
Fix bug with tables not deep copying
leo-ard Mar 19, 2026
d4a381c
Fix typo in profiler instructions
leo-ard Mar 19, 2026
eaa965e
Avoid the usage of floating point numbers inside of the compiler
leo-ard Mar 20, 2026
4767b7e
Fix help message
leo-ard Mar 20, 2026
c685c3e
Only recalculate the winner for the optimal encoding
leo-ard Mar 20, 2026
dd7f149
Fix recalculation error
leo-ard Mar 20, 2026
0e81b81
Fix bug with recalculation
leo-ard Mar 20, 2026
a121819
Fix encoding
leo-ard Mar 20, 2026
37cea74
Add instructions to debug encoding instructions
leo-ard Mar 20, 2026
03bc81f
Fix parenthesis error in debugging comment
leo-ard Mar 21, 2026
83af1ce
Add macro for profiling in debugging comments
leo-ard Mar 21, 2026
bdf3ec8
Change the implementation of calculate-gain-long to make it faster
leo-ard Mar 21, 2026
f5969e5
Specialize the implementation of sum-byte-count for non-debugging usages
leo-ard Mar 21, 2026
2554941
Clarify get-byte-count
leo-ard Mar 21, 2026
d6754b7
Fix typo
leo-ard Mar 21, 2026
636a881
Fix whitespaces + add comments
leo-ard Mar 21, 2026
8659c29
Add number of elements and the display of the hash-table after encodi…
leo-ard Mar 21, 2026
483fff2
Make append from the r4rs library faster
leo-ard Apr 1, 2026
b2f9e53
Add enough heap for RVM host
leo-ard Apr 1, 2026
cddafb0
Add check that the generated bootstrap is the same
leo-ard Apr 1, 2026
1f60784
Add bootstrap to CI
leo-ard Apr 1, 2026
d726fee
Fix chicken list-set!
leo-ard Apr 1, 2026
d7c420a
Explode functions in encode
leo-ard Apr 2, 2026
85ccb74
Move optimal encoding out of let
leo-ard Apr 2, 2026
dd9bcc0
Change more things
leo-ard Apr 2, 2026
04bba22
Change ribn-base into a variable inside calcualte-optimal-encoding
leo-ard Apr 6, 2026
5dd4839
Move proc and encoding inside let
leo-ard Apr 6, 2026
70d0b9d
Mini-refactor
leo-ard Apr 6, 2026
a5cea30
Fix bug
leo-ard Apr 7, 2026
01e3ac0
Improve symbol table representation within code
leo-ard Apr 7, 2026
53336fb
Make sure bootstrap checks are bubbled up
leo-ard Apr 7, 2026
d140c05
Refactor encoding
leo-ard Apr 8, 2026
501a29b
Fix differences in bootstrap
leo-ard Apr 8, 2026
8c87dd8
Skip unnamed symbols
leo-ard Apr 8, 2026
003380a
Fix bytecode size regression
leo-ard Apr 9, 2026
36d802b
Add encoding as debugging information
leo-ard Apr 9, 2026
6cafd91
Change rib? with c-rib?
leo-ard Apr 9, 2026
9ac0628
Fix order problem causing a difference in bootstrap
leo-ard Apr 9, 2026
c619234
Fix bug with js target
leo-ard Apr 9, 2026
59af8eb
Build constants in one go without appending them afterwards
leo-ard Apr 11, 2026
e32e2d2
Add and review debugging options
leo-ard Apr 11, 2026
ecbcc2c
Optimize the hash table size and add option to the compiler to config…
leo-ard Apr 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change more things
  • Loading branch information
leo-ard committed Apr 2, 2026
commit dd9bcc049a16c10074e97952f27838d31c084dfb
43 changes: 15 additions & 28 deletions src/rsc.scm
Original file line number Diff line number Diff line change
Expand Up @@ -4300,17 +4300,13 @@
(host-config-feature-add! host-config 'encoding/optimal/sizes (map caddr encoding))
(host-config-feature-add! host-config 'encoding/optimal/start (map cadr encoding)))

(define (encode-hyperbyte stream)
(let loop ((stream stream) (result '()))
(if (pair? stream)
(if (pair? (cdr stream))
(loop (cddr stream)
(cons (+ (* 16 (car stream)) (cadr stream)) result))
(cons (car stream) result))
result)))

(define (encode proc exports host-config byte-stats encoding-name byte-base literal-encoding)

(define compression-range-size-min 70) ;; must be even
(define compression-range-size-max 70)
(define size-base-min 7)
(define size-base-max 13)

(define (calculate-optimal-encoding proc exports host-config ribn-base)
(let* ((symtbl-and-symbols* (encode-symtbl proc exports host-config 20)) ;; we assume 20 shorts, will be re-evaluated
Expand Down Expand Up @@ -4338,18 +4334,22 @@
;; #t
;; (ribn-base)))
))))))
;(encoding-optimal-add-variables encoding host-config)
encoding))

(define (live? . syms)
(let loop ((syms syms))
(if (null? syms)
#f
(if (host-config-feature-live? host-config (car syms))
#t
(loop (cdr syms))))))


;; 1 = 128 codes reserved for compression (128-255)
;; 2 = 64 codes reserved for compression (192-255)

(define compression-range-size 0)
(define compression-range-size-min 70) ;; must be even
(define compression-range-size-max 70)
(define size-base 0)
(define size-base-min 7)
(define size-base-max 13)

(define (ribn-base)
(- byte-base compression-range-size))
Expand All @@ -4361,21 +4361,12 @@
(stream-symtbl #f));; symbols at the beginning of the RIBN

;; dispatch

(define (live? . syms)
(let loop ((syms syms))
(if (null? syms)
#f
(if (host-config-feature-live? host-config (car syms))
#t
(loop (cdr syms))))))

(let*
;; options
((compression/2b? (live? 'compression/lzss/2b))
(compression/tag? (live? 'compression/lzss/tag 'compression/lzss 'compression))
(compression? (or compression/2b? compression/tag?))
(hyperbyte? (live? 'encoding/hyperbyte)))
(compression? (or compression/2b? compression/tag?)))



;; Dispatch logic
Expand Down Expand Up @@ -4413,10 +4404,6 @@
(encoding-inst-get encoding (list 'skip 'int 'long))
(ribn-base)))

;; Apply hyperbyte
(if hyperbyte?
(set! stream (encode-hyperbyte stream)))

;; compression on 92 applies only on the program (not symtbl)
(if (and compression/2b? (eqv? byte-base 92))
(begin
Expand Down
Loading