#qi-hardware IRC log for Tuesday, 2016-05-24

--- Tue May 24 201600:00
whitequarkwpwrak: btw, any luck using solvespace yet?09:24
whitequarkas an aside, I discovered recently that, only on the gtk port, the tab keybinding was broken09:25
whitequark(it shows and hides the text window)09:25
wpwrakoh, having a "hotkey" sounds nice12:27
wpwrakand i haven't tried anything "real" yet. for something major i'd really need variables / stored expressions and possibly tables (computed repetitions)12:29
wpwraki also found difficulties in the workflow. e.g., often enough, it seems to turn everything into a ball of messed-up things that i can only get out with "undo" or by restarting from scratch12:29
wpwrakthat happens mainly if i start with something that in the end doesn't need to be at the center of the construction. might actually help if one could just freeze recomputing, perform a set of changes, then try to recompute, and hurriedly get back again if recomputing results in the "ball"12:31
whitequark(variables/stored expressions) ack. that's on the roadmap "soon", meaning right after unit tests12:43
whitequarkadding unit tests is... involved12:43
whitequarkan example of why it's involved is that currently the rendering is done by calling opengl all over the place, and sometimes even invoking the GUI message loop in a middle of computation12:44
whitequarkthis already fails with offscreen rendering (that is needed to overlay the editor on Linux and OS X), since... well... if the message loop is not running because it's preempted by a long computation, there's nothing to flip the buffers to show the "long computation" progress bar12:44
whitequarkbut this makes e.g. rendering to a cairo surface impossible12:45
whitequarkand rendering to gl for unit tests means it's impossible to have reference rendering in the repo, because opengl has major differences in rendering on ifferent platforms12:45
whitequarkthis is very aggravating.12:45
whitequarkactually, s/unit tests/integration tests/, but the rest is unchanged.12:45
whitequarkwpwrak: (ball of messed-up things) can you clarify?12:46
whitequarkyou can check the "relax constraints and dimensions" checkbox in the group properties12:46
whitequarkthat lets you to move things around freely without invoking the solver.12:47
whitequark(undo) the undo stack is 10 levels deep, which to me seems very silly.12:48
whitequarkit's mainly that short because of memory management, or lack thereof. it's just a static array.12:49
whitequarki feel like a more proper "history" view ought to exist, like in photoshop (that allows you to go back and forth, and even says what action caused the undo state to be pushed)12:49
wpwrak(gui unit test) sounds nasty. but you could perhaps test the underlying geometry, if that's something you're not testing yet12:54
wpwrak(shallow undo) yes, agreed. being able to change history is a nice feature :)12:55
wpwrak(ball of things) one mistake i made when trying the "wedge" shape of anelok was that i just accepted default dimensions and tried at the end to set the right, much smaller values12:56
whitequarkoh yeah12:56
wpwrakwhat happened then is that the while thing reconfigured itself to a completely new topology, and wouldn't flip back to the original topology.12:57
whitequarkohhhhh12:57
whitequarkyeah this is a well known problem12:57
whitequarkthe underlying cause is that many constraints are not signed12:57
wpwrakyup. those implicit constrainrs12:57
whitequarkand so they have bistable configurations12:57
whitequarkyou can explicitly flip them in some cases by entering a negative value for a dimension12:57
wpwrakjust what i thought :)12:57
whitequarkor, you can "relax all constraints and dimensions"12:57
wpwrakhmm :)12:57
whitequarkbut really none of that is a real solution because this would break hilariously with parametric sketches12:58
whitequarkthe real solution is to make them signed.12:58
wpwrakif it's just signs, maybe some sort of "sign flip" tool could be useful ?12:58
whitequarkyes, there's one.12:58
whitequarkenter a negative value for a dimension.12:58
whitequarkit will flip the sign.12:58
wpwraki was thinking more of something clickable :) show all the things there the sign could be reversed, then experiment12:59
wpwrak s/there/where/12:59
whitequarkthat's dressing up a bug instead of fixing it12:59
whitequarke.g. imagine a hexagon, constrained in the obvious way. say a hex head screw cap12:59
wpwrakwell, the signs are somewhat arbitrary from a user perspective anyway12:59
whitequarknow if it's a parametric sketch and you instantiate it with a value 2, it works12:59
whitequarkif then you re-instantiate it with a value 10, then it's going to get all inside out13:00
whitequarkand transform into a david's star13:00
whitequarkthe real solution to this is to make solver never flip signs of constraints. right now they are ignored.13:00
wpwrakah yes, that would help a lot13:00
whitequarkwe have actually implemented this, but it didn't work out very well because the old files don't store sign13:01
whitequarkand breaking backwards compat is a major no13:01
wpwrakif there are multiple choices, does it prefer non-self-intersecting solutions over self-intersecting ones, or does that not influence the result ?13:01
whitequarkso... you know... unit tests... that's how i realized we HAD to have them.13:01
whitequarkit doesn't care.13:01
wpwrakmight be another useful guide13:01
whitequarkthe solver is wholly unaware that geometry exists, it solves a system of linear equations, in the straightforward way13:02
whitequarkmoreover, it does not find more than one solution, ever13:02
whitequarkand it cannot, not with the method of solving we're using13:02
whitequarkso searching for a non-intersecting geometry, unless it can be straightforwardly expressed as more equations, isn't going to work13:02
wpwrakhmm, and it's probably too slow to just do this by trying combinations13:03
whitequarkyes.13:03
whitequarkand it's not like it has combinations, the space easily has a massive amount of dimensions13:03
whitequarkI'm pretty sure one can write a PhD or two on the topic13:04
wpwrakwell, you could first find all the signs that can be tweaked, then try +++++. ++++-, etc.13:04
whitequarkbetter just avoid the sign problem entirely.13:04
wpwrakbut, combinatory explosion13:04
whitequarkyes. that's unviable.13:04
whitequarkit's already slow as it is, without even adding this sort of complexity13:05
wpwrakyou could probably come up with very clever heuristics that keep the number of guesses low :)13:05
whitequarkI don't see a point.13:05
whitequarklike I said, the solution is to avoid the bug entirely, not dressing it up.13:05
wpwraki.e., based on the assumption that people will tend to intervene when the design moves in an unintended direction. so it would usually be just the last one or two edits that may have had an unintended interpretation.13:06
wpwrakbut yes, if you can avoid it nicely, even better13:06
whitequark(gui integration tests) there are currently 0 tests in the solvespace codebase13:07
whitequarkand testing geometry without rendering it is orders of magnitude harder even13:07
whitequarkbut more importantly, it doesn't actually test that e.g. it can be created, that dragging stuff around doesn't cause crashes, that the menus and links in text window work...13:07
wpwrak(compatibility) you could just use the old interpretation and store a (* 1, * -1) flag for newer designs. it have a global format version somewhere ;-)13:07
whitequarkthere's a small part of the geometric core exposed as a library but it doesn't have NURBS booleans, meshes, etc, etc13:08
whitequarkdoesn't even have groups, IIRC13:08
whitequarkjust the solver within a single group. so that's not very useful. and similarly it doesn't know how to load things, and cannot be easily taught to, for complicated reasons13:09
whitequarki decided to go with integration tests based on rendering first, and perhaps once i have a proper API and Python or Lua bindings, test it directly using that API13:09
whitequarksince the API is much more work, this will allow me to iterate on other things that have a high bug introducing potential earlier13:10
wpwrakyeah, tricky. but i guess you could test anything 2D by just driving the underlying engine. it often helps to split a complex testing problem into different tests of subsystems. so one would just look at a bunch of numbers, another at a sceenshot, etc.13:10
whitequarkyes, you can test most of the things within a single group using the exposed core13:10
wpwrakalso, your tests don't need to be exact. i.e., you could let them pass if, say, 1% of pixels are off. or whatever metric you find useful. such tests would still alert you if there's a major screw-up.13:11
whitequarkthat's not where most bugs are created though, since that part of code is quite robust and also I basically never change them13:11
whitequark"1% of pixels" is a poor metric. an error message can well be under 1% of red pixels13:11
whitequarkmoreover, if I accidentally introduce a floating point instability or something like that, I absolutely do want to be alerted. it ought to be deterministic.13:11
wpwrakprint errors to stderr and check them separately :)13:12
whitequarkthat's just piling more hacks on already bad code.13:12
wpwrakyes, but the floating point problem would show up on the numerical tests. unless you hit something that breaks opengl13:12
wpwrakdivide and conquer ;-)13:12
whitequarkthe numerical tests do not cover most of the code13:13
whitequarkmost of the code in solvespace deals with meshes, NURBS, and drawing sketches13:13
whitequarkas well as loading and saving various files13:13
whitequarkI'm actually not concerned about testing the geometric core because it's very simple and I don't think I've *ever* introduced a problem into it13:13
whitequarkbut e.g. drawing constraints? that's a thousand lines of extremely complicated control flow that depends on many factors like scale, font size, exact positioning, camera angle...13:14
whitequarkgenerating meshes is a whole separate can of worms still13:14
wpwrakthat should be easy: have known input, load, then save, compare the results. if the match in content, use the saves one as your input. add a bit of epsilon so that you don't end up chasing your own tail.13:15
whitequarkyes. roundtrip testing is exactly what i'm going to do, both with savefiles and on-screen rendering contents13:15
wpwrakdrawing constraints may be tricky. also because there may be many correct answers13:15
whitequarkexcept no epsilon, because again, that's just setting yourself out for failure.13:16
wpwrakbut i guess there's only so much you can do. if you're unlucky, a minor tweak will invalidate most of your tests, even though the result is still correct, just in a different way13:16
whitequarkif it doesn't match, then there is a reason, and you better find and fix it. knowing why that happened is even more important than actually fixing the problem.13:16
whitequarkwell... it's not quite that dramatic.13:16
whitequarki'll export the rendered results in a way that allows quick visual compare. (a/b slider, if you've seen the one on github)13:17
whitequarkso once you're done with that, you can quickly go through the tests and "approve" (really just git add) them13:17
wpwrak(no epsilon) if save->load->save naturally converges, even better13:17
whitequarkit shouldn't change.13:17
whitequarkwell. the only reason for nondeterminism i see is ieee754 error, but for that we don't save with the *entire* double precision, i think there are 6 significant digits or so13:18
whitequarkand if there's an error within those, things are bad13:18
wpwrak(visual compare) yup, never underestimate the computing power of that piece of wetware ;-)13:18
whitequarkthere's also testing the text window itself...13:19
wpwrakdump as ascii ? :)13:19
whitequarkit uses a printf-like facility right now, with every piece of styling set up using vt52-like escape codes13:19
wpwrakcould it get any easier ? ;-)13:19
whitequarkwhich is absolutely unmaintainable, among other things13:19
whitequarkwell. no. comparing to known text result isn't especially interesting13:20
whitequarkwhat *is* interesting is driving the UI tests through the parts where one clicks on a link.13:20
whitequarkthis is internally done by printf'ing a function pointer, which is then magically recorded inside the "framebuffer"13:20
wpwrakneat ;)13:21
whitequark"neat" is not the word I'd use13:21
wpwrakjust run it under valgrind every now and then :)13:21
whitequarkfor one, it requires lots of completely unnecessary global state, because pointers to members aren't compatible with C function pointers13:21
whitequarkand so all the callbacks have to be static13:22
whitequark(in the C++ sense, that is, nonmembers, with no access to member data)13:22
whitequarkfor another, this is making testing really hard13:22
whitequarklike, I cannot use the link name, because there are often many links with the same name13:22
whitequarkand using link position in absolute coordinates makes tests very fragile13:22
wpwrakname + #occurrence ?13:23
whitequarkthat's not an especially bad solution, although it still is fragile13:23
whitequarke.g. think of the configuration screen with lots of [edit]13:23
wpwrakiterative search: patter/pattern/pattern/name13:23
whitequarkdo I edit fifty tests every time I add a field?13:23
whitequarkbleh13:24
whitequarkworst of all, this design of the text window makes internationalization wholly impossible13:24
whitequarkeven if I fed the input of every printf into gettext, no translator is able to make sense of it13:24
wpwraksed 's/edit/editieren/g;s/save/sichern/g; ...'13:25
whitequarkvery funny.13:25
wpwrakuse pictograms instead of words :)13:25
whitequarkwell, what i'm going to do with the text window is, most likely, add some sort of templating system13:26
whitequarknot unlike a backend of a website, except without the "web" part13:26
wpwrakunleash the inner artist ! once you're comfortable with the approach, you can move to truly abstract stuff the experts will try to interpret for decades :)13:26
whitequarkand then I have a clean interface that I can rather easily test13:26
wpwraksounds reasonable13:27
whitequarkeven better, I never have to encipher styling into the baroque vt52-but-not-really codes again13:27
whitequarkI am *so* looking forward to that13:27
wpwrakyou could always use <xml> :)13:27
whitequarkI've considered just embedding a web browser there.13:27
wpwrakthough vt52 is nicely retro13:27
whitequarkit's not actually related to vt52 in any way, it just uses escape sequences that set colors, etc13:27
wpwraknext step: have sub-screens for ascii-art that is then converted to pixmaps :)13:28
whitequarkI find actual vt52 escape codes *far* more readable than this system13:28
whitequarkwhich is... an impressive achievement13:28
whitequark(web browser) but then I looked at the size of such a dependency, and then I realized that not using gtk or qt on Windows means using the engine of MSIE13:30
whitequarkand then I reconsidered.13:30
whitequarkbecause it's actually not at all hard to make a minimal layout system that just does the 3.5 things the existing text window needs.13:30
whitequarkthere's also The Language Not To Be Named Which Makes It Impossible To Center Things Vertically13:31
wpwrakhmm, not sure if i met that one13:32
whitequarkCSS :)13:33
whitequarkmeaning, if I used HTML+CSS, then for many things the text window currently uses I'd have to use a specific combination of HTML and CSS patterns to achieve the desired look13:33
whitequarkthis just makes it harder and harder to maintain a consistent look and feel13:33
whitequarkthe editor/color picker would have to become javascript... meh13:34
wpwrakah yes, css definitely puts a lot of complexity into things13:34
whitequarklike, I know web dev, I did it commercially for many years13:35
whitequarkwhich is exactly why /I do not want to add webdev here/13:35
whitequarkhonestly the thing that surprises me most is people who did webdev for years who want other things to be more like webdev13:37
wpwrakif you're a hammer, you want everything to look like a nail :)13:38
whitequarkwhat if you're a hammer with a massive migraine13:39
wpwrakthat's part of the job description :)13:42
whitequarkhmmmm https://www.washingtonpost.com/news/wonk/wp/2015/07/23/call-off-the-bee-pocalypse-u-s-honeybee-colonies-hit-a-20-year-high/18:36
larscbut 48% of them died this winter18:37
--- Wed May 25 201600:00

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!