Fixed a issue with resource exhaustion for directx.
This commit is contained in:
@@ -394,6 +394,7 @@ def play_locked(
|
||||
if recommended_comparison is not None:
|
||||
runtime_issues["recommended_one_variable_comparison"] = recommended_comparison
|
||||
clean_exit = outcome.returncode == 0 and current_game_crash is None
|
||||
session_issue = game_log_issue_reason(current_game_log)
|
||||
launch_evidence = game_readiness_signal
|
||||
if launch_evidence is None and current_game_log is not None:
|
||||
launch_evidence = "game_log"
|
||||
@@ -402,6 +403,8 @@ def play_locked(
|
||||
launch_succeeded = launch_evidence is not None
|
||||
report = {
|
||||
"ok": clean_exit,
|
||||
"degraded": session_issue is not None,
|
||||
"session_issue": session_issue,
|
||||
"launch_succeeded": launch_succeeded,
|
||||
"dry_run": dry_run,
|
||||
"runtime": asdict(selection),
|
||||
@@ -430,6 +433,7 @@ def play_locked(
|
||||
**window_launch_metadata,
|
||||
"runtime_seconds": round(game_runtime_seconds),
|
||||
"clean_exit": clean_exit,
|
||||
"degraded": session_issue is not None,
|
||||
"timed_out": outcome.timed_out,
|
||||
"launch_succeeded": launch_succeeded,
|
||||
"game_window_ready": game_window_ready,
|
||||
@@ -440,7 +444,7 @@ def play_locked(
|
||||
"realm": start_option.name,
|
||||
**api._game_exit_metadata(outcome.returncode, selection.kind),
|
||||
}
|
||||
if not clean_exit:
|
||||
if not clean_exit or session_issue is not None:
|
||||
common_game_metadata["failure_reason"] = game_failure_reason(
|
||||
outcome,
|
||||
current_game_log,
|
||||
@@ -516,6 +520,10 @@ def play_locked(
|
||||
exit_message = game_crash_message(current_game_log)
|
||||
elif outcome.timed_out:
|
||||
exit_message = "Game session timed out"
|
||||
elif session_issue == "direct3d_resource_exhaustion":
|
||||
exit_message = (
|
||||
"Game client exited after logging Direct3D resource exhaustion"
|
||||
)
|
||||
elif common_game_metadata.get("signal_inferred") is True:
|
||||
signal_wrapper = (
|
||||
"Proton" if selection.kind == "proton7" else "UMU"
|
||||
@@ -537,12 +545,14 @@ def play_locked(
|
||||
severity=(
|
||||
"error"
|
||||
if current_game_crash is not None
|
||||
else "info" if clean_exit else "warning"
|
||||
else "warning"
|
||||
if not clean_exit or session_issue is not None
|
||||
else "info"
|
||||
),
|
||||
message=exit_message,
|
||||
metadata=(
|
||||
common_game_metadata
|
||||
if clean_exit
|
||||
if clean_exit and session_issue is None
|
||||
else {
|
||||
**common_game_metadata,
|
||||
**failure_evidence,
|
||||
@@ -646,7 +656,7 @@ def game_failure_reason(
|
||||
current_game_crash: dict[str, object] | None,
|
||||
exit_metadata: dict[str, object],
|
||||
) -> str:
|
||||
"""Classify the strongest evidence recorded for a failed game session."""
|
||||
"""Classify the strongest evidence recorded for a failed or degraded session."""
|
||||
|
||||
if current_game_log and current_game_log.get("runtime_out_of_memory") is True:
|
||||
return "direct3d_resource_exhaustion"
|
||||
@@ -659,6 +669,16 @@ def game_failure_reason(
|
||||
return "nonzero_exit"
|
||||
|
||||
|
||||
def game_log_issue_reason(
|
||||
current_game_log: dict[str, object] | None,
|
||||
) -> str | None:
|
||||
"""Classify native-log evidence that degraded an otherwise clean process exit."""
|
||||
|
||||
if current_game_log and current_game_log.get("runtime_out_of_memory") is True:
|
||||
return "direct3d_resource_exhaustion"
|
||||
return None
|
||||
|
||||
|
||||
def game_crash_message(current_game_log: dict[str, object] | None) -> str:
|
||||
if (
|
||||
current_game_log is not None
|
||||
@@ -971,6 +991,16 @@ def print_game_outcome(
|
||||
)
|
||||
elif outcome.timed_out:
|
||||
print("Game client timed out and was stopped.", file=sys.stderr)
|
||||
elif (
|
||||
outcome.returncode == 0
|
||||
and game_log_issue_reason(current_game_log)
|
||||
== "direct3d_resource_exhaustion"
|
||||
):
|
||||
print(
|
||||
"Game client exited with status 0 after logging Direct3D resource "
|
||||
"exhaustion.",
|
||||
file=sys.stderr,
|
||||
)
|
||||
elif outcome.returncode == 0:
|
||||
print("Game client exited normally.")
|
||||
elif outcome.returncode is None:
|
||||
@@ -1039,8 +1069,8 @@ def print_interrupted_game_log(report: dict[str, object]) -> None:
|
||||
print(
|
||||
"Detected Direct3D resource exhaustion in the 32-bit game process"
|
||||
+ effect_text
|
||||
+ ". Restarting the client can recover temporarily; depot repair will not "
|
||||
"fix this failure.",
|
||||
+ ". Restarting clears the process address space, but this condition can "
|
||||
"recur; depot repair will not fix it.",
|
||||
file=sys.stderr,
|
||||
)
|
||||
elif report["managed_asset_integrity_failed"]:
|
||||
|
||||
Reference in New Issue
Block a user