|
20 | 20 | "../syntax/platform.rkt" |
21 | 21 | "../core/points.rkt" |
22 | 22 | "../core/explain.rkt" |
23 | | - "../core/preprocess.rkt" |
24 | 23 | "../utils/profile.rkt" |
25 | 24 | "../utils/timeline.rkt" |
26 | 25 | (submod "../utils/timeline.rkt" debug)) |
|
33 | 32 | (struct-out alt-analysis)) |
34 | 33 |
|
35 | 34 | (struct job-result (command test status time timeline profile warnings backend)) |
36 | | -(struct improve-result (preprocess pcontext start target end)) |
| 35 | +(struct improve-result (pcontext start target end)) |
37 | 36 | (struct alt-analysis (alt errors) #:prefab) |
38 | 37 |
|
39 | 38 | ;; API users can supply their own, weird set of points, in which case |
|
62 | 61 | (error 'get-alternatives "cannnot run without a pcontext")) |
63 | 62 |
|
64 | 63 | (define-values (train-pcontext test-pcontext) (partition-pcontext joint-pcontext)) |
65 | | - ;; TODO: Ignoring all user-provided preprocessing right now |
66 | 64 | (define alternatives (run-improve! (test-input test) (test-spec test) (*context*) train-pcontext)) |
67 | 65 |
|
68 | | - (define preprocessing (alt-preprocessing (first alternatives))) |
69 | | - (define test-pcontext* (preprocess-pcontext (*context*) test-pcontext preprocessing)) |
70 | | - |
71 | 66 | ;; compute error/cost for input expression |
72 | 67 | (define start-expr (test-input test)) |
73 | | - (define start-alt (make-alt-preprocessing start-expr (test-preprocess test))) |
74 | | - (define start-errs (errors start-expr test-pcontext* (*context*))) |
| 68 | + (define start-alt (make-alt start-expr)) |
| 69 | + (define start-errs (errors start-expr test-pcontext (*context*))) |
75 | 70 | (define start-alt-data (alt-analysis start-alt start-errs)) |
76 | 71 |
|
77 | 72 | ;; optionally compute error/cost for input expression |
|
80 | 75 | (for/list ([(expr is-valid?) (in-dict (test-output test))] |
81 | 76 | #:when is-valid?) |
82 | 77 | (define target-expr (fpcore->prog expr (*context*))) |
83 | | - (define target-errs (errors target-expr test-pcontext* (*context*))) |
| 78 | + (define target-errs (errors target-expr test-pcontext (*context*))) |
84 | 79 | (alt-analysis (make-alt target-expr) target-errs))) |
85 | 80 |
|
86 | 81 | ;; compute error/cost for output expression |
87 | 82 | ;; and sort alternatives by accuracy + cost on testing subset |
88 | | - (define test-errs* (batch-errors (map alt-expr alternatives) test-pcontext* (*context*))) |
89 | | - (define sorted-end-exprs (sort-alts alternatives test-errs*)) |
| 83 | + (define test-errs (batch-errors (map alt-expr alternatives) test-pcontext (*context*))) |
| 84 | + (define sorted-end-exprs (sort-alts alternatives test-errs)) |
90 | 85 | (define end-exprs (map (compose alt-expr car) sorted-end-exprs)) |
91 | 86 | (define end-errs (map cdr sorted-end-exprs)) |
92 | 87 | (define end-data (map alt-analysis alternatives end-errs)) |
93 | 88 |
|
94 | | - (improve-result preprocessing test-pcontext* start-alt-data target-alt-data end-data)) |
| 89 | + (improve-result test-pcontext start-alt-data target-alt-data end-data)) |
95 | 90 |
|
96 | 91 | (define (get-cost test) |
97 | 92 | (define cost-proc (platform-cost-proc (*active-platform*))) |
|
219 | 214 | (define (dummy-table-row-from-hash result-hash status link) |
220 | 215 | (define test (car (load-tests (open-input-string (hash-ref result-hash 'test))))) |
221 | 216 | (define repr (test-output-repr test)) |
222 | | - (define preprocess |
223 | | - (if (eq? (hash-ref result-hash 'status) 'success) |
224 | | - (map (compose read open-input-string) |
225 | | - (hash-ref (hash-ref result-hash 'backend) 'preprocessing)) |
226 | | - (test-preprocess test))) |
227 | 217 | (table-row (test-name test) |
228 | 218 | (test-identifier test) |
229 | 219 | status |
230 | 220 | (prog->fpcore (test-pre test) (test-context test)) |
231 | | - preprocess |
232 | 221 | (representation-name repr) |
233 | 222 | '() ; TODO: eliminate field |
234 | 223 | (test-vars test) |
|
0 commit comments