With a few small syntax changes, this same file could also drive nest loop index join forward and reverse cases.
It just requires another small replicated table X not included in the schema.py that has a primary key XID and one other XDATA column for equality joining with B or D. It could just contain the rows (10, 10), (20, 20) and you would test with it using lcauses like B = XDATA and XID = _bvalue.
If you do not index XDATA, that should be enough to keep X on the outer side and _table on the inner side of the NLIJ, and should preserve the order-by optimizations.