PKFile Evolution
This illustrates the changes to a PKFile as entries are added to it.
Consider the function:
f(names, b) { r = b/$(_head(names)); foreach n in _tail(names) do { r += b/$n; }; return r; };
This function has primary key 548411d8daa829ab 123257836a0df146.
We'll look at this PKFile (using "PrintMPKFile -verbose") after each of four entries are added.
First call
The first call will be: f(<"x", "y">, [x=1,y=2])
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // <PKFile> (offset 361) // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pk = 548411d8daa829ab 123257836a0df146 // <CFPHeader> num = 1 type = List // <CFPHeaderEntry> cfp = 1ec0671a672cd8e2 0b15ee96ffc8d73d offset = 204 offsetLoc = 20 // <PKFHeaderTail> sourceFunc = /vesta/twd1.shr.intel.com/play/kcschalk/sdl_experiment/checkout/3/4231/foo.ves/f(), line 2, col 4 pkEpoch = 1 nmsEpoch = 1 allNames = *nm[0] = "N/b/y" *nm[1] = "N/names/##1" *nm[2] = "N/names/##0" *nm[3] = "N/names" *nm[4] = "N/b/x" commonNms = { 0-4 } (5 total) // ------------------------------------------------------------------------ // <PKEntries> (offset 204) numEntries = 1 // <PKEntry> (#1) ci = 19527 unFVs = { <<Empty>> } (0 total) value = fp = e0bcd72d03cb6a8f fa44d125d29904f6 DIs = { } tbl = Index Prefix Arc 0 1 y 1 <END> b 2 3 ##1 3 <END> names 4 3 ##0 5 1 x bytes = 00000002 00010000 00030005 4e00004e 00024e00 04... (27 total) kids = { } model = 2812703917 // <PKEntryExtra> (#1) imap = <identity-map> fps = fp[0] = 20bcd72d03cb6a8f 8e44d125d29904f6 fp[1] = 742e9d930b3a1aaf b175d28afb711eb0 fp[2] = 542e9d930b3a1aaf d775d28afb711eb0 fp[3] = e0118715439944d7 48d4f57b00438b3e fp[4] = 20bcd72d03cb6a8f 4e44d125d29904f6
Things to note:
- All free variable names are common names
- There's a single common fingerprint group
- The imap of the new entry is the identity
pkEpoch is 1 because this is the first time this PKFile has been written
nmsEpoch is 1 because this is the first time the set of free variable names for this PK has changed
Second call
Next we'll add an entry for this call f(<"x", "y">, [x=2,y=2]):
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // <PKFile> (offset 361) // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pk = 548411d8daa829ab 123257836a0df146 // <CFPHeader> num = 2 type = List // <CFPHeaderEntry> cfp = 1ec0671a672cd8e2 0b15ee96ffc8d73d offset = 224 offsetLoc = 20 // <CFPHeaderEntry> cfp = 8ec0671a672cd8e2 e615ee96ffc8d73d offset = 423 offsetLoc = 40 // <PKFHeaderTail> sourceFunc = /vesta/twd1.shr.intel.com/play/kcschalk/sdl_experiment/checkout/3/4231/foo.ves/f(), line 2, col 4 pkEpoch = 2 nmsEpoch = 1 allNames = *nm[0] = "N/b/y" *nm[1] = "N/names/##1" *nm[2] = "N/names/##0" *nm[3] = "N/names" *nm[4] = "N/b/x" commonNms = { 0-4 } (5 total) // ------------------------------------------------------------------------ // <PKEntries> (offset 224) numEntries = 1 // <PKEntry> (#1) ci = 19527 unFVs = { <<Empty>> } (0 total) value = fp = e0bcd72d03cb6a8f fa44d125d29904f6 DIs = { } tbl = Index Prefix Arc 0 1 y 1 <END> b 2 3 ##1 3 <END> names 4 3 ##0 5 1 x bytes = 00000002 00010000 00030005 4e00004e 00024e00 04... (27 total) kids = { } model = 2812703917 // <PKEntryExtra> (#1) imap = <identity-map> fps = fp[0] = 20bcd72d03cb6a8f 8e44d125d29904f6 fp[1] = 742e9d930b3a1aaf b175d28afb711eb0 fp[2] = 542e9d930b3a1aaf d775d28afb711eb0 fp[3] = e0118715439944d7 48d4f57b00438b3e fp[4] = 20bcd72d03cb6a8f 4e44d125d29904f6 // ------------------------------------------------------------------------ // <PKEntries> (offset 423) numEntries = 1 // <PKEntry> (#1) ci = 19529 unFVs = { <<Empty>> } (0 total) value = fp = 30bcd72d03cb6a8f 2b44d125d29904f6 DIs = { } tbl = Index Prefix Arc 0 1 y 1 <END> b 2 3 ##1 3 <END> names 4 3 ##0 5 1 x bytes = 00000002 00010000 00040005 4e00004e 00024e00 04... (27 total) kids = { } model = 2812703919 // <PKEntryExtra> (#1) imap = <identity-map> fps = fp[0] = 20bcd72d03cb6a8f 8e44d125d29904f6 fp[1] = 742e9d930b3a1aaf b175d28afb711eb0 fp[2] = 542e9d930b3a1aaf d775d28afb711eb0 fp[3] = e0118715439944d7 48d4f57b00438b3e fp[4] = 20bcd72d03cb6a8f 8e44d125d29904f6
Things to note:
- All free variable names are still common
- The two entries are in two separate common fingerprint groups because they have different values for some of the common names
- Both entries have the identity imap
pkEpoch is 2 because this is the second time this PKFile has been written
nmsEpoch is still 1 because this new entry did not change the set of free variable names for this PK
Third call
The third call will be f(<"x", "z">, [x=2,z=3])
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // <PKFile> (offset 361) // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pk = 548411d8daa829ab 123257836a0df146 // <CFPHeader> num = 3 type = List // <CFPHeaderEntry> cfp = f7db45cfb9adbb60 bdc2faccf3cb8a8a offset = 252 offsetLoc = 20 // <CFPHeaderEntry> cfp = 45b9edcb80650b96 3c55a7b668c91aee offset = 509 offsetLoc = 40 // <CFPHeaderEntry> cfp = e5b9edcb80650b96 9e55a7b668c91aee offset = 746 offsetLoc = 60 // <PKFHeaderTail> sourceFunc = /vesta/twd1.shr.intel.com/play/kcschalk/sdl_experiment/checkout/3/4231/foo.ves/f(), line 2, col 4 pkEpoch = 3 nmsEpoch = 2 allNames = nm[0] = "N/b/y" *nm[1] = "N/names/##1" *nm[2] = "N/names/##0" *nm[3] = "N/names" *nm[4] = "N/b/x" nm[5] = "N/b/z" commonNms = { 1-4 } (4 total) // ------------------------------------------------------------------------ // <PKEntries> (offset 252) numEntries = 1 // <PKEntry> (#1) ci = 19531 unFVs = { 5 } (1 total) unTag = xor = 1af80608d1526e79 fp = 5da09e8ebf48d84e 2adfba1e4aa95ae6 value = fp = 40bcd72d03cb6a8f 0844d125d29904f6 DIs = { } tbl = Index Prefix Arc 0 1 z 1 <END> b 2 3 ##1 3 <END> names 4 3 ##0 5 1 x bytes = 00000002 00010000 00050005 4e00004e 00024e00 04... (27 total) kids = { } model = 2812703921 // <PKEntryExtra> (#1) imap = { 1->1, 2->2, 3->3, 4->4, 5->0 } fps = fp[0] = e0bcd72d03cb6a8f fa44d125d29904f6 fp[1] = 542e9d930b3a1aaf 0775d28afb711eb0 fp[2] = 542e9d930b3a1aaf d775d28afb711eb0 fp[3] = 33118715439944d7 84d4f57b00438b3e fp[4] = 20bcd72d03cb6a8f 8e44d125d29904f6 // ------------------------------------------------------------------------ // <PKEntries> (offset 509) numEntries = 1 // <PKEntry> (#1) ci = 19527 unFVs = { 0 } (1 total) unTag = xor = aef80608d1526e79 fp = b9a09e8ebf48d84e bcdfba1e4aa95ae6 value = fp = e0bcd72d03cb6a8f fa44d125d29904f6 DIs = { } tbl = Index Prefix Arc 0 1 y 1 <END> b 2 3 ##1 3 <END> names 4 3 ##0 5 1 x bytes = 00000002 00010000 00030005 4e00004e 00024e00 04... (27 total) kids = { } model = 2812703917 // <PKEntryExtra> (#1) imap = <identity-map> fps = fp[0] = 20bcd72d03cb6a8f 8e44d125d29904f6 fp[1] = 742e9d930b3a1aaf b175d28afb711eb0 fp[2] = 542e9d930b3a1aaf d775d28afb711eb0 fp[3] = e0118715439944d7 48d4f57b00438b3e fp[4] = 20bcd72d03cb6a8f 4e44d125d29904f6 // ------------------------------------------------------------------------ // <PKEntries> (offset 746) numEntries = 1 // <PKEntry> (#1) ci = 19529 unFVs = { 0 } (1 total) unTag = xor = aef80608d1526e79 fp = b9a09e8ebf48d84e bcdfba1e4aa95ae6 value = fp = 30bcd72d03cb6a8f 2b44d125d29904f6 DIs = { } tbl = Index Prefix Arc 0 1 y 1 <END> b 2 3 ##1 3 <END> names 4 3 ##0 5 1 x bytes = 00000002 00010000 00040005 4e00004e 00024e00 04... (27 total) kids = { } model = 2812703919 // <PKEntryExtra> (#1) imap = <identity-map> fps = fp[0] = 20bcd72d03cb6a8f 8e44d125d29904f6 fp[1] = 742e9d930b3a1aaf b175d28afb711eb0 fp[2] = 542e9d930b3a1aaf d775d28afb711eb0 fp[3] = e0118715439944d7 48d4f57b00438b3e fp[4] = 20bcd72d03cb6a8f 8e44d125d29904f6
Things to note:
- There are now uncommon names.
- Because the set of common names changed, the common fingerprints of the CFP groups changed
- The new entry has a non-identity imap
pkEpoch is 3 because this is the third time this PKFile has been written
nmsEpoch is 2 because this is the second time the set of free variable names for this PK has changed
Fourth call
The fourth call will be f(<"v", "z">, [v=4,z=3])
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // <PKFile> (offset 361) // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pk = 548411d8daa829ab 123257836a0df146 // <CFPHeader> num = 3 type = List // <CFPHeaderEntry> cfp = f251d94378ffbaae 000d7dfac86b564a offset = 260 offsetLoc = 20 // <CFPHeaderEntry> cfp = 1394139f36f5c880 a3666d0aca8c1119 offset = 517 offsetLoc = 40 // <CFPHeaderEntry> cfp = 8d456d05a628c109 6dbeee10f4e24f88 offset = 774 offsetLoc = 60 // <PKFHeaderTail> sourceFunc = /vesta/twd1.shr.intel.com/play/kcschalk/sdl_experiment/checkout/3/4231/foo.ves/f(), line 2, col 4 pkEpoch = 4 nmsEpoch = 3 allNames = nm[0] = "N/b/y" *nm[1] = "N/names/##1" *nm[2] = "N/names/##0" *nm[3] = "N/names" nm[4] = "N/b/x" nm[5] = "N/b/z" nm[6] = "N/b/v" commonNms = { 1-3 } (3 total) // ------------------------------------------------------------------------ // <PKEntries> (offset 260) numEntries = 1 // <PKEntry> (#1) ci = 19533 unFVs = { 5-6 } (2 total) unTag = xor = 0100000000000001 fp = dd5da51369d42d89 ec43b6c2cb7f7fa0 value = fp = 10bcd72d03cb6a8f 8144d125d29904f6 DIs = { } tbl = Index Prefix Arc 0 1 z 1 <END> b 2 3 ##1 3 <END> names 4 3 ##0 5 1 v bytes = 00000002 00010000 00070005 4e00004e 00024e00 04... (27 total) kids = { } model = 2812703922 // <PKEntryExtra> (#1) imap = { 1->1, 2->2, 3->3, 5->0, 6->4 } fps = fp[0] = e0bcd72d03cb6a8f fa44d125d29904f6 fp[1] = 542e9d930b3a1aaf 0775d28afb711eb0 fp[2] = 142e9d930b3a1aaf 2375d28afb711eb0 fp[3] = 8c17227552dea9d6 ccc32e6cf378b8eb fp[4] = 30bcd72d03cb6a8f 2b44d125d29904f6 // ------------------------------------------------------------------------ // <PKEntries> (offset 517) numEntries = 1 // <PKEntry> (#1) ci = 19531 unFVs = { 4-5 } (2 total) unTag = xor = b400000000000001 fp = 98b9f548a134d852 6916ae3e9ead63a9 value = fp = 40bcd72d03cb6a8f 0844d125d29904f6 DIs = { } tbl = Index Prefix Arc 0 1 z 1 <END> b 2 3 ##1 3 <END> names 4 3 ##0 5 1 x bytes = 00000002 00010000 00050005 4e00004e 00024e00 04... (27 total) kids = { } model = 2812703921 // <PKEntryExtra> (#1) imap = { 1->1, 2->2, 3->3, 4->4, 5->0 } fps = fp[0] = e0bcd72d03cb6a8f fa44d125d29904f6 fp[1] = 542e9d930b3a1aaf 0775d28afb711eb0 fp[2] = 542e9d930b3a1aaf d775d28afb711eb0 fp[3] = 33118715439944d7 84d4f57b00438b3e fp[4] = 20bcd72d03cb6a8f 8e44d125d29904f6 // ------------------------------------------------------------------------ // <PKEntries> (offset 774) numEntries = 2 // <PKEntry> (#1) ci = 19527 unFVs = { 0, 4 } (2 total) unTag = xor = c000000000000001 fp = ceb9f548a134d852 5a16ae3e9ead63a9 value = fp = e0bcd72d03cb6a8f fa44d125d29904f6 DIs = { } tbl = Index Prefix Arc 0 1 y 1 <END> b 2 3 ##1 3 <END> names 4 3 ##0 5 1 x bytes = 00000002 00010000 00030005 4e00004e 00024e00 04... (27 total) kids = { } model = 2812703917 // <PKEntry> (#2) ci = 19529 unFVs = { 0, 4 } (2 total) unTag = xor = 0000000000000001 fp = 7eb9f548a134d852 d916ae3e9ead63a9 value = fp = 30bcd72d03cb6a8f 2b44d125d29904f6 DIs = { } tbl = Index Prefix Arc 0 1 y 1 <END> b 2 3 ##1 3 <END> names 4 3 ##0 5 1 x bytes = 00000002 00010000 00040005 4e00004e 00024e00 04... (27 total) kids = { } model = 2812703919 // <PKEntryExtra> (#1) imap = <identity-map> fps = fp[0] = 20bcd72d03cb6a8f 8e44d125d29904f6 fp[1] = 742e9d930b3a1aaf b175d28afb711eb0 fp[2] = 542e9d930b3a1aaf d775d28afb711eb0 fp[3] = e0118715439944d7 48d4f57b00438b3e fp[4] = 20bcd72d03cb6a8f 4e44d125d29904f6 // <PKEntryExtra> (#2) imap = <identity-map> fps = fp[0] = 20bcd72d03cb6a8f 8e44d125d29904f6 fp[1] = 742e9d930b3a1aaf b175d28afb711eb0 fp[2] = 542e9d930b3a1aaf d775d28afb711eb0 fp[3] = e0118715439944d7 48d4f57b00438b3e fp[4] = 20bcd72d03cb6a8f 8e44d125d29904f6
Things to note:
- The set of common names changed again
- The first two entries are now in the same CFP group, because they share the same values for all the common names. (The names on which they had different values are now all uncommon.)
pkEpoch is 4 because this is the fourth time this PKFile has been written
nmsEpoch is 3 because this is the third time the set of free variable names for this PK has changed