Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated Resyntax fixes #1150

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 3 additions & 5 deletions infra/ci.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,15 @@
(define success?
(test-successful? test
(errors-score start-error)
(if target-error
(errors-score target-error)
#f)
(and target-error (errors-score target-error))
(errors-score end-error)))

(when (not success?)
(unless success?
(printf "\nInput (~a bits):\n" (errors-score start-error))
(pretty-print (alt-expr start-alt) (current-output-port) 1)
(printf "\nOutput (~a bits):\n" (errors-score end-error))
(pretty-print (alt-expr end-alt) (current-output-port) 1)

(when target-error
(printf "\nTarget (~a bits):\n" (errors-score target-error))
;; internal tool so okay
Expand Down
16 changes: 8 additions & 8 deletions infra/make-index.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@
[else (~r x #:precision 2)]))

(define (bad-result? info)
(or (> (dict-ref info 'tests-crashed 0) 0)
(> (dict-ref info 'tests-unimproved 0) 0)
(> (dict-ref info 'tests-timeout 0) 0)))
(or (positive? (dict-ref info 'tests-crashed 0))
(positive? (dict-ref info 'tests-unimproved 0))
(positive? (dict-ref info 'tests-timeout 0))))

(define (print-rows infos #:name name)
`((thead ((id ,(format "reports-~a" name)) (data-branch ,name))
Expand All @@ -165,7 +165,7 @@
(time ([data-unix ,(~a (field 'date-unix))]) ,(field 'date-short)))
(td (time ([data-ms ,(~a (field 'speed))]) ,(format-time (field 'speed))))
(td ([title ,(field 'commit)]) ,(field 'branch))
(td ,(if (> (field 'tests-available) 0)
(td ,(if (positive? (field 'tests-available))
(format "~a/~a" (field 'tests-passed) (field 'tests-available))
""))
(td ,(if (field 'bits-improved)
Expand All @@ -191,7 +191,7 @@
(partition (λ (x) (set-member? '("master" "develop" "main") (dict-ref (first x) 'branch)))
branch-infos))

(define crashes (filter (λ (x) (> (dict-ref x 'tests-crashed) 0)) (apply append mainline-infos)))
(define crashes (filter (λ (x) (positive? (dict-ref x 'tests-crashed))) (apply append mainline-infos)))
(define last-crash
(if (null? crashes)
#f
Expand Down Expand Up @@ -231,9 +231,9 @@
(script
"window.addEventListener('load', function(){draw_results(d3.select('#accuracy-graph'), d3.select('#speed-graph'))})"))
(table ((id "reports"))
,@(apply append
(for/list ([rows (append mainline-infos other-infos)])
(print-rows rows #:name (dict-ref (first rows) 'branch)))))))
,@(for*/list ([rows (append mainline-infos other-infos)]
[v (in-list (print-rows rows #:name (dict-ref (first rows) 'branch)))])
v))))
out))

(define (get-reports file base)
Expand Down
10 changes: 5 additions & 5 deletions infra/merge.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
(filter (conjoin (negate eof-object?) identity)
(for/list ([dir (in-list dirs)])
(with-handlers ([exn? (const #f)])
(let ([df (call-with-input-file (build-path outdir dir "results.json")
read-datafile)])
(if (eof-object? df)
eof
(cons df dir)))))))
(define df
(call-with-input-file (build-path outdir dir "results.json") read-datafile))
(if (eof-object? df)
eof
(cons df dir))))))
(define dfs (map car rss))
(define joint-rs (merge-datafiles dfs #:dirs dirs))
(write-datafile (build-path outdir "results.json") joint-rs)
Expand Down