fix(core): fix linear context repair

Chasesomero
Mar 14, 2026, 6:48 PM
YCJ6MMYFMYE4YIZZ4DMRGVEAN4RHY2D4X2JW4JQX77IWI22JDFRAC

Dependencies

  • [2] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [3] MMQCFCIE Correctness of the new algorithm for detecting missing contexts
  • [4] H5DIAL52 Mixed zombie/order conflicts: fixing the bottom vertex
  • [5] HP7CKJIW Fixing a bug in unrecord
  • [6] FSJBK6CU Fixing the stitching in cyclic conflict

Change contents

  • edit in pijul-core/src/apply.rs at line 578
    [2.962675]
    [2.962675]
    fn shares_alive_change(&self) -> bool {
    self.vertex.change == self.last_alive.change
    }
  • replacement in pijul-core/src/apply.rs at line 608
    [4.707][4.707:821]()
    for (_, r) in descendants.range((elt.vertex, Vertex::ROOT)..=(elt.vertex, Vertex::MAX))
    {
    [4.653]
    [6.864]
    let descendants_to_reconnect: Vec<_> = descendants
    .range((elt.vertex, Vertex::ROOT)..=(elt.vertex, Vertex::MAX))
    .map(|(_, r)| *r)
    .collect();
    for r in descendants_to_reconnect {
  • replacement in pijul-core/src/apply.rs at line 615
    [6.1005][6.1005:1047]()
    if elt.last_alive != *r {
    [6.1005]
    [6.1047]
    if elt.last_alive != r {
  • replacement in pijul-core/src/apply.rs at line 621
    [6.1232][6.1232:1260]()
    *r,
    [6.1232]
    [6.1260]
    r,
  • edit in pijul-core/src/apply.rs at line 631
    [5.7240]
    [5.7240]
    let mut saw_dead_on_path = false;
  • replacement in pijul-core/src/apply.rs at line 638
    [5.7529][6.1416:1468]()
    if v.vertex != elt.vertex {
    [5.7529]
    [6.1468]
    if saw_dead_on_path && v.vertex != elt.vertex {
  • edit in pijul-core/src/apply.rs at line 657
    [5.8309]
    [5.8309]
    saw_dead_on_path = true;
  • edit in pijul-core/src/apply.rs at line 713
    [3.1615]
    [4.2146]
    let mut saw_dead_on_path = false;
  • replacement in pijul-core/src/apply.rs at line 719
    [4.2363][4.2363:2810](),[4.2810][6.2360:2454](),[6.2454][5.8605:8647](),[4.2971][5.8605:8647](),[5.8647][6.2455:3475]()
    if v.is_alive() {
    // We need to reconnect, and we can do it now
    // since we won't have a chance to visit that
    // edge (because non-PARENT edge we are
    // inserting now starts from a vertex that is
    // on the path, which means we've already
    // pushed all its children onto the stack.).
    debug!(
    "put_pseudo, alive 2, {:?} {:?}",
    v.last_alive,
    stack[len - 1].vertex
    );
    debug!("{:?}", stack);
    let edge = Edge {
    dest: stack[len - 1].vertex.start_pos(),
    flag: EdgeFlags::empty(),
    introduced_by: ChangeId::ROOT,
    };
    match txn.get_graph(channel, &v.last_alive, Some(&edge.into()))? {
    Some(e) if e.dest() == edge.dest && e.flag() == EdgeFlags::BLOCK => {}
    _ => {
    put_graph_with_rev(
    txn,
    channel,
    EdgeFlags::PSEUDO,
    v.last_alive,
    stack[len - 1].vertex,
    ChangeId::ROOT,
    )?;
    }
    [4.2363]
    [6.3475]
    if v.is_alive() || v.shares_alive_change() {
    if saw_dead_on_path {
    // We need to reconnect, and we can do it now
    // since we won't have a chance to visit that
    // edge (because non-PARENT edge we are
    // inserting now starts from a vertex that is
    // on the path, which means we've already
    // pushed all its children onto the stack.).
    debug!(
    "put_pseudo, alive 2, {:?} {:?}",
    v.last_alive,
    stack[len - 1].vertex
    );
    debug!("{:?}", stack);
    put_graph_with_rev(
    txn,
    channel,
    EdgeFlags::PSEUDO,
    v.last_alive,
    stack[len - 1].vertex,
    ChangeId::ROOT,
    )?;
  • edit in pijul-core/src/apply.rs at line 744
    [4.3198]
    [4.3198]
    saw_dead_on_path = true;