Mirroring the Vtools V-tree

April 24th, 2020 by Diana Coman

Since at least December 2017, I've been using for all my code publishing and versioning needs the original implemention of V by mod6 that I even packed and published as a starter kit to help newcomers get over the initial bootstrapping issue - also known as "where to start from with this new V thing!!" The reason for my faithfulness to mod6's old implementation is simply that it's an implementation that has been discussed in quite some detail and has been greatly iterated upon, back when TMSR's own public forum worked quite as intended. Nevertheless, as bvt has been dilligently working on owning and improving the vtools suite, clearly communicating on it and on his own history of V use that informs his choices of implementation, I find myself alternating between the two - while the old v.pl still has its niche for quick deployments on environments lacking GNAT for instance, the increasingly polished vtools is growing on me as a more convenient set of tools in my production environment (where GNAT exists already anyway).

As bvt has been nicely introducing on his own blog each new vpatch through an article of its own, I have been following the code and reading and re-reading his vpatches quite easily. But as it turns out that I haven't yet mirrored the vtools V-tree nor published any of my sigs on its vpatches so far, I'll correct now this oversight and publish them all in one go - at least it should make it even easier to find it all here, I suppose. Moreover, since I took the time to read through all the vpatches again from genesis to the current leaf, I got curious regarding size of vpatches and corresponding net changes to the code too - after all, the vtools V-tree is currently one of the few examples of more advanced use of V: it started with what is effectively a "clean, extract and capture" (by phf) of the diffing utility; it successfuly translated parts from another existing V-tree (e.g. my Keccak implementation from the EuCrypt tree, including further updates and improvements to it, as they became available); it was built upon initially by the original author but then by someone else (bvt) who took over quite smoothly and all for the better really; it received changes and updates that were properly published and discussed as well as otherwise informed by direct feedback and actual use. I guess I could even go on adding to this list but as striking as this might be, it seems to me that the list as it is already makes this vtools V-tree quite unique - not even trb's V-tree can boast having all the above really, as far as I'm aware (and yes, I think it's very unfortunate it can't - perhaps it will and hopefully even sooner rather than later, as it's already quite late indeed, as it is).

All the above out of the way, head over to my Reference Code Shelf for my sigs and my mirror of the full VTools V-tree and otherwise here's a tiny bit of data on vtools' code and changes, in chart and table format, for all preferences:

No. VPatch Length of VPatch (lines) LOC (vtools) after pressing Net LOC change
1 vtools_genesis.vpatch 5551 5443 +5443
2 vdiff_fixes_newline_gcc.vpatch 94 5444 +1
3 keccak.vpatch 421 5851 +411
4 vdiff_keccak.vpatch 423 6078 +227
5 vtools_fixes_bitrate_char_array.vpatch 107 6101 +23
6 vtools_vpatch.vpatch 847 6770 +669
7 vtools_fixes_static_tohex.vpatch 47 6771 +1
8 vtools_vpatch_newline.vpatch 384 6946 +175
9 vtools_ksum.vpatch 92 7023 +77
10 vtools_tempfile_standalone_notmp.vpatch 160 7083 +60
11 vdiff_blockwise_read-2.vpatch1 49 7094 +11
12 vtools_fixes_rootdir_files.vpatch 65 7091 -3
13 vtools_small_fixes.vpatch 39 7090 -1
14 vtools_add_vsh.vpatch 274 7353 +263
15 vtools_add_vsh_utils.vpatch 625 7925 +572
16 vtools_vsh_utils_one_binary.vpatch 743 7772 -153
17 vtools_vsh_ada_vfilter.vpatch 1415 7830 +58
18 vtools_vsh_shellcheck.vpatch 149 7830 +0
19 vtools_vsh_ascii_visualization.vpatch 274 7869 +39
20 vtools_vsh_ascii_fix2.vpatch 190 7903 +34
21 vtools_vsh_orphans.vpatch 238 7955 +52
22 vtools_update_keccak.vpatch 881 8087 +132
23 vtools_vsh_fix_awk.vpatch 26 8088 +1

Overall, reading all vpatches makes for a respectable 13094 lines or otherwise a 523 pages booklet at the standard 25 lines per page. If one read instead only the result of the full press to the final current leaf, that would mean ~8100 lines so about 320 pages instead. Note however that the apparent "gain" might come at a higher cost than you think because reading the vpatches as they are has the advantage of getting to know the code more gradually and therefore having perhaps an easier time at understanding the whole thing (as well as the reasons for it being as it is).

Looking at net changes, the genesis is in this case huge compared to the rest - the reason being that it's a capture of an existing utility. There are otherwise a few clearly longer patches, but they don't always result in a similarly big net change (e.g. vtools_vsh_ada_vfilter.vpatch is 1415 lines itself but since it replaces rather than just adds code, the net change is only +58 lines). Nevertheless, there are precious few patches resulting in a net code reduction - and even then, the net change is quite small. Arguably this can mean of course that the code is already at a very good balance between brevity and clarity. Alternatively, it might simply suggest that unless one aims specifically to reduce the codebase, the chances of this happening naturally are very slim indeed and so the codebase will just keep growing for as long as it keeps changing.

On a different note and looking at the overall length of this "booklet" of code and the total number of 23 vpatches, I kind of wonder as well at which point - or under what circumstances - would it truly be preferable (or even feasible) to regrind and gain clarity (hopefully while reducing the code base too) rather than lose it as natural part of losing at least some of the history of all the changes. Supposedly it's something to find out naturally when such a situation occurs - if ever.

  1. From here on, bvt takes over from phf. 

Comments feed: RSS 2.0

3 Responses to “Mirroring the Vtools V-tree”

  1. > the original implemention of V by mod6

    Nice "Aryan physics" you have going there.

  2. Diana Coman says:

    Huh? It's the original implementation of V by mod6 aka the one he did , wtf are you on?

  3. [...] I am by far the most experienced user of V, I have therefore also first-hand experience with all the different ways in [...]

Leave a Reply