```python
def max_path_sum(tri, m, n):
    """
    Finds the maximum total path sum in a given triangle.

    The path starts from the top and moves to an adjacent number on the row below.
    This is solved using a bottom-up dynamic programming approach.
    The triangle is modified in-place to store intermediate maximum path sums.
    """

    # Iterate upwards from the second to last row to the top row.
    for row in range(m - 2, -1, -1):
        # For each element in the current row, update its value.
        for col in range(row + 1):
            # The new value is the sum of the current value and the maximum
            # of the two elements directly below it.
            tri[row][col] += max(tri[row + 1][col], tri[row + 1][col + 1])

    # The top element of the triangle now contains the maximum path sum.
    return tri[0][0]

```