lichess.org
Donate

Full PV dump/display for any engine analysis

It is my understanding that when in analysis page (either post-game, or study), when manual toggling engine, one can have up to 5 PV for the current displayed position. However, it seems that the full PV is not displayed all the way to the position which is responsible for the (min-max abiding) back-propagated score along that PV.

Moreover, there is no way at current position, to record the displayed truncated PV, in any way that would allow making it a variations anywhere. I can make a screenshot, or find the live html tree node and corresponding CSS values containing the short PVs, but not sure that would be there and how much work.

But most important would be access to the full PV. It would have pedagogical value to all lichess members considering engine scoring of the position they are looking at in lichess anywhere. There certainly could be a local computer SF command line workaround. But that would be tedious compared to having it right from the UI at engine display on top of move variations module.

Is it difficult to implement? or maybe if no dump, a way to display the full PV (so at least I could transcribe from a screenshot, or show someone the full PV. Anybody asked to that before?

That would complete so well the mini-hover-boards on the truncated PVs that have improved the engine display not long ago.

Full engine scoring interpret-ability might become possible and easier...
First, regarding the full PV, I think that's a stockfish limitation rather than a Lichess one. There was an issue some time ago on Github which I can no longer find where stockfish was only giving two ply pvs or something like that. But that part I'm not too sure about.

Second, I agree that recording the truncated PV into a varation would be awesome. It's a very intuitive way to use the exising UI. This feature been asked for at least three times on Github over the years. I've tried to implement it, and it was tougher than expected.

The tough part was making several moves in a row. The current codebase assumes moves get sent to the server one at a time. I'll ask the other devs about this wrinkle and give it some more thought. I want to get variations from PVs working if I can.
Thank you very much for the fast response, and overview.

1) full PV: so even if I used the command line or a UCI engine interface with PV settings exposed, I could not get the full PV printed? (or not always)?

2) Some easier access to the SAN of PV. I understand that the full solution that would naturally make use of existing UI, would be great. And I kind of understand that the coordination with the other module (user variation explorer, if I could chose the terms) would be difficult, as normally, users do create variations move by move not a whole sequence. And i also conclude that is must be the same with post-game proposed SF variations, as they would keep pushing the root of search tree, not use the first root position proposed main PV. thanks i get it now. i think.

Now, short of having lichess do that internally, as we can dump the PGN from post-game, could there be a PV dump? would that be easier?

back to full PV. I was sure that at least command line would do it... Engine internal calculations transparency might need work!? (beyond PV, I would greedily add: make it clear the number of nodes being quiescence tested, pruning evaluated, and leaf evaluated, but that should be another thread, could not resist).
1) I found the old Github issue about short PVs: github.com/ornicar/lila/issues/2423 . It's so old that I don't know if it still is relevant. From observing my desktop Stockfish 13, PV length sometimes decreases when depth increases, so it's possible what Lichess shows might be the best you can get without digging into internals.

2) A PV dump would be easier, but it feels inelegant to me. The displayed PV is just text, so as a workaround, you can actually copy and paste right now. It's a bit tricky because clicking on it makes it change, but if you start your drag from above (to the left of the toggle that turns on stockfish), it is possible.
<Comment deleted by user>
<Comment deleted by user>
screenshot of node from inspector live tree: https://i.postimg.cc/1tmK0Z33/lichess.png
Selectors:
document.querySelector("#main-wrap > main > div.analyse__tools.mqwZNbBL > div.pv_box > div")

It appear that at CSS level in that selector or node, the PV is present as a sequence of FENs, AND, the SAN:
e.g. <span class="pv-san" data-move-index="0" data-board=
"r2q1rk1/4ppbp/6p1/pp1pn3/2pP1B2/1PP1P3/P1Q2PPP/R4RK1|d7e5">Nxe5 </span>
Ah, I mean with normal text, you can select it by clicking and dragging, then you can copy it. That doesn't work in this case because clicking on the PV makes it change. So a workaround (not an actual solution) is starting the drag from above the PV so that you can select text as normal. You'll end up with no spaces in the text, and this works best for the top PV. Not ideal.

But hopefully, such workarounds won't be needed forever. I've actually just finished a patch that turns PVs into variations. So if that gets merged, you'll be able to click on the last displayed move of a PV, and it will get played out on the main board.
<Comment deleted by user>

This topic has been archived and can no longer be replied to.