4 ms·
The answer for successfully applying VCS to higher-dimensional spaces will demand more mathematically-elegant intermediate representations. Most source code fil
by bob1029 5y ago
The answer for successfully applying VCS to higher-dimensional spaces will demand more mathematically-elegant intermediate representations. Most source code files are highly structured by default. Image files are mostly feasible to diff as-is. Typical 3d models, not so much. 3d models with animation, even less so.
To be clear - the problem isn't that we cant detect a difference, it's that we cannot produce a useful view of the difference such that a human can make an informed decision. With images/audio/code, you can still extract useful knowledge as long as you know the shape of the difference relative to the whole, even if the difference itself is a meaningless mesh of colors between 2 image files.
Writing a useful diff engine for 3d models represented using constructive solid geometry would probably be substantially easier than with other approaches. I don't know if CSG is actually constrained to 3 dimensions either... I feel like GitHub actually tried to do something like this but I don't know if it went very far.
- bob1029 5y agoHere is the GH blog post I'm thinking of from 2013: https://github.blog/2013-09-17-3d-file-diffs/ https://github.blog/2013-09-17-3d-file-diffs/
- baybal2 5y agoMost CADs are already history based, and in fact can't work without it. A much bigger challenge is to make a historyless CAD AKA "direct modelling" I honestly admit, I failed to understand how geometry solvers of direct modelling CADs work.
- teamonkey 5y agoIt’s easy to represent 3D data as JSON polygon soup, which can then be diffed and merged as text. A lot of game engines store geometry data in this way. It often works fine until there’s a merge conflict, at which point things become difficult. Revisions A and B have, as part of their changes, both modified vertices originally on lines 437 and 7689, and A has changed 5678 while B has deleted it. It’s often easier to discard one revision and redo the work in-order, rather than try to resolve.
- adamnemecek 5y ago> To be clear - the problem isn't that we cant detect a difference, it's that we cannot produce a useful view of the difference such that a human can make an informed decision. The comment is not talking about diffing JSONs but being able to understand what the difference means.
- teamonkey 5y agoYes, exactly. I was providing an example.
- josephg 5y agoI've been working in the collaborative editing space for a decade now (!) and I think this problem is simply a consequence of an age old architectural mistake that we persist because we don't know any better. The problem is that the filesystem acts as a dumb blob store that doesn't understand changes. And it doesn't understand any of the semantics of what its storing. Its a lovely abstraction - but it has bullied us into the age old "load / edit / save" workflow. And that workflow just isn't very good: - Its slower for the computer - because no matter how incremental, the computer has to rewrite the entire file to disk - Its buggy by default. A power loss or malfunction can and will result in a corrupt save file. You can fix this with careful use of fsync() and renames, but almost nobody does that correctly because its complicated and confusing. And it makes saving slower. You see this all the time in video games - "When you see this symbol, don't turn off your console". - Because you only give the OS snapshots in time, you end up discarding information about the changes that have happened along the way. With code editing we work around this with diff-match-patch, but its lossy, not realtime, and not good enough for collaborative editing. With more complex data (like 3d models) this problem is much more egregious. There's no reason the modelling program couldn't output a fine grained sequence of changes as they're made by the user. Any collaborative editor already does this. Having a rich set of changes gives us way more options for merging - eg, they could be merged in a conflict-free way if we want. Or with a custom UI or whatever. Its strictly more information that you can generate with diff-match-patch. The problem is there's no obvious place on the filesystem to put that information, or way to tell the OS about changes as they happen. And so long as the file system is the way that disparate programs talk to each other, and the file system can't handle this information, programs ends up just discarding any detailed change sets. And we end up with ugly JSON merge conflicts in 3d files. Collaborative editing (if it happens at all) ends up done on a per-app basis rather than just working by default across the whole OS - like it should. And the result of all that is that the desktop is being slowly sidelined in favour of proprietary web apps (like figma or google docs). Why? Because web apps aren't constrained to the paradigm of saving and loading files. It won't be easy, but it seems to me like a no-brainer for us to fix.
- eternalban 5y ago> web apps aren't constrained to the paradigm of saving and loading files. How is reading and writing bytes to FS that different from doing the same on a network stack? In fact I'm puzzled by your post which seems to imply that a 'database' -- a store for structured data -- can't be written over a file system. > The problem is there's no obvious place on the filesystem to put that information, or way to tell the OS about changes as they happen. A thin layer of abstraction over FS seems reasonable, possible, and frankly ancient tech: they are called databases.