The short answer is that I just needed a continuously decreasing priority
function that was always greater than 0, and 0.5^n was a pretty good one. I
added some comments about this in the jsdoc.

re: the proof that this is correct. Yeah, I don't buy it either. The
formalism has been really helpful to me for finding good counter-examples
and pathological cases. There were definitely some approaches that I tried
that couldn't possibly work, and this saved me some time. But the formalism
hasn't really been helpful for proving that an approach works


On Wed, Jul 24, 2013 at 4:21 PM, Elizabeth Ford <notifications@github.com>wrote:

> In lib/Builder.js:
>
> > +Builder.prototype._setPrioritiesRecursive = function (node, importantBonus, visited) {
> > +  // TODO(nick): This looks very similar to addImportantDependenciesForNode.
> > +  // We should probably have a higher-order graph-traversal method.
> > +  var i, inputName, inputRootName, inputNode
> > +
> > +  visited[node.newName] = true
> > +
> > +  var hasImportantPeers = false
> > +  for (i = 0; i < node.importantInputs.length; i++) {
> > +    inputName = node.inputs[node.importantInputs[i]]
> > +    inputRootName = utils.getNodeRootName(inputName)
> > +    inputNode = this._compiled.nodes[inputRootName]
> > +    if (inputNode) {
> > +      if (!hasImportantPeers) {
> > +        hasImportantPeers = true
> > +        importantBonus = importantBonus / 2
>
> where does the 2 come from? I tried looking at your proof, and I had
> trouble being convinced that this would guarantee the !important nodes
> would be executed first.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Obvious/shepherd/pull/72/files#r5382878>
> .
>