kyak changed the topic of #qi-hardware to: Copyleft hardware - http://qi-hardware.com | hardware hackers join here to discuss Ben NanoNote, atben/atusb 802.15.4 wireless, anelok and other community driven hw projects | public logging at http://en.qi-hardware.com/irclogs and http://irclog.whitequark.org/qi-hardware
limpkin has joined #qi-hardware
fengling has joined #qi-hardware
sandeepkr has quit [Ping timeout: 244 seconds]
archang has joined #qi-hardware
DocScrutinizer05 has quit [Disconnected by services]
DocScrutinizer05 has joined #qi-hardware
luke-jr has quit [Ping timeout: 260 seconds]
luke-jr has joined #qi-hardware
incomprehensibly has quit [Ping timeout: 240 seconds]
incomprehensibly has joined #qi-hardware
apelete_ has joined #qi-hardware
apelete has quit [Remote host closed the connection]
archang has quit [Ping timeout: 272 seconds]
dandon has joined #qi-hardware
dandon has quit [Quit: .]
dandon has joined #qi-hardware
doomlord has joined #qi-hardware
apelete_ is now known as apelete
pcercuei has joined #qi-hardware
dandon has quit [Quit: .]
dandon has joined #qi-hardware
<whitequark> wpwrak: btw, any luck using solvespace yet?
<whitequark> as an aside, I discovered recently that, only on the gtk port, the tab keybinding was broken
<whitequark> (it shows and hides the text window)
mth has quit []
mth has joined #qi-hardware
<wpwrak> oh, having a "hotkey" sounds nice
<wpwrak> and i haven't tried anything "real" yet. for something major i'd really need variables / stored expressions and possibly tables (computed repetitions)
<wpwrak> i 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 scratch
<wpwrak> that 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"
fengling has quit [Ping timeout: 240 seconds]
<whitequark> (variables/stored expressions) ack. that's on the roadmap "soon", meaning right after unit tests
<whitequark> adding unit tests is... involved
<whitequark> an 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 computation
sandeepkr has joined #qi-hardware
<whitequark> this 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 bar
<whitequark> but this makes e.g. rendering to a cairo surface impossible
<whitequark> and 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 platforms
<whitequark> this is very aggravating.
<whitequark> actually, s/unit tests/integration tests/, but the rest is unchanged.
<whitequark> wpwrak: (ball of messed-up things) can you clarify?
<whitequark> you can check the "relax constraints and dimensions" checkbox in the group properties
<whitequark> that lets you to move things around freely without invoking the solver.
mth has quit [Ping timeout: 260 seconds]
<whitequark> (undo) the undo stack is 10 levels deep, which to me seems very silly.
<whitequark> it's mainly that short because of memory management, or lack thereof. it's just a static array.
<whitequark> i 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)
mth has joined #qi-hardware
<wpwrak> (gui unit test) sounds nasty. but you could perhaps test the underlying geometry, if that's something you're not testing yet
<wpwrak> (shallow undo) yes, agreed. being able to change history is a nice feature :)
<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 values
<whitequark> oh yeah
<wpwrak> what happened then is that the while thing reconfigured itself to a completely new topology, and wouldn't flip back to the original topology.
<whitequark> ohhhhh
<whitequark> yeah this is a well known problem
<whitequark> the underlying cause is that many constraints are not signed
<wpwrak> yup. those implicit constrainrs
<whitequark> and so they have bistable configurations
<whitequark> you can explicitly flip them in some cases by entering a negative value for a dimension
<wpwrak> just what i thought :)
<whitequark> or, you can "relax all constraints and dimensions"
<wpwrak> hmm :)
<whitequark> but really none of that is a real solution because this would break hilariously with parametric sketches
<whitequark> the real solution is to make them signed.
<wpwrak> if it's just signs, maybe some sort of "sign flip" tool could be useful ?
<whitequark> yes, there's one.
<whitequark> enter a negative value for a dimension.
<whitequark> it will flip the sign.
<wpwrak> i was thinking more of something clickable :) show all the things there the sign could be reversed, then experiment
<wpwrak> s/there/where/
<whitequark> that's dressing up a bug instead of fixing it
<whitequark> e.g. imagine a hexagon, constrained in the obvious way. say a hex head screw cap
<wpwrak> well, the signs are somewhat arbitrary from a user perspective anyway
<whitequark> now if it's a parametric sketch and you instantiate it with a value 2, it works
<whitequark> if then you re-instantiate it with a value 10, then it's going to get all inside out
<whitequark> and transform into a david's star
mth has quit [Ping timeout: 246 seconds]
<whitequark> the real solution to this is to make solver never flip signs of constraints. right now they are ignored.
<wpwrak> ah yes, that would help a lot
<whitequark> we have actually implemented this, but it didn't work out very well because the old files don't store sign
<whitequark> and breaking backwards compat is a major no
<wpwrak> if there are multiple choices, does it prefer non-self-intersecting solutions over self-intersecting ones, or does that not influence the result ?
<whitequark> so... you know... unit tests... that's how i realized we HAD to have them.
<whitequark> it doesn't care.
<wpwrak> might be another useful guide
<whitequark> the solver is wholly unaware that geometry exists, it solves a system of linear equations, in the straightforward way
<whitequark> moreover, it does not find more than one solution, ever
<whitequark> and it cannot, not with the method of solving we're using
<whitequark> so searching for a non-intersecting geometry, unless it can be straightforwardly expressed as more equations, isn't going to work
<wpwrak> hmm, and it's probably too slow to just do this by trying combinations
<whitequark> yes.
<whitequark> and it's not like it has combinations, the space easily has a massive amount of dimensions
<whitequark> I'm pretty sure one can write a PhD or two on the topic
<wpwrak> well, you could first find all the signs that can be tweaked, then try +++++. ++++-, etc.
<whitequark> better just avoid the sign problem entirely.
<wpwrak> but, combinatory explosion
<whitequark> yes. that's unviable.
<whitequark> it's already slow as it is, without even adding this sort of complexity
<wpwrak> you could probably come up with very clever heuristics that keep the number of guesses low :)
<whitequark> I don't see a point.
<whitequark> like I said, the solution is to avoid the bug entirely, not dressing it up.
<wpwrak> i.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.
<wpwrak> but yes, if you can avoid it nicely, even better
<whitequark> (gui integration tests) there are currently 0 tests in the solvespace codebase
<whitequark> and testing geometry without rendering it is orders of magnitude harder even
<whitequark> but 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...
<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 ;-)
<whitequark> there's a small part of the geometric core exposed as a library but it doesn't have NURBS booleans, meshes, etc, etc
<whitequark> doesn't even have groups, IIRC
<whitequark> just 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 reasons
<whitequark> i 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 API
<whitequark> since the API is much more work, this will allow me to iterate on other things that have a high bug introducing potential earlier
<wpwrak> yeah, 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.
<whitequark> yes, you can test most of the things within a single group using the exposed core
<wpwrak> also, 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.
<whitequark> that's not where most bugs are created though, since that part of code is quite robust and also I basically never change them
<whitequark> "1% of pixels" is a poor metric. an error message can well be under 1% of red pixels
<whitequark> moreover, if I accidentally introduce a floating point instability or something like that, I absolutely do want to be alerted. it ought to be deterministic.
<wpwrak> print errors to stderr and check them separately :)
<whitequark> that's just piling more hacks on already bad code.
<wpwrak> yes, but the floating point problem would show up on the numerical tests. unless you hit something that breaks opengl
<wpwrak> divide and conquer ;-)
<whitequark> the numerical tests do not cover most of the code
<whitequark> most of the code in solvespace deals with meshes, NURBS, and drawing sketches
<whitequark> as well as loading and saving various files
<whitequark> I'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 it
<whitequark> but 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...
<whitequark> generating meshes is a whole separate can of worms still
<wpwrak> that 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.
<whitequark> yes. roundtrip testing is exactly what i'm going to do, both with savefiles and on-screen rendering contents
<wpwrak> drawing constraints may be tricky. also because there may be many correct answers
<whitequark> except no epsilon, because again, that's just setting yourself out for failure.
<wpwrak> but 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 way
<whitequark> if 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.
<whitequark> well... it's not quite that dramatic.
<whitequark> i'll export the rendered results in a way that allows quick visual compare. (a/b slider, if you've seen the one on github)
<whitequark> so once you're done with that, you can quickly go through the tests and "approve" (really just git add) them
<wpwrak> (no epsilon) if save->load->save naturally converges, even better
<whitequark> it shouldn't change.
<whitequark> well. 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 so
<whitequark> and if there's an error within those, things are bad
<wpwrak> (visual compare) yup, never underestimate the computing power of that piece of wetware ;-)
<whitequark> there's also testing the text window itself...
<wpwrak> dump as ascii ? :)
<whitequark> it uses a printf-like facility right now, with every piece of styling set up using vt52-like escape codes
<wpwrak> could it get any easier ? ;-)
<whitequark> which is absolutely unmaintainable, among other things
<whitequark> well. no. comparing to known text result isn't especially interesting
<whitequark> what *is* interesting is driving the UI tests through the parts where one clicks on a link.
<whitequark> this is internally done by printf'ing a function pointer, which is then magically recorded inside the "framebuffer"
<wpwrak> neat ;)
<whitequark> "neat" is not the word I'd use
<wpwrak> just run it under valgrind every now and then :)
<whitequark> for one, it requires lots of completely unnecessary global state, because pointers to members aren't compatible with C function pointers
<whitequark> and so all the callbacks have to be static
<whitequark> (in the C++ sense, that is, nonmembers, with no access to member data)
<whitequark> for another, this is making testing really hard
<whitequark> like, I cannot use the link name, because there are often many links with the same name
<whitequark> and using link position in absolute coordinates makes tests very fragile
<wpwrak> name + #occurrence ?
<whitequark> that's not an especially bad solution, although it still is fragile
<whitequark> e.g. think of the configuration screen with lots of [edit]
<wpwrak> iterative search: patter/pattern/pattern/name
<whitequark> do I edit fifty tests every time I add a field?
<whitequark> bleh
<whitequark> worst of all, this design of the text window makes internationalization wholly impossible
<whitequark> even if I fed the input of every printf into gettext, no translator is able to make sense of it
<wpwrak> sed 's/edit/editieren/g;s/save/sichern/g; ...'
<whitequark> very funny.
<wpwrak> use pictograms instead of words :)
<whitequark> well, what i'm going to do with the text window is, most likely, add some sort of templating system
<whitequark> not unlike a backend of a website, except without the "web" part
<wpwrak> unleash 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 :)
<whitequark> and then I have a clean interface that I can rather easily test
<wpwrak> sounds reasonable
<whitequark> even better, I never have to encipher styling into the baroque vt52-but-not-really codes again
<whitequark> I am *so* looking forward to that
<wpwrak> you could always use <xml> :)
<whitequark> I've considered just embedding a web browser there.
<wpwrak> though vt52 is nicely retro
<whitequark> it's not actually related to vt52 in any way, it just uses escape sequences that set colors, etc
<wpwrak> next step: have sub-screens for ascii-art that is then converted to pixmaps :)
<whitequark> I find actual vt52 escape codes *far* more readable than this system
<whitequark> which is... an impressive achievement
<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 MSIE
<whitequark> and then I reconsidered.
<whitequark> because 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.
<whitequark> there's also The Language Not To Be Named Which Makes It Impossible To Center Things Vertically
<wpwrak> hmm, not sure if i met that one
<whitequark> CSS :)
<whitequark> meaning, 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 look
<whitequark> this just makes it harder and harder to maintain a consistent look and feel
<whitequark> the editor/color picker would have to become javascript... meh
<wpwrak> ah yes, css definitely puts a lot of complexity into things
<whitequark> like, I know web dev, I did it commercially for many years
<whitequark> which is exactly why /I do not want to add webdev here/
fengling has joined #qi-hardware
<whitequark> honestly the thing that surprises me most is people who did webdev for years who want other things to be more like webdev
<wpwrak> if you're a hammer, you want everything to look like a nail :)
<whitequark> what if you're a hammer with a massive migraine
fengling has quit [Ping timeout: 240 seconds]
<wpwrak> that's part of the job description :)
mth has joined #qi-hardware
fengling has joined #qi-hardware
fengling has quit [Ping timeout: 240 seconds]
pcercuei has quit [Quit: Lost terminal]
pcercuei has joined #qi-hardware
wpwrak has quit [Read error: Connection reset by peer]
wpwrak has joined #qi-hardware
fengling has joined #qi-hardware
fengling has quit [Ping timeout: 240 seconds]
pcercuei has quit [Quit: leaving]
fengling has joined #qi-hardware
fengling has quit [Ping timeout: 240 seconds]
sandeepkr has quit [Ping timeout: 260 seconds]
fengling has joined #qi-hardware
fengling has quit [Ping timeout: 240 seconds]
fengling has joined #qi-hardware
fengling has quit [Ping timeout: 240 seconds]
<larsc> but 48% of them died this winter
fengling has joined #qi-hardware
fengling has quit [Ping timeout: 240 seconds]
mth has quit [Ping timeout: 250 seconds]
mth has joined #qi-hardware
fengling has joined #qi-hardware
fengling has quit [Ping timeout: 240 seconds]
mth has quit [Ping timeout: 246 seconds]
mth has joined #qi-hardware
fengling has joined #qi-hardware
fengling has quit [Ping timeout: 240 seconds]
doomlord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
doomlord has joined #qi-hardware
mth has quit [Ping timeout: 258 seconds]
mth has joined #qi-hardware
mth has quit [Ping timeout: 244 seconds]
doomlord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
doomlord has joined #qi-hardware
doomlord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fengling has joined #qi-hardware
fengling has quit [Ping timeout: 240 seconds]
mth has joined #qi-hardware
MistahDarcy has joined #qi-hardware
MistahDarcy has quit [Changing host]
MistahDarcy has joined #qi-hardware
MistahDarcy has quit [Excess Flood]
doomlord has joined #qi-hardware
mth has quit [Ping timeout: 276 seconds]
doomlord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fengling has joined #qi-hardware
fengling has quit [Ping timeout: 240 seconds]
doomlord has joined #qi-hardware
mth has joined #qi-hardware
doomlord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]