libera/#clim - IRC Chatlog
Search
11:18:11
lukego
I'm trying to think of ways to get deeper into CLIM hacking that don't involve distracting maintainers too much. I had an idea now - could it possibly make sense to try doing low-brow differential testing between drawing operations and backends? for example to draw the same scene with e.g. Raster and PDF and SVG (emacs) backends and capture the results into PNGs and ask imagemagick if their similarity is within a certain threshold
11:19:20
lukego
and perhaps to do other low-brow stuff e.g. say that a rotation/translation/scaling should more-or-less preserve the overall distribution of colors in an image regardless of the specific drawing operations that are involved.
11:21:48
lukego
for example I tried applying a rotation transformation in the Emacs backend and the result was surprising - parts of the image seemed to rotate out of the bounding box and disappear - and maybe even quite simple-minded tests could detect that kind of thing and say e.g. whether it is true of other backends too
11:24:36
jackdaniel
lukego: scymtym's master branch has something for comparing images in headless tests
11:31:35
lukego
pardon me popping in and popping out, I am still wrestling with the whole mcclim concept, trying to figure out how to use it in a way that's productive all around, occasionally feeling stuck :)
11:32:22
scymtym
lukego: i wouldn't try to come up with an approximate version of that particular method. on the one hand, i suspect that introducing leeway will make everything too uncertain to be useful (which slight change counts as a regression?). on the other hand, exact comparisons catch things like opacity being 254 vs 255 (yes, that's a real bug). unfortunately, that rules out cross-backend comparison
11:36:40
lukego
I dunno. the bugs I've seen in the Emacs backend lately are e.g. rotation causing clipping - possibly a miscalculated bounding box issue - and e.g. on the dot layout code the bezier curves are completely absent. Seems like both of those could be detected in the low-brained way of seeing that the % of background color is significantly more than it should be wrt a reference e.g. same drawn with raster backend or same drawn w/o rotation
11:39:36
scymtym
i'm not arguing against comparison between backends, but i think if you /automate/ anything, it makes more sense to fully "nail down" the expected output of a given backend
11:40:04
lukego
well maybe I'm misremembering too... I think the bezier curves triggered an NYI kind of error and then I turned them into NOPs and *then* they were absent :) so this testing method idea might be a bit shaky
11:41:31
lukego
scymtym: I dunno, I'm used to doing statistical inferences in automatic testing where exact behaviour is too hard to pin down precisely, e.g. for performance comparisons where benchmarks include a certain amonut of variation, as would e.g. a PDF and SVG rendering of the same scene
11:41:32
jackdaniel
I want to pull it back to core at some point (but retain the extension package for backward compatibility)
11:42:09
scymtym
lukego: does your backend have a separate SVG module like clx-fb uses the render module? that would good for testing and also other use cases
11:44:38
lukego
SVG backend could be used by Emacs, and useful in its own right, and become the basis of a web-based backend too
11:45:42
scymtym
lukego: that would be useful. this seems little known, but McCLIM commands have an optional "output destination" facility which allows redirecting the output to some backend. you use this in listener to say something like ,Show Class Superclasses clim:gadget :output-destination PDF file /tmp/output.pdf
11:47:29
jackdaniel
lukego: like this? https://twitter.com/dk_jackdaniel/status/1245094579994583048/photo/1 ; https://twitter.com/dk_jackdaniel/status/1246099193955041282/photo/1 ?
11:48:59
jackdaniel
this is also nice https://twitter.com/dk_jackdaniel/status/1240346699924680705/photo/1 ; I need to pick up that branch some day