anchor.diff:  (in-package :autobench-web)
   
  -(defparameter *bugfix-revision* 2)
  +(defparameter *bugfix-revision* 3)
   
   (defparameter *go-back-days* 50)
   (defparameter *ignore-benchmarks* '(quote ("MAKE-LIST-SEQUENTIAL/RPLACD" "MAKE-LIST-SEQUENTIAL/PUSH-NREVERSE" "CRC40")))
   
   (defclass atom-handler (handler) ())
   
  -(defun explain-change (day benchmark impl from-revision to-revision from to)
  +(defun digits-format-string (avg stderr)
  +  (let ((post-dec (if (zerop stderr)
  +                      1
  +                      (ceiling (log (/ avg stderr) 10)))))
  +  (format nil "~~~A,~AF"
  +          1
  +          post-dec)))
  +
  +(defun summarize-day/benchmark (day benchmark impl from to f-err t-err)
     `(|li| ,(format nil "Run time for benchmark <a href=\"~A\">~A</a> ~
  -                       ~A from ~As to ~As between ~A revision ~A and ~A"
  +                       ~A from (~@? &#xb1; ~@?)s to (~@? &#xb1; ~@?)s" 
                      (html-escape (format nil "http://sbcl.boinkor.net/bench/?HOST=~A&IMPLEMENTATIONS=~A&ONLY-RELEASE=~A#~A"
                                           "walrus.boinkor.net" ; FIXME
                                           impl (release-on-day impl day) benchmark))
                       benchmark
                      (if (< from to) "increased" "decreased")
  -                   from to impl from-revision to-revision)))
  -
  -(defun revision-on-day (day p-day impl benchmark which)
  -  (apply #'values
  -         (pg-result
  -          (pg-exec *dbconn*
  -                   (translate
  -                    `(select (version (avg seconds))
  -                             (group-by
  -                              (where (join version result
  -                                           :on (and (= v-name i-name) (= v-version version)))
  -                                     (and (= i-name ,impl)
  -                                          (= b-name ,benchmark)
  -                                          (= release-date
  -                                             (select ((,which release-date))
  -                                                     (where
  -                                                      version
  -                                                      (and
  -                                                       (= i-name ,impl)
  -                                                       (between release-date
  -                                                                (- (to_universal_time "today") (* 86400 ,day))
  -                                                                (- (to_universal_time "today") (* 86400 ,p-day)))))))))
  -                              (version)))))
  -          :tuple 0)))
  -
  -(defun summarize-day/benchmark (day p-day pp-day b-name v-name)
  -  (multiple-value-bind (first-r first-sec) (revision-on-day day p-day v-name b-name 'min)
  -    (multiple-value-bind (last-r last-sec) (revision-on-day p-day pp-day v-name b-name 'max)
  -      (explain-change day b-name v-name first-r last-r first-sec last-sec))))
  +                   (digits-format-string from f-err) from
  +                   (digits-format-string from f-err) f-err
  +                   (digits-format-string to t-err) to
  +                   (digits-format-string to t-err) t-err)))
   
   (defun days-ago (days)
     (- (get-universal-time) (* 86400 days)))
  
positive.code:   (first
     (pg-result
      (pg-exec *dbconn*
                (translate
                `(limit (select (version)
                                (order-by
                                 (where version
                                        (and
                                         (<= release-date
                                            (select ((max release-date))
                                                    (where version
                                                           (<= release-date
                                                               (- (to_universal_time "today") (* 86400 ,(1- day)))))))
                                         is-release
                                         (= ,impl i-name)))
                                 (release-date) :desc))
  
negative.code:                        (|id| ,(format nil "tag:sbcl.boinkor.net,~A:/bench/~A" (format-readable-decoded-time day) implementation))
                         (|created| ,(format-atom-decoded-time day))
                         (|author|
                          (|name| ,(format nil "~A Benchmark runner on ~A" implementation host))
                          (|email| "sbcl-arch@boinkor.net"))
                         ((|content| |type| "application/xhtml+xml" |mode| "xml" |xml:base| "http://sbcl.boinkor.net/bench/")
                          ((|div| |xmlns| "http://www.w3.org/1999/xhtml")
  