<commit_before>class RenderGraph {
  constructor(ctx, dot) {
    this.renderPasses = [];
    this.ctx = ctx;
    this.dot = dot;
  }

  beginFrame() {
    this.renderPasses.length = 0;
  }

  renderPass(opts) {
    const passId = opts.pass?.id || "RenderPass " + this.renderPasses.length;
    const passName = opts.name || opts.pass?.name || null;

    this.dot.passNode(passId, passName);

    const colorTextureId = opts?.pass?.opts?.color?.[0].id;
    const colorTextureName = opts?.pass?.opts?.color?.[0].name;
    if (colorTextureId) {
      this.dot.resourceNode(colorTextureId, colorTextureName);
      this.dot.edge(passId, colorTextureId);
    } else {
      this.dot.edge(passId, "Window");
    }

    const depthTextureId = opts?.pass?.opts?.depth?.id;
    const depthTextureName = opts?.pass?.opts?.depth?.name;
    if (depthTextureId) {
      this.dot.resourceNode(depthTextureId, depthTextureName);
      this.dot.edge(passId, depthTextureId);
    }

    if (opts.uses) {
      if (this.ctx.debugMode) {
        console.log("render-graph uses", opts.uses);
      }
      opts.uses.forEach((tex) => {
        this.dot.edge(tex.id, passId);
      });
    }

    this.renderPasses.push(opts);
  }

  endFrame() {
    //this should be render view
    this.renderPasses.forEach((opts) => {
      const { pass, renderView, render } = opts;

      this.ctx.submit(
        {
          name: opts.name,
          pass: pass,
          viewport: renderView.viewport,
          scissor: renderView.viewport,
        },
        () => {
          if (render) render();
        }
      );
    });
  }
}

export default function createRenderGraph(ctx, dot) {
  return new RenderGraph(ctx, dot);
}
<commit_msg>fat(render-graph): make dot output optional<commit_after>class RenderGraph {
  constructor(ctx, dot) {
    this.renderPasses = [];
    this.ctx = ctx;
    this.dot = dot;
  }

  beginFrame() {
    this.renderPasses.length = 0;
  }

  renderPass(opts) {
    const passId = opts.pass?.id || "RenderPass " + this.renderPasses.length;
    const passName = opts.name || opts.pass?.name || null;

    if (this.dot) this.dot.passNode(passId, passName);

    const colorTextureId = opts?.pass?.opts?.color?.[0].id;
    const colorTextureName = opts?.pass?.opts?.color?.[0].name;
    if (colorTextureId) {
      if (this.dot) this.dot.resourceNode(colorTextureId, colorTextureName);
      if (this.dot) this.dot.edge(passId, colorTextureId);
    } else {
      if (this.dot) this.dot.edge(passId, "Window");
    }

    const depthTextureId = opts?.pass?.opts?.depth?.id;
    const depthTextureName = opts?.pass?.opts?.depth?.name;
    if (depthTextureId) {
      if (this.dot) this.dot.resourceNode(depthTextureId, depthTextureName);
      if (this.dot) this.dot.edge(passId, depthTextureId);
    }

    if (opts.uses) {
      if (this.ctx.debugMode) {
        console.log("render-graph uses", opts.uses);
      }
      opts.uses.forEach((tex) => {
        if (this.dot) this.dot.edge(tex.id, passId);
      });
    }

    this.renderPasses.push(opts);
  }

  endFrame() {
    //this should be render view
    this.renderPasses.forEach((opts) => {
      const { pass, renderView, render } = opts;

      this.ctx.submit(
        {
          name: opts.name,
          pass: pass,
          viewport: renderView.viewport,
          scissor: renderView.viewport,
        },
        () => {
          if (render) render();
        }
      );
    });
  }
}

export default function createRenderGraph(ctx, dot) {
  return new RenderGraph(ctx, dot);
}

{'fraction_non_alphanumeric': 0.15031020868584322, 'fraction_numerical': 0.001692047377326565, 'mean_word_length': 2.4537487828627067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2681627', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1159, 'n_words': 210}