<<22-11-2012>>

00:01:58*dedis15 quit (K-Lined)
00:03:19dom96This dedis seemed like some sort of weird bot attack.
00:04:00Araqnah, he is just a guy who loves nimrod
00:04:07Araqand who can blame him? :P
00:04:16dom96And joins every channel to tell everyone about it right?
00:04:30Araqright
00:04:52fowlhe ws in 3 channels im on
00:05:13dom96There were like a lot of different versions of him
00:05:25fowlah yeah
00:05:27dom96dedis, dedis19, dedis15, i'm guessing dedis1-20+
00:05:32fowli didnt notice that at first
00:05:41dom96It was an alien invasion :D
00:38:22fowldom96: https://gist.github.com/4116737 :)
01:06:56*Nimrod quit (Ping timeout: 255 seconds)
01:11:49*Nimrod joined #nimrod
01:39:18zaharyAraq, still here?
01:47:38fowlhrm i have some problems with const >:/
01:48:11zaharyAraq has left probably, maybe I can help?
01:50:45zaharyAraq: I traced the leak to a single TNode.sons sequence marked conservatively from the stack. I'm too tired and I'll be going to bed now. In the meanwhile, please tell me how to fetch the sequence size from the PCell address
01:53:45fowlzahary: sf::Text::getFont() returns const Font*, but i'm unable to use this because nimrod forward-declares all variables (i suspect this should be turned off for cpp generation)
01:56:16fowlnimrod declares it as sf::Font* varname; i tried doing type CPFont* {.importc: "const sf::Font*".} = ptr TFont
01:58:24zaharyand the CPFont* trick didn't work?
01:59:15zaharyI've had similar problems before actually. Nimrod tries hard to cast types, but the C++ rules doesn't allow some of the casts
01:59:47fowlno it still is declared as sf::Font*
02:00:45zaharydo you happen to have another ptr TFont type? try to remove it temporary
02:01:26zaharye.g. if you also have PFont* {.importc: "sf::Font*".}
02:02:20fowlnope i only have TFont
02:05:51*Nimrod quit (Ping timeout: 245 seconds)
02:06:23zaharyahm, so the compiler ignores the importc pragma on the ptr type and just uses what is given for the pointed-to type
02:06:46fowlyea
02:07:28fowland i think if it didnt do forward-declarations in c++ it would be easier to support constructors
02:07:33zaharyif you change TFont* to something like {.importc: "sf::TEST".} will CPFont become sf::TEST*
02:07:51zahary… just to make sure this is the problem
02:08:29fowlyep
02:10:37zaharywe could fix the importc problem, but ideally we should understand a bit more about C++'s const types
02:11:42zaharyyou probably can now make a type like CFont that is importc: "const sf::Font" and then use prt CFont
02:14:45fowlthat seems to work
02:16:04*Nimrod joined #nimrod
02:18:18fowlbut to make it compatible with TFont stuff i'd probably have to call TFont instead sfFont then have type TFont = sfFont | cFont
02:18:39fowlbbl, dinner
04:35:33*XAMPP quit (Quit: Leaving)
06:40:43reactormonkAraq, what do you think of the idea of the special argument syntax in scala that allows you to mark arguments that should be evaluated lazyly? Or does nimrod cover that with templates/macros?
07:42:30*Nimrod left #nimrod ("["Textual IRC Client: www.textualapp.com"]")
08:52:16*Araq_ joined #nimrod
09:51:46*Araq_ quit (Read error: Connection timed out)
09:52:33*Araq_ joined #nimrod
10:13:38*Araq_ quit (Read error: Connection timed out)
10:15:33*Araq_ joined #nimrod
11:15:14*Araq_ quit (Read error: Connection timed out)
11:17:33*Araq_ joined #nimrod
12:15:08*Araq_ quit (Quit: ChatZilla 0.9.89 [Firefox 16.0.2/20121024073032])
12:51:07zaharyAraq, your marker procs are wrong. They don't do the equivalent of forAllChildren. instead they treat all objects as leafs and directly go to doOperation
12:51:17*apriori| joined #nimrod
12:53:24apriori|guys.. say I have a given basetype A, and a type B which inherits from A - actually every visible member of A should be visible to an instance of var B or do I need to cast down to A?
12:54:12apriori|ah, forget it.. stupid error by me
12:55:35zaharythe previous message should read * Araq, your marker procs are wrong? *
12:56:43apriori|btw., is there a public import?
12:57:08apriori|like.. say import something in a module, and I want to forward the import to the module importing my module
12:57:36apriori|or must I use "include" then? (which I wouldnt like, because isnt that like C #include?)
12:58:34zaharynot yet, but we've talked about it
12:58:57zaharythere will be export keyword, so you'll be able to say import foo; export foo
12:59:08apriori|hm
12:59:29apriori|wih export being able to name the entire module?
13:01:02apriori|btw., another thing I constantly don't quite like is the special syntax of importing by pathspec like import "subpath/module"
13:01:19apriori|vs something like import subpath/module or import subpath.module
13:01:30zaharylet's say you do this from your module bar. the code that imports bar will see bar.foo as module, so bar.foo.someProc will be the syntax to call it
13:01:30zaharyprobably, there will also be a way to flatten the exports (pretend that they are coming from your own module)
13:02:20apriori|yeah, ok
13:03:02zaharyI have asked about import subpath.module before and Araq gave me some reason why it's problematic, but can't remember the details
13:03:21apriori|I dont even need that dot...
13:03:29apriori|but one should really get rid of having to use a string literal
13:04:02zaharythe string literal gives you spaces in the name (if you are crazy enough to use them)
13:04:18apriori|one should instantly shot those anyway :P
13:04:38apriori|well, that may be true...
13:04:51apriori|buts its inconsistent with normal import in current path
13:06:06*q66 joined #nimrod
13:09:57apriori|ohm, what is the bitwise NOT operator in nimrod?
13:11:59apriori|k, the tutorial says, its apparently also NOT
14:41:42*apriori| quit (Ping timeout: 244 seconds)
14:47:39*FreeArtMan joined #nimrod
16:10:24dom96fowl: yay. Nice job!
16:10:59dom96elif defined(MacOS): ## is this the right conditional?
16:11:22dom96IIRC it's darwin
16:33:59*XAMPP joined #nimrod
16:33:59*XAMPP quit (Changing host)
16:33:59*XAMPP joined #nimrod
17:21:05*FreeArtMan quit (Quit: Out of this 3D)
17:37:16Araqreactormonk: lazy parameters turned out to be problematic in D but I can't remember the details
17:37:25Araqbut yeah, nimrod's way is to use a macro instead
17:40:11Araqzahary: it's unlikely they're wrong, we have tests guarding against that ... and in fact they had a bug that adrianv encountered
17:48:27zaharyplease explain how the CollectCycles is supposed to work
17:49:22zaharyhttp://www.research.ibm.com/people/d/dfb/papers/Bacon01Concurrent.pdf is it supposed to implement the algorithm from here?
17:50:38zaharythey are wrong in the sense that they don't traverse the whole graph when decrementing the references. I'm sure they don't do that as I stepped through the code, but maybe your algorithm is not supposed to do it?
17:51:58Araqthe paper was the base for the GC, yes but the cycle collector works differently
17:53:38zaharyso what is supposed to happen? can you explain it in a few sensences?
17:54:12Araqit's called "Christoper's partial mark-sweep garbage collector"
17:54:22AraqPython uses the same algorithm
17:54:40Araqthe idea is to traverse the graph and decref reference counts
17:55:35Araqafterwards the objects with RC == 0 are "dead"
17:55:55zaharyso far it's like the above paper
17:56:06Araqmeaning they are not referenced by some extern root
17:56:17zaharytraverse the whole graph, right?
17:56:44Araqthe transitive closure of the potential roots of a cycle
17:56:51Araqnot the whole graph
17:57:02zaharyyes, the whole graph from a given root is what I meant
17:57:06Araqso yeah it works quite like the paper but it's not incremental
17:57:18AraqI use no colors
17:57:26zaharyhow do you known that I have traversed some node alraedy? you don;t use any coloring?
17:58:04zaharyi.e. what prevents endless recursion on cycle
18:00:33Araqin collectCycles the first loop is not recursive
18:00:44Araqso no endless recursion is possible
18:01:15zaharybut then it doesn't recref the "transitive closure of the potential roots of a cycle"?
18:01:20*TheVoid quit (Read error: Connection reset by peer)
18:01:50Araqhrm true
18:02:08Araqwell the second loop uses a var marker: TCellSet
18:03:14zaharybut the second loop just adds references, in effect it will add more to the refcount than what was taken in the first step
18:03:44zaharybut even if it wasn't doing this, the first step will be not enough
18:04:19Araqdunno my head is hurting today anyway
18:04:37zaharynext question. why do you add a cycleCandidate in incRef?
18:04:51zaharyyou are supposed to remove a previous candidate there
18:04:58Araqhowever I am sure it's not as simple as you think it is :P
18:05:26Araqafter all we have tests for this ...
18:05:47Araqwith some evil cycles
18:05:50zaharyI can try to produce some leak test cases armed with the new knowledge
18:06:16Araqyeah good
18:06:44Araqfor instance what you need to understand is that 'forallChildren' is not recursive in the way you think it is
18:07:06zaharyyeah, ok, I got that now, you use externally driven recursion as in the second loop
18:07:13Araqit only traverses the *direct* embedded children
18:07:27Araqthe recursion is only there for array of array of object etc.
18:07:39AraqtyRef, tySeq, tyString are always leaves
18:08:10zaharywhat about my incRef question?
18:08:33zaharyalso, I've read the papers and there are some other issues raised there that I haven't looked up in the code yet
18:08:58zaharydo you consider objects from the ZCT that survived collection as a cycle candidates for the next collection?
18:09:52AraqI can't remember but pointers in the ZCT can't be part of a cycle
18:10:06Araqyou can't build cycles with only pointers on the stack
18:10:50zaharyyou can orphan a cycle by "cutting" the only refence to it from the stack, thus skipping the write barrier
18:11:09Araqyeah that's a but in the original paper
18:11:29Araqbut I do add to the cycle candidates in incRef for this reason
18:11:35Araq*that's a bug
18:11:51zaharythat's what I though too
18:12:22zaharythere is also a more recent and a bit more complicated paper that uses a more efficient write barrier
18:12:39Araq"more efficient"?
18:12:42zaharyit adds fewer objects as cycle candidates
18:12:57Araqthe original paper adds to some external heap local arrays
18:12:58zaharyalso, it can be extended to concurrent operation
18:13:23Araqthat's so bad for performance that I dunno if they really ever implemented that ...
18:13:47AraqI mean the original write barrier completely destroys performance
18:13:58Araqbeen there, done that :P
18:14:32zaharymost of the papers use this local buffers, but in a different way
18:14:49zaharydo you remember what did you implemented?
18:15:55Araq(I meant thread local arrays)
18:16:15zaharyyeah, sure
18:16:37Araqwell I did quite a lot with arrays, tried lots of things
18:17:01Araqyou can also use some crazy stuff with bitsets and intersections
18:17:30Araqfor instance you can use a negative RC to index into the ZCT for fast ZCT removal
18:18:10zaharydo you remember marking pointers with a dirty bit and adding only the first "dirtifying" write as a candidate? this is one of the suggested techniques
18:19:02Araqhu? potential cycles are already kept in a bitset ... no duplicates in there anyway
18:19:26zaharyit's a hash table to be precise
18:19:51zaharyand you'll have to scan the candidate on the next CollectCycles
18:19:57Araqit's a hash table of bitsets
18:20:04zaharyso it's a win if you avoid adding candidates
18:20:44AraqI fight that with static type analysis
18:20:56zaharywell, sure. everybody does that
18:21:14Araqyeah but I can cheat with 'acyclic' :P
18:21:38zaharyall of this is orthogonal to the specific write barrier
18:22:47Araqall of this is also largely irrelevant for hunting the memory leak ;-)
18:23:51Araqunless you fear the fix will slow doewn the GC tremendously :D
18:24:43Araqbtw the compiler/GC system tries hard to avoid *adding* to the ZCT
18:24:59Araqbecause that's what's much more expensive
18:25:20zaharyfixing CollectCycles may slow things down a little bit, but I don't worry about this now. I'm just building an inventory of what future improvements are possible
18:25:37AraqaddNewObjToZCT for instance makes benchmarks worse but the compiler itself faster ...
18:25:52zaharybtw, did you catch my previous message about the seq marked from the stack
18:26:01zaharynow that's a bitch :/
18:26:06AraqI did but thought you changed your mind
18:26:16Araqand now blame the cycle collector
18:26:23zaharynope, I just disabled temporary stack marking to arrive at the next problem
18:26:34dom96Araq: Well, i've analysed the builder with the thread analyser (now that you've fixed that bug), and it doesn't seem to be coming up with anything.
18:26:43Araqdom96: I know
18:26:51dom96Araq: I get those "analysis could not be complete" warnings though
18:27:01Araqyeah but they are irrelevant
18:27:16AraqI will analyse your code but not today
18:28:06Araqcan you try to disable threads and see if the problem is still there?
18:28:43Araqzahary: is it an interior pointer? or some other false positive?
18:30:53dom96Araq: unfortunately no
18:31:13Araqzahary: think about it ... both PNode and PRope are potentially cyclic in Java ... the 'acyclic' pragma is quite important ;-)
18:32:26zaharythe acyclic pragma is super cool, but static "is cyclic" is just one aspect present in all algorithms
18:34:14zaharyI use the following code to print some info about the sequence:
18:34:14zaharylet sq = cast[PGenericSeq](cellToUsr(objStart))
18:34:14zaharyc_fprintf(c_stdout, "seq len: %d\noffset: %d\n", sq.len, cast[TAddress](p) - cast[TAddress](sq))
18:34:23zaharyI get seq len: 1 and offset: 24
18:35:01Araquse '%ld' instead
18:35:09zaharyp is the original gcMark address
18:36:22zaharyfrom the leakDetector code, I previously determined that this is a sequence allocated in ast.nim/shallowCopy (the sons on the last line)
18:38:57Araqwell looks like a false interior pointer
18:40:01Araqwe have a way to turn them off
18:40:30Araqbut it requires a GCC extension (the "guard" thing) and slows down everything
18:41:29zaharyit's also not the complete problem. I've just added a bool flag in system.nim that disables stack marking and I set it just before my fullcollect
18:41:54Araqsounds dangerous :D
18:42:27zaharycould trigger more collections, but not fewer :)
18:46:31Araqso ... I guess the leak is gone with boehm's gc?
18:48:05zaharynope, but I cannot disable the stack marking there
18:50:10Araqyay :-)
18:54:58Araqhave you tried --gc:boehm and -d:release btw?
18:55:22zaharyprobably not
18:55:32Araqoften debug builds are much worse wrt false positives on the stack as a release build makes much more efficient use of the stack
18:59:47*Vladar joined #nimrod
18:59:50VladarHi
19:05:09Araqhi Vladar
19:07:51*ekselkiu joined #nimrod
19:16:09Araqsee you later
20:01:18zaharyAraq, I pushed 2 leak cases. one is due to the bug in CollectCycles. the other is about orphaning a cycle from the stack (the common issue from the paper I mentioned)
20:14:41Araqdamn you, zahary
20:15:18Araqmeh this means I have to read and understand my GC again ...
20:15:45Araqcan't there ever be a release without hard bugs?
20:19:03Araqcan't see how my algorithm fails for stackrefleak ...
20:21:58Araqoh I see :P
20:22:10Araqit's due to some optimization of mine I think
20:24:50Araqso yeah the shallow decref is wrong with the newObjRC1 optimization I think
21:58:44zaharyI don't see how a shallow decref could work in any setting, you really need to walk the full graph there
21:59:36zaharyabout stackref: you can orphan a cycle by "cutting" the only refence to it from the stack, thus skipping the write barrier
22:00:14zaharythe paper I read about it is this one:
22:00:14zaharyhttp://researcher.watson.ibm.com/researcher/files/us-bacon/Paz05Efficient.pdf
22:01:22zaharyI like it terse descriptions, but it also quotes very often the previous more detailed paper written partly by the same team:
22:01:22zaharyhttp://www.cs.technion.ac.il/~erez/Papers/refcount.pdf
22:01:33zahary* its terse *
22:04:25Araqwell I changed stackrefleak somewhat to prevent the generation of newobjrc1 but the leak remains
22:05:01Araqdunno what you mean but "cutting" the only reference to it from the stack ...
22:05:15Araqoh I see ...
22:05:33AraqXD
22:06:31Araqhowever I still think the shallow decref is correct if every node involved in the cycle is in 'cycleRoots'
22:06:56Araqwhich is what I thought to be the case given that it's added in incRef
22:09:05zaharyit will be in cycleRoots only until the next collection, if it survives it all bets are off
22:10:08Araqyeah I noticed
22:10:13Araqthat's the real bug
22:10:16*shevy joined #nimrod
22:11:19Araqotherwise the shallow decref would be correct, right?
22:12:31zaharywell, if everything is kept in cycleRoots all the time what's the point of having such a collection?
22:12:45zaharyyou need to keep all objects that are part of the cycle in order to be correct
22:14:16AraqI still like the idea :P
22:15:04zaharythe algorithm in the second paper sounds quite smart btw, I think you read a previous paper that really sounds ludicrous in the way it implements concurrent updates to the refcounts
22:15:56AraqI'm skimming the Paz05Efficient.pdf
22:16:17zaharyyes, that's what I meant by second - in chronology
22:20:37zaharyhttps://docs.google.com/viewer?a=v&q=cache:O0YPLKDnaVUJ:www.cs.technion.ac.il/~erez/presentations/cycle-collection.ppt+&hl=en&gl=bg&pid=bl&srcid=ADGEEShiepZGoyF0aUFkKEq-EXjYj54J7tnULa0lKZPFqHQOAewklEg1Us9EGMiOSa9VWk1mNA2Lq4qsnpK74xkH1Hmy9s9kgF0gIepR95g9pz5xu-e6g-x5ryMmo31WUQcgQK1KsM1F&sig=AHIEtbT413HA0crdzLzFgmn96f06MuEaTA
22:20:48zaharythis is alternative presentation for the same paper
22:21:30fowldom96: thanks
22:22:35Araqyay slides
22:23:08Araqwell the idea is that you can ignore that cycle candidates that have been proven alive
22:23:29Araquntil the write barrier indicates some changing of this subgraph again
22:23:36Araqin which case they are added again
22:23:42zaharyall of them?
22:23:48zaharyin the write barrier?
22:23:49Araqlol no
22:23:58Araqbut a single root is enough
22:24:08Araqok not with my totally broken shallow decref ...
22:24:12Araqbut you get the idea
22:24:33zaharywell, sure, don't do shallow decref and everything is fine
22:24:59zaharythe papers go to great lengths to not put objects in the cycle roots unless it's really necessary
22:25:35Araqproblem is: not everything is fine at all
22:25:52Araqbecause indeed the stack can keep the cycle alive
22:26:03Araqbut hrm
22:26:06Araqmaybe it can't
22:26:16Araqafter all, we decref stack roots at the end again
22:26:44zaharyit's explained in the 05 paz paper. if an object survives collection only because of a stack ref, it must be added to cycle roots for the next collection
22:27:06Araqtrue
22:30:50Araqbtw I never got the optimization to prevent the "2n RC operations"
22:33:01Araqhow can these prevented at runtime in practice?
22:33:15Araqall the workarounds are easily more expensive than the RC updates ...
22:33:38Araqand I can't think of a single workaround that would be cheaper ...
22:36:28zaharyI haven't yet made it to the section where this is explained, but there are 2 components to the algorithm
22:36:28zaharyone is the actual guarantees that it's enough to only add the "dirtifying change" (no more book keeping required) - you fix that with some special considerations when it's time to release the objects. the other bits are about concurrent operation and they could be argued as too expensive
22:38:43Araqit's academic anyway I think: the RCs are not updated for the example as it's either a stack location that traverses through the list or it's some swap() operation which can easily optimized away statically
22:39:16Araq(Nimrod's swap optimizes RC updates away too ...)
22:40:46zaharydoesn't sound that academic to me. I can imagine a field to change a few times between collections. it's not only about swap
22:41:07zaharyand if you lose nothing, how can you argue against it?
22:42:35Araqthe example is a single pointer 'p' that changes its value in "a row"
22:42:57Araqif other pointer operations happen in between it's even harder to optimize the RC ops away
22:43:25zaharythis is not the static lifetime analysis of RC updates of stack values
22:43:38AraqI know
22:43:39zaharyI remember that paper, but this is different.
22:43:48Araqyes, it is different
22:44:03Araqcan't see it ever work well in practice :P
22:44:06zaharyyou keep references counts normally, the only difference is what you decide to consider a cycle root for the next collection
22:44:26Araqwhat?
22:44:38AraqI don't think we're talking about the same topic then ...
22:44:46zaharywell, read the paper
22:46:01zaharyI haven't finished it yet. probably tomorrow I'll be able to make more precise statements about it :)
22:47:21Araqso ... are you up to fixing the cycle collector?
22:47:30Araqor should I do it?
22:48:14zaharyI could try, but would like me changing a lot of stuff around there? I would store colors in the nodes instead of the aux hash tables, etc
22:48:39Araqwhy?
22:49:50zaharyhash tables are quite slower in practice than direct memory acesses
22:50:02zahary… in my experience.
22:50:18Araqwell the code already provides the colors
22:50:20Araqso fine
22:50:38zaharyaux table could reduce memory usage. that's my only doubt
22:50:52zaharybut only if you decide to compress the refcount as well
22:51:02AraqI'm not following
22:51:15Araqyou got the lowest 3 bits in the RC for the colors
22:51:23Araqit's already there
22:51:54zaharythey postulate that most objects have a ref count of 1, so they store a compressed refcount in a external bitmap. if it overflows, they allocate a full refcount in aux hash table
22:52:15zaharybut I prefer inline count and colors until proven wrong :)
22:52:33Araqexactly :-)
22:52:37zaharythat's from a previous paper btw, not the 05 one
22:52:55Araqaux hash table for RC looks very stupid
22:53:20Araqand we have no bit to spare anyway
22:53:28zaharygot me thinking that certain objects are not sharable
22:53:43zaharymaybe that's what they missed - a seq and string can't have ref count different from 1
22:53:51Araqwe could use the lowest bit of the type field
22:54:04Araqbut then you need to clear that bit for accessing the type field
22:54:07zaharyand you can have some special treatment for non sharable objects
22:54:51Araqbut easier sharing is a feature of a GC'ed language
22:55:00Araqpeople make more and more use of sharing
22:55:44Araqyou could instead go with per type blocks and have the type field only stored block-wise
22:56:00Araqand you save 8 bytes for every allocated object this way on a 64bit machine
22:56:13zaharyyeah, I've thought about this. we really want ref string to have the same physical representation as a normal string - i.e. a direct pointer to allocated memory. the only difference is that it's sharable and default constructed to null
22:56:39zahary(that about sharing)
22:57:02AraqI have other plans instead of ref string ;-)
22:57:08zaharywhat are they?
22:57:45AraqPRope = object[le, ri: PRope, payload: array[0.., char]]
22:58:04AraqunsafeNew(myrope, sizeof(...))
22:58:43Araqthe old "extensible" struct hack of C
22:59:26zaharyok, but that's an alternative type to ref string. does your idea about "ref string" differ somehow from what I said?
22:59:40zahary* about "ref string" itself *
22:59:49Araqref string would be inconsistent
22:59:59fowli thought strings were already refs
23:00:08zaharyunder the hood
23:00:17zaharythey have value semantics otherwise
23:00:29zaharywhen you said ref1 = ref2, now both refs point to the same objects
23:00:32Araqbut you can do: PRefString {.shallow.} = object s: string
23:00:35zaharywith strings you get copies
23:00:41Araqhrm, damn still one indirection left
23:01:10zaharywhat I said is that the compiler cheats a little bit and uses the same physical representation
23:01:25Araqwell you can't have everything
23:01:27zaharychanges the "porcelain" semantics of the types only
23:01:37zaharysurely it can be implemented
23:01:42Araqeither you go with destructors and value semantics
23:02:06zaharystring - value semantics
23:02:06zaharyref string - ref semantics, but the same pointer to buffer implementation
23:02:15zaharywhat's wrong with that?
23:02:20Araqit can't work
23:02:24zaharywhy so?
23:02:28Araqand would special case 'ref string' in the language
23:02:36Araqthink of buffer growing
23:03:06AraqI think the extensible struct C hack is all that's needed
23:03:26Araqand then you can have GC'ed immutable strings with O(1) concatenation
23:03:41Araqcan't think why I even want 'ref string' then
23:04:52zaharyahm, your point is that if the buffer is going to be reallocated, we need that indirection. true
23:05:19*ekselkiu quit (Ping timeout: 260 seconds)
23:06:07Araqbuffer growing + value semantics --> 1 indirection; buffer growing + reference semantics --> 2 indirections
23:07:10Araqstrings are hard to design ... :-/
23:07:11zaharybtw the other day when we talked about case objects vs inheritance, it occurred to me that it's possible to allocate "just enough" memory for a case object in the heap if you give up the possibility for resetting the value
23:07:25Araqyes I know
23:07:36Araqcase objects really want to be immutable anyway
23:07:51Araqand require a notion of construction
23:08:24Araqthat's why every functional language has constructors
23:08:32Araqand can't do away with only functions
23:12:49Araqand btw 'case objects' are fine for the acyclic analysis and inhertiance is bad; every open class must be assumed to be potentially cyclic
23:13:37zaharystatically assumed. you can still check metadata at run-time
23:14:25Araqgood point
23:14:46Araqyou need to register class types then but DLL support kind of requires that too
23:20:07Araqthe compiler runs the cycle collector 7 times in total iirc
23:20:52Araqso it's important that most cyclic roots can really be thrown away after a cycle collection
23:21:16Araqwhat else you do in this 7 collections is mostly unimportant I think
23:21:36Araqso I wouldn't change to colors etc.
23:21:49zaharywhat colors do you have now?
23:21:54AraqI would fix the bugs and hope and pray it doesn't affect performance
23:22:09Araqlook at line 34
23:22:12zaharythe actual marking algorithm needs some more colors
23:22:34AraqrcZct is not a color but a flag and it's used
23:22:54Araqthe other colors are defined for the future :-)
23:23:09Araqbut as I said the bits are already free for them
23:23:12zahary2 bits unused at the moment?
23:23:18Araqyes
23:23:21zaharyok
23:23:50zaharywell, it doesn't matter that much if we decide to increment by 16 to free another bit, does it?
23:24:09Araqit shouldn't
23:24:31Araqit would be a bit more efficient to inc/dec 1 instead of 8 though
23:24:40Araqas x86 has special opcodes for that
23:24:53Araqso the code size may shrink
23:25:38zaharyyou only have checks that refcount is effectively 0? if refcount < 8?
23:25:58Araqyeah in fact, I had quite some bugs with that
23:26:20zaharycould be if (refcount << 4) == 0 (if we use the highest bits)
23:26:20Araqsuprisingly it's harder to check against 8 then to check against 0 for me :-)
23:26:42Araqbut that's likely to produce longer asm
23:26:55Araqand some cpus don't like shifts all that much
23:27:03zaharyI have not idea, just mentioning
23:28:29Araqwell I don't really know either, never looked at the generated assembly for all these cases
23:29:12AraqI only thought about I would do that in x86
23:32:42Araq(btw we use the lowest bits obviously)
23:41:06*Vladar quit (Quit: Leaving)
23:42:45Araqbtw instead of making cycle collection concurrent can we make it incremental instead? should be in the papers too
23:43:09Araqthe cycle collector is the only phase of the GC that misses the 2ms deadline
23:44:53AraqI have to sleep now, good night
23:45:01zaharygood night