Repository navigation
a reconnect voids every chunk in flight (ConnectionReplaced) - found by the probe checker; probe-v1 env - #15
Merged
Merged
Conversation
…nReplaced); probe-v1 env for plugrl-conformance --probe The probe checker's resync scenario failed this client: after the agent reconnected inside its next call, envs mid-chunk kept executing chunks from the old connection and sent their feedback on the new one, and a failed feedback was followed by a reconnect inside the next feedback call. SPEC 7.6 forbids both. The agent now raises ConnectionReplaced instead, feedback never reconnects, and the rollout drops every chunk in flight and re-plans every env; ended episodes are still reset. The reconnect-on-server-stop resend (the SPEC 7.6 Gap) is gone with it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stricter checker from plugrl-protocol#8 graded this client for the first time and failed it in the resync scenario. The bug is real.
What went wrong. The agent reconnected inside its next call, without telling the rollout. Chunks from the old connection were finished and fed back on the new one, in two ways:
feedbackcall reconnected, so the first message on the new connection could be a stale feedback.SPEC.md section 7.6 forbids both. The server has no step state for those envs on the new connection. Since plugrl-server#104 it warns and discards them; before #104 it stored transitions built from empty observations.
The fix.
ConnectionReplaced.WebSocketEnvClientAgentnumbers its connections and remembers which one answered the caller's last infer. When that connection is gone, it raisesConnectionReplaced:inferafter a reconnect, before sending anything;feedbackwhose send fails;feedbackcalled after the connection closed.feedbacknever reconnects. A feedback is only sent on the connection that answered its infer.ConnectionReplaced, so its next infer re-plans every env on the new connection. Episodes that ended are still reset when their feedback is dropped, which is the bug the checker found in the Python reference client (protocol#8, last commit).--reconnect-on-server-stop, a stop during a feedback send used to resend that feedback. It is now dropped like any other.probe-v1. A new env,envs/probe_env.py, implements the SPEC 8.1 probe environment so this client can be graded the same way as the reference clients. It needs no extra.Checked.
plugrl-conformance --probe --scenario allagainstprobe-v1, with 3 envs and horizon 4, failed the resync scenario: feedback for envs 0 and 2 had no action on the new connection.test_reconnect_drops_feedback.pynow expectsConnectionReplaced, and adds the stop-with-reconnect case, feedback never reconnecting, and the first infer after a reconnect sending nothing.test_rollout_connection_replaced.pyruns the rollout onprobe-v1with an agent that replaces the connection mid-run. No stale chunk is fed back, the first infer on the new connection names every env, and an ended episode is reset when its feedback is dropped.Follow-ups.
plugrl-conformance --probe --scenario allagainstprobe-v1on every change.